diff options
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/screens/Home.tsx | 5 | ||||
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 3 | ||||
-rw-r--r-- | src/view/shell/desktop/RightNav.tsx | 35 | ||||
-rw-r--r-- | src/view/shell/index.web.tsx | 19 |
4 files changed, 55 insertions, 7 deletions
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 23d1e2b9d..ca9c25f55 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {FlatList, View} from 'react-native' +import {FlatList, View, Platform} from 'react-native' import {useFocusEffect, useIsFocused} from '@react-navigation/native' import {observer} from 'mobx-react-lite' import useAppState from 'react-native-appstate-hook' @@ -187,12 +187,11 @@ const FeedPage = observer( key="default" feed={feed} scrollElRef={scrollElRef} - style={s.hContentRegion} showPostFollowBtn onPressTryAgain={onPressTryAgain} onScroll={onMainScroll} renderEmptyState={renderEmptyState} - headerOffset={HEADER_OFFSET} + headerOffset={Platform.OS === 'web' ? 0 : HEADER_OFFSET} // only offset on mobile /> {feed.hasNewLatest && !feed.isRefreshing && ( <LoadLatestBtn onPress={onPressLoadLatest} label="posts" /> diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 45dd6579f..e9a631b23 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -130,7 +130,7 @@ export const DesktopLeftNav = observer(function DesktopLeftNav() { const pal = usePalette('default') return ( - <View style={styles.leftNav}> + <View style={[styles.leftNav, pal.view]}> {store.session.hasSession && <ProfileCard />} <BackBtn /> <NavItem @@ -246,6 +246,7 @@ const styles = StyleSheet.create({ paddingHorizontal: 16, backgroundColor: colors.blue3, marginTop: 20, + marginBottom: 10, }, newPostBtnIconWrapper: { marginRight: 8, diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx index 84a7593ca..7a3388f88 100644 --- a/src/view/shell/desktop/RightNav.tsx +++ b/src/view/shell/desktop/RightNav.tsx @@ -10,10 +10,18 @@ import {FEEDBACK_FORM_URL} from 'lib/constants' import {s} from 'lib/styles' import {useStores} from 'state/index' import {pluralize} from 'lib/strings/helpers' +import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle' +import {MoonIcon} from 'lib/icons' export const DesktopRightNav = observer(function DesktopRightNav() { const store = useStores() const pal = usePalette('default') + const mode = useColorSchemeStyle('Light', 'Dark') + + const onDarkmodePress = React.useCallback(() => { + store.shell.setDarkMode(!store.shell.darkMode) + }, [store]) + return ( <View style={[styles.rightNav, pal.view]}> {store.session.hasSession && <DesktopSearch />} @@ -50,6 +58,18 @@ export const DesktopRightNav = observer(function DesktopRightNav() { </View> </View> <InviteCodes /> + <View> + <TouchableOpacity + style={[styles.darkModeToggle]} + onPress={onDarkmodePress}> + <View style={[pal.viewLight, styles.darkModeToggleIcon]}> + <MoonIcon size={18} style={pal.textLight} /> + </View> + <Text type="sm" style={pal.textLight}> + {mode} mode + </Text> + </TouchableOpacity> + </View> </View> ) }) @@ -110,4 +130,19 @@ const styles = StyleSheet.create({ inviteCodesIcon: { marginRight: 6, }, + + darkModeToggle: { + flexDirection: 'row', + alignItems: 'center', + gap: 8, + marginHorizontal: 12, + }, + darkModeToggleIcon: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + width: 26, + height: 26, + borderRadius: 15, + }, }) diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index 86d120127..5d7ed259a 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -14,9 +14,11 @@ import {RoutesContainer, FlatNavigator} from '../../Navigation' import {DrawerContent} from './Drawer' import {useWebMediaQueries} from '../../lib/hooks/useWebMediaQueries' import {BottomBarWeb} from './bottom-bar/BottomBarWeb' +import {usePalette} from 'lib/hooks/usePalette' const ShellInner = observer(() => { const store = useStores() + const pal = usePalette('default') const {isDesktop} = useWebMediaQueries() return ( @@ -30,8 +32,20 @@ const ShellInner = observer(() => { <> <DesktopLeftNav /> <DesktopRightNav /> - <View style={[styles.viewBorder, styles.viewBorderLeft]} /> - <View style={[styles.viewBorder, styles.viewBorderRight]} /> + <View + style={[ + styles.viewBorder, + {borderLeftColor: pal.colors.border}, + styles.viewBorderLeft, + ]} + /> + <View + style={[ + styles.viewBorder, + {borderLeftColor: pal.colors.border}, + styles.viewBorderRight, + ]} + /> </> )} <Composer @@ -81,7 +95,6 @@ const styles = StyleSheet.create({ width: 1, height: '100%', borderLeftWidth: 1, - borderLeftColor: colors.gray2, }, viewBorderLeft: { left: 'calc(50vw - 300px)', |