diff options
author | dan <dan.abramov@gmail.com> | 2024-12-15 20:30:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-15 20:30:17 +0000 |
commit | 1ac307bc42bdf370c2011e7e7f2c76baea3441d2 (patch) | |
tree | 5e5b1513c1c35115d3eed73ae9a11178cd48a525 /src/view/shell/desktop | |
parent | 80c0125d6bfbafe463c526f37dab62f5f6604883 (diff) | |
download | voidsky-1ac307bc42bdf370c2011e7e7f2c76baea3441d2.tar.zst |
[Experiment] Remove "Load Latest" button (#7120)
* Remove "show latest" behind the gate * Add HomeBadgeProvider * Update provider state from home feed tabs * Add Home badge to native * Add Home badge to mobile web * Add Home badge to desktop web
Diffstat (limited to 'src/view/shell/desktop')
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 6655572f8..d367e1b98 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -14,8 +14,10 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {getCurrentRoute, isTab} from '#/lib/routes/helpers' import {makeProfileLink} from '#/lib/routes/links' import {CommonNavigatorParams} from '#/lib/routes/types' +import {useGate} from '#/lib/statsig/statsig' import {isInvalidHandle} from '#/lib/strings/handles' import {emitSoftReset} from '#/state/events' +import {useHomeBadge} from '#/state/home-badge' import {useFetchHandle} from '#/state/queries/handle' import {useUnreadMessageCount} from '#/state/queries/messages/list-conversations' import {useUnreadNotifications} from '#/state/queries/notifications/unread' @@ -100,12 +102,13 @@ function ProfileCard() { interface NavItemProps { count?: string + hasNew?: boolean href: string icon: JSX.Element iconFilled: JSX.Element label: string } -function NavItem({count, href, icon, iconFilled, label}: NavItemProps) { +function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { const t = useTheme() const {_} = useLingui() const {currentAccount} = useSession() @@ -214,6 +217,24 @@ function NavItem({count, href, icon, iconFilled, label}: NavItemProps) { {count} </Text> </View> + ) : hasNew ? ( + <View + style={[ + a.absolute, + a.rounded_full, + { + backgroundColor: t.palette.primary_500, + width: 8, + height: 8, + right: -1, + top: -3, + }, + isTablet && { + right: 6, + top: 4, + }, + ]} + /> ) : null} </View> {gtTablet && ( @@ -322,6 +343,8 @@ export function DesktopLeftNav() { const {_} = useLingui() const {isDesktop, isTablet} = useWebMediaQueries() const numUnreadNotifications = useUnreadNotifications() + const hasHomeBadge = useHomeBadge() + const gate = useGate() if (!hasSession && !isDesktop) { return null @@ -348,6 +371,7 @@ export function DesktopLeftNav() { <> <NavItem href="/" + hasNew={hasHomeBadge && gate('remove_show_latest_button')} icon={ <Home aria-hidden={true} |