From d952c550ea31a46a17ca9bdb67bef385c8de1f23 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 30 Dec 2022 15:08:10 -0600 Subject: [PATCH] Integrate menu into design system --- src/view/shell/mobile/Menu.tsx | 86 +++++++++++++++------------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/src/view/shell/mobile/Menu.tsx b/src/view/shell/mobile/Menu.tsx index a8a81b4d..5a97c9f2 100644 --- a/src/view/shell/mobile/Menu.tsx +++ b/src/view/shell/mobile/Menu.tsx @@ -19,6 +19,7 @@ import { import {UserAvatar} from '../../com/util/UserAvatar' import {Text} from '../../com/util/text/Text' import {CreateSceneModal} from '../../../state/models/shell-ui' +import {usePalette} from '../../lib/hooks/usePalette' export const Menu = ({ visible, @@ -27,6 +28,7 @@ export const Menu = ({ visible: boolean onClose: () => void }) => { + const pal = usePalette('default') const store = useStores() useEffect(() => { @@ -86,9 +88,10 @@ export const Menu = ({ ) : undefined} {label} @@ -97,7 +100,7 @@ export const Menu = ({ ) return ( - + onNavigate(`/profile/${store.me.handle}`)} style={styles.profileCard}> @@ -108,46 +111,47 @@ export const Menu = ({ avatar={store.me.avatar} /> - + {store.me.displayName} - {store.me.handle} + + @{store.me.handle} + onNavigate('/search')}> } + style={pal.text as StyleProp} size={25} /> - Search + + Search + - + } - size="26" - /> - } + icon={} size="26" />} label="Home" url="/" /> } - size="28" - /> - } + icon={} size="28" />} label="Notifications" url="/notifications" - count={store.me.notificationCount} + count={store.me.notificationCount || 10} /> - - Scenes + + + Scenes + {store.me.memberships ? store.me.memberships.memberships.map((membership, i) => ( - + } - size="30" - /> + } size="30" /> } label="Create a scene" onPress={onPressCreateScene} @@ -180,7 +181,7 @@ export const Menu = ({ } + style={pal.text as StyleProp} size="30" strokeWidth={2} /> @@ -190,7 +191,7 @@ export const Menu = ({ /> - + Build version {VersionNumber.appVersion} ({VersionNumber.buildVersion} ) @@ -202,18 +203,14 @@ export const Menu = ({ const styles = StyleSheet.create({ view: { flex: 1, - backgroundColor: colors.white, }, section: { paddingHorizontal: 10, paddingTop: 10, paddingBottom: 10, borderBottomWidth: 1, - borderBottomColor: colors.gray1, }, heading: { - fontSize: 16, - fontWeight: 'bold', paddingVertical: 8, paddingHorizontal: 4, }, @@ -226,19 +223,13 @@ const styles = StyleSheet.create({ }, profileCardDisplayName: { marginLeft: 12, - fontSize: 24, - fontWeight: 'bold', - color: colors.gray7, }, profileCardHandle: { marginLeft: 12, - fontSize: 18, - color: colors.gray6, }, searchBtn: { flexDirection: 'row', - backgroundColor: colors.gray1, borderRadius: 8, margin: 10, marginBottom: 0, @@ -246,16 +237,16 @@ const styles = StyleSheet.create({ paddingHorizontal: 12, }, searchBtnLabel: { - marginLeft: 8, - fontSize: 19, - color: colors.gray6, + marginLeft: 14, + fontWeight: 'normal', }, menuItem: { flexDirection: 'row', alignItems: 'center', paddingVertical: 8, - paddingHorizontal: 6, + paddingLeft: 6, + paddingRight: 10, }, menuItemIconWrapper: { width: 36, @@ -265,10 +256,11 @@ const styles = StyleSheet.create({ marginRight: 12, }, menuItemLabel: { - fontSize: 19, - color: colors.gray7, + flex: 1, + fontWeight: 'normal', }, menuItemLabelBold: { + flex: 1, fontWeight: 'bold', }, menuItemCount: {