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

Function HeaderButtons

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

Source from the content-addressed store, hash-verified

17const Container = classed('div', 'ml-auto flex justify-end gap-3');
18
19export function HeaderButtons({
20 additionalButtons,
21}: HeaderButtonsProps): ReactElement {
22 const { isLoggedIn, isAuthReady } = useAuthContext();
23 const { loadedSettings } = useSettingsContext();
24
25 if (!isAuthReady || !loadedSettings) {
26 return <Container />;
27 }
28
29 if (!isLoggedIn) {
30 return (
31 <Container>
32 <LoginButton
33 className={{
34 container: 'gap-4',
35 button: 'hidden laptop:block',
36 }}
37 />
38 </Container>
39 );
40 }
41
42 return (
43 <Container>
44 <OpportunityEntryButton />
45 <QuestHeaderButton />
46 <GivebackGiftEntry />
47 {additionalButtons}
48 <NotificationsBell />
49 <ProfileButton className="hidden laptop:flex" />
50 </Container>
51 );
52}
53
54export default HeaderButtons;

Callers

nothing calls this directly

Calls 2

useAuthContextFunction · 0.90
useSettingsContextFunction · 0.90

Tested by

no test coverage detected