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

Function HeaderButtons

packages/shared/src/components/layout/HeaderButtons.tsx:20–57  ·  view source on GitHub ↗
({
  additionalButtons,
}: HeaderButtonsProps)

Source from the content-addressed store, hash-verified

18const Container = classed('div', 'ml-auto flex justify-end gap-3');
19
20export function HeaderButtons({
21 additionalButtons,
22}: HeaderButtonsProps): ReactElement {
23 const { isLoggedIn, isAuthReady } = useAuthContext();
24 const { loadedSettings } = useSettingsContext();
25
26 if (!isAuthReady || !loadedSettings) {
27 return <Container />;
28 }
29
30 if (!isLoggedIn) {
31 return (
32 <Container>
33 {/* Sits ahead of the Log in / Sign up pair. It keeps its label here
34 because there is room, but it stays Float (not Primary) so it never
35 competes with Sign up, which is the CTA that matters logged out. */}
36 <GetAppButton showLabel />
37 <LoginButton
38 className={{
39 container: 'gap-4',
40 button: 'hidden laptop:block',
41 }}
42 />
43 </Container>
44 );
45 }
46
47 return (
48 <Container>
49 <HeaderPlusButton />
50 <OpportunityEntryButton />
51 <QuestHeaderButton />
52 {additionalButtons}
53 <NotificationsBell />
54 <ProfileButton className="hidden laptop:flex" />
55 </Container>
56 );
57}
58
59export default HeaderButtons;

Callers

nothing calls this directly

Calls 2

useAuthContextFunction · 0.90
useSettingsContextFunction · 0.90

Tested by

no test coverage detected