diff --git a/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx b/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx index 212ebb5440..8619745d32 100644 --- a/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx +++ b/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx @@ -12,8 +12,11 @@ import {IS_WEB} from '#/env' import {ChatList, Header as ChatListHeader} from '../../ChatList' import {SplitViewProvider} from './context' +const CENTER_COLUMN_WIDTH = 600 +const LEFT_NAV_FULL_WIDTH = 245 const LEFT_NAV_MINIMAL_WIDTH = 86 -const RIGHT_NAV_WIDTH = 330 + 28 +const RIGHT_NAV_FULL_WIDTH = 330 + 28 +const RIGHT_NAV_MINIMAL_WIDTH = 280 + 28 type LayoutProps = ScreenLayoutArgs< AllNavigatorParams, @@ -44,20 +47,26 @@ function MessagesSplitViewLayout({children, navigation, route}: LayoutProps) { ? route?.params?.conversation : undefined + const leftNavWidth = centerColumnOffset + ? LEFT_NAV_MINIMAL_WIDTH + : LEFT_NAV_FULL_WIDTH + const rightNavWidth = centerColumnOffset + ? RIGHT_NAV_MINIMAL_WIDTH + : RIGHT_NAV_FULL_WIDTH + + const containerWidth = + leftNavWidth - LEFT_NAV_MINIMAL_WIDTH + CENTER_COLUMN_WIDTH + rightNavWidth + return ( { - const {isDesktop} = useWebMediaQueries() +export const FAB = (props: FABProps) => { + const {gtMobile} = useBreakpoints() - if (!isDesktop) { - return + if (!gtMobile) { + return } return diff --git a/src/view/shell/createNativeStackNavigatorWithAuth.tsx b/src/view/shell/createNativeStackNavigatorWithAuth.tsx index 4df4a7ffd6..88cdffed59 100644 --- a/src/view/shell/createNativeStackNavigatorWithAuth.tsx +++ b/src/view/shell/createNativeStackNavigatorWithAuth.tsx @@ -200,7 +200,11 @@ function NativeStackNavigator({ {IS_WEB && ( <> - {showBottomBar ? : } + {showBottomBar ? ( + + ) : ( + + )} {!isMobile && } )} diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 8ca25a8d5e..38d4dffb0e 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -8,8 +8,6 @@ import {useNavigation, useNavigationState} from '@react-navigation/native' import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher' import {useOpenComposer} from '#/lib/hooks/useOpenComposer' -import {usePalette} from '#/lib/hooks/usePalette' -import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {getCurrentRoute, isTab} from '#/lib/routes/helpers' import {makeProfileLink} from '#/lib/routes/links' import { @@ -30,7 +28,14 @@ import {LoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' import {PressableWithHover} from '#/view/com/util/PressableWithHover' import {UserAvatar} from '#/view/com/util/UserAvatar' import {NavSignupCard} from '#/view/shell/NavSignupCard' -import {atoms as a, tokens, useLayoutBreakpoints, useTheme, web} from '#/alf' +import { + atoms as a, + tokens, + useBreakpoints, + useLayoutBreakpoints, + useTheme, + web, +} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {type DialogControlProps} from '#/components/Dialog' import {ArrowBoxLeft_Stroke2_Corner0_Rounded as LeaveIcon} from '#/components/icons/ArrowBoxLeft' @@ -81,7 +86,7 @@ import {router} from '../../../routes' const NAV_ICON_WIDTH = 28 -function ProfileCard() { +function ProfileCard({minimal}: {minimal: boolean}) { const {currentAccount, accounts} = useSession() const {logoutEveryAccount} = useSessionApi() const {isLoading, data} = useProfilesQuery({ @@ -89,7 +94,6 @@ function ProfileCard() { }) const profiles = data?.profiles const signOutPromptControl = Prompt.usePromptControl() - const {leftNavMinimal} = useLayoutBreakpoints() const {_} = useLingui() const t = useTheme() @@ -106,7 +110,7 @@ function ProfileCard() { const {isActive: live} = useActorStatus(profile) return ( - + {!isLoading && profile ? ( @@ -125,7 +129,7 @@ function ProfileCard() { a.align_center, a.flex_row, {gap: 6}, - !leftNavMinimal && [a.pl_lg, a.pr_md], + !minimal && [a.pl_lg, a.pr_md], ]}> @@ -150,7 +154,7 @@ function ProfileCard() { live={live} /> - {!leftNavMinimal && ( + {!minimal && ( <> )} router.matchPath(href), [href]) const currentRouteInfo = useNavigationState(state => { if (!state) { @@ -417,7 +430,7 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { a.flex_row, a.align_center, a.p_md, - a.rounded_sm, + a.rounded_full, a.gap_sm, a.outline_inset_1, a.transition_color, @@ -438,9 +451,9 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { width: 24, height: 24, }, - leftNavMinimal && { - width: 40, - height: 40, + minimal && { + width: 30, + height: 30, }, ]}> {isCurrent ? iconFilled : icon} @@ -479,7 +492,7 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { paddingVertical: 1, minWidth: 16, }, - leftNavMinimal && [ + minimal && [ { top: '10%', left: count.length === 1 ? 20 : 16, @@ -502,7 +515,7 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { right: -2, top: -4, }, - leftNavMinimal && { + minimal && { right: 4, top: 2, }, @@ -510,7 +523,7 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { /> ) : null} - {!leftNavMinimal && ( + {!minimal && ( {label} @@ -519,12 +532,11 @@ function NavItem({count, hasNew, href, icon, iconFilled, label}: NavItemProps) { ) } -function ComposeBtn() { +function ComposeBtn({minimal}: {minimal: boolean}) { const {currentAccount} = useSession() const {getState} = useNavigation() const {openComposer} = useOpenComposer() const {_} = useLingui() - const {leftNavMinimal} = useLayoutBreakpoints() const [isFetchingHandle, setIsFetchingHandle] = useState(false) const fetchHandle = useFetchHandle() @@ -564,31 +576,28 @@ function ComposeBtn() { const onPressCompose = async () => openComposer({mention: await getProfileHandle(), logContext: 'Fab'}) - if (leftNavMinimal) { - return null - } - return ( - + ) } -function ChatNavItem() { - const pal = usePalette('default') +function ChatNavItem({minimal}: {minimal: boolean}) { + const t = useTheme() const {_} = useLingui() const numUnreadMessages = useUnreadMessageCount() const aa = useAgeAssurance() @@ -596,14 +605,19 @@ function ChatNavItem() { return ( + } iconFilled={ @@ -613,15 +627,19 @@ function ChatNavItem() { ) } -export function DesktopLeftNav() { +export function DesktopLeftNav({routeName}: {routeName: string}) { const {hasSession, currentAccount} = useSession() - const pal = usePalette('default') const {_} = useLingui() - const {isDesktop} = useWebMediaQueries() - const {leftNavMinimal, centerColumnOffset} = useLayoutBreakpoints() + const t = useTheme() + const {gtMobile} = useBreakpoints() + const isMessagesRelatedScreen = routeName.startsWith('Messages') + const {leftNavMinimal: leftNavMinimalBreakpoint, centerColumnOffset} = + useLayoutBreakpoints() const numUnreadNotifications = useUnreadNotifications() - if (!hasSession && !isDesktop) { + const leftNavMinimal = isMessagesRelatedScreen || leftNavMinimalBreakpoint + + if (!hasSession && !gtMobile) { return null } @@ -637,7 +655,11 @@ export function DesktopLeftNav() { transform: [ { translateX: - -300 + (centerColumnOffset ? CENTER_COLUMN_OFFSET : 0), + -300 + + (centerColumnOffset ? CENTER_COLUMN_OFFSET : 0) + + (isMessagesRelatedScreen && !leftNavMinimalBreakpoint + ? -130 + : 0), }, {translateX: '-100%'}, ...a.scrollbar_offset.transform, @@ -645,7 +667,7 @@ export function DesktopLeftNav() { }, ]}> {hasSession ? ( - + ) : !leftNavMinimal ? ( @@ -656,34 +678,36 @@ export function DesktopLeftNav() { <> } iconFilled={ } label={_(msg`Home`)} /> } iconFilled={ @@ -692,36 +716,38 @@ export function DesktopLeftNav() { /> } iconFilled={ } label={_(msg`Notifications`)} /> - + } iconFilled={ @@ -730,16 +756,17 @@ export function DesktopLeftNav() { /> } iconFilled={ @@ -748,16 +775,17 @@ export function DesktopLeftNav() { /> } iconFilled={ @@ -771,42 +799,44 @@ export function DesktopLeftNav() { /> } iconFilled={ } label={_(msg`Profile`)} /> } iconFilled={ } label={_(msg`Settings`)} /> - + )} @@ -824,6 +854,7 @@ const styles = StyleSheet.create({ // @ts-expect-error web only maxHeight: '100vh', overflowY: 'auto', + scrollbarWidth: 'thin', }, leftNavWide: { width: 245,