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

Function AuthHeader

packages/shared/src/components/auth/AuthHeader.tsx:29–89  ·  view source on GitHub ↗
({
  simplified = false,
  onboardingHeadline = false,
  title,
  className,
  onBack,
  ...attrs
}: AuthHeaderProps)

Source from the content-addressed store, hash-verified

27}
28
29function AuthHeader({
30 simplified = false,
31 onboardingHeadline = false,
32 title,
33 className,
34 onBack,
35 ...attrs
36}: AuthHeaderProps): ReactElement {
37 if (simplified) {
38 const heading = (
39 <h2
40 {...attrs}
41 className={
42 onboardingHeadline
43 ? onboardingHeadlineClasses
44 : 'text-center font-bold text-text-primary typo-title2'
45 }
46 >
47 {title}
48 </h2>
49 );
50
51 if (!onBack) {
52 return heading;
53 }
54
55 return (
56 <div className="relative flex min-h-10 flex-col justify-center">
57 <Button
58 aria-label="Go back"
59 icon={<MoveToIcon size={IconSize.Small} className="rotate-180" />}
60 size={ButtonSize.Medium}
61 variant={ButtonVariant.Tertiary}
62 className="absolute left-0 top-1/2 -translate-y-1/2"
63 onClick={onBack}
64 />
65 {heading}
66 </div>
67 );
68 }
69
70 return (
71 <Modal.Header
72 className={className}
73 kind={ModalHeaderKind.Secondary}
74 title={title}
75 closeOnPhone
76 >
77 {onBack && (
78 <Button
79 aria-label="Go back"
80 icon={<MoveToIcon size={IconSize.Small} className="rotate-180" />}
81 size={ButtonSize.Medium}
82 variant={ButtonVariant.Tertiary}
83 className="-ml-2 mr-2 tablet:-ml-4"
84 onClick={onBack}
85 />
86 )}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected