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

Function RootRow

packages/shared/src/components/shell/ShellBlock.tsx:134–190  ·  view source on GitHub ↗
({ root }: { root: ShellRoot })

Source from the content-addressed store, hash-verified

132};
133
134const RootRow = ({ root }: { root: ShellRoot }): ReactElement => {
135 const { user } = useAuthContext();
136 const setActionsSlot = useShellActionsSlot();
137 const { streak, isLoading, isStreaksEnabled } = useReadingStreak();
138 const isMobileAppHeader = useMobileAppHeader();
139 const { isPlus } = usePlusSubscription();
140 const { isEnabled: hasMessages } = useMessagesEnabled();
141 const isHome = root === ShellRoot.Home;
142
143 return (
144 <div
145 className="shell-root-row flex items-center"
146 style={{
147 height: topButton.size + 14,
148 paddingInline: topButton.inset,
149 gap: topButton.gap,
150 }}
151 >
152 {isHome ? (
153 <Logo
154 position={LogoPosition.Initial}
155 isPlus={isPlus}
156 // The Plus and messages squares together leave a 375px row no
157 // room for the wordmark.
158 hideTextNarrow={hasMessages && !isPlus}
159 />
160 ) : (
161 <h1 className="min-w-0 flex-1 truncate font-bold typo-title3">
162 {rootTitles[root]}
163 </h1>
164 )}
165 {isHome && <span className="flex-1" />}
166 {isMobileAppHeader && <MobileAppActions />}
167 {user && isHome && <QuestHeaderButton compact shell />}
168 {user && isHome && isStreaksEnabled && streak && (
169 <ReadingStreakButton
170 isLoading={isLoading}
171 streak={streak}
172 compact
173 iconPosition={ButtonIconPosition.Right}
174 className="shell-material shell-hit relative !h-[2.375rem] !rounded-14 px-3"
175 />
176 )}
177 {user && isHome && <PlusSquare />}
178 {user && root === ShellRoot.Activity && (
179 <Link href={`${webappUrl}notifications/settings`} passHref>
180 <ShellSquare tag="a" aria-label="Notification settings">
181 <SettingsIcon size={IconSize.Small} />
182 </ShellSquare>
183 </Link>
184 )}
185 <div ref={setActionsSlot} className="contents" />
186 {user && <MessagesSquare />}
187 <AvatarSquare />
188 </div>
189 );
190};
191

Callers

nothing calls this directly

Calls 6

useAuthContextFunction · 0.90
useShellActionsSlotFunction · 0.90
useReadingStreakFunction · 0.90
useMobileAppHeaderFunction · 0.90
usePlusSubscriptionFunction · 0.90
useMessagesEnabledFunction · 0.90

Tested by

no test coverage detected