MCPcopy Create free account
hub / github.com/dailydotdev/apps / Header

Function Header

packages/shared/src/features/onboarding/shared/Header.tsx:26–83  ·  view source on GitHub ↗
({
  currentChapter,
  currentStep,
  chapters,
  showBackButton,
  showSkipButton,
  showProgressBar,
  isSkipDisabled,
  onBack,
  onSkip,
  className,
}: HeaderProps)

Source from the content-addressed store, hash-verified

24}
25
26export function Header({
27 currentChapter,
28 currentStep,
29 chapters,
30 showBackButton,
31 showSkipButton,
32 showProgressBar,
33 isSkipDisabled,
34 onBack,
35 onSkip,
36 className,
37}: HeaderProps): ReactElement {
38 const isFirstStep = currentChapter === 0 && currentStep === 0;
39
40 return (
41 <div className={classNames('flex flex-col', className)}>
42 <div className="relative mx-1 flex h-14 items-center">
43 {showBackButton && !isFirstStep && (
44 <Button
45 aria-label="Go back"
46 data-funnel-track={FunnelTargetId.StepBack}
47 icon={<MoveToIcon size={IconSize.Small} className="rotate-180" />}
48 onClick={onBack}
49 size={ButtonSize.Large}
50 variant={ButtonVariant.Tertiary}
51 />
52 )}
53
54 <Logo
55 className="absolute inset-0 m-auto h-fit w-fit"
56 linkDisabled
57 position={LogoPosition.Empty}
58 />
59
60 {showSkipButton && (
61 <Button
62 className="ml-auto font-normal"
63 data-funnel-track={FunnelTargetId.StepSkip}
64 disabled={isSkipDisabled}
65 onClick={onSkip}
66 size={ButtonSize.Large}
67 variant={ButtonVariant.Tertiary}
68 >
69 Skip
70 </Button>
71 )}
72 </div>
73
74 {showProgressBar && (
75 <ProgressBar
76 currentChapter={currentChapter}
77 chapters={chapters}
78 currentStep={currentStep}
79 />
80 )}
81 </div>
82 );
83}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected