Integrate settings into design system and some various fixes/tweaks

zio/stable
Paul Frazee 2022-12-30 15:11:47 -06:00
parent d952c550ea
commit 62c6da3b9f
3 changed files with 12 additions and 9 deletions

View File

@ -8,11 +8,13 @@ import {ViewHeader} from '../com/util/ViewHeader'
import {Link} from '../com/util/Link' import {Link} from '../com/util/Link'
import {Text} from '../com/util/text/Text' import {Text} from '../com/util/text/Text'
import {UserAvatar} from '../com/util/UserAvatar' import {UserAvatar} from '../com/util/UserAvatar'
import {usePalette} from '../lib/hooks/usePalette'
export const Settings = observer(function Settings({ export const Settings = observer(function Settings({
navIdx, navIdx,
visible, visible,
}: ScreenParams) { }: ScreenParams) {
const pal = usePalette('default')
const store = useStores() const store = useStores()
useEffect(() => { useEffect(() => {
@ -32,17 +34,19 @@ export const Settings = observer(function Settings({
<ViewHeader title="Settings" /> <ViewHeader title="Settings" />
<View style={[s.mt10, s.pl10, s.pr10]}> <View style={[s.mt10, s.pl10, s.pr10]}>
<View style={[s.flexRow]}> <View style={[s.flexRow]}>
<Text style={s.black}>Signed in as</Text> <Text style={pal.text}>Signed in as</Text>
<View style={s.flex1} /> <View style={s.flex1} />
<TouchableOpacity onPress={onPressSignout}> <TouchableOpacity onPress={onPressSignout}>
<Text style={[s.blue3, s.bold]}>Sign out</Text> <Text type="h5" style={pal.link}>
Sign out
</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<Link <Link
href={`/profile/${store.me.handle}`} href={`/profile/${store.me.handle}`}
title="Your profile" title="Your profile"
noFeedback> noFeedback>
<View style={styles.profile}> <View style={[pal.view, styles.profile]}>
<UserAvatar <UserAvatar
size={40} size={40}
displayName={store.me.displayName} displayName={store.me.displayName}
@ -50,15 +54,15 @@ export const Settings = observer(function Settings({
avatar={store.me.avatar} avatar={store.me.avatar}
/> />
<View style={[s.ml10]}> <View style={[s.ml10]}>
<Text style={[s.f18, s.black]}> <Text type="h5" style={pal.text}>
{store.me.displayName || store.me.handle} {store.me.displayName || store.me.handle}
</Text> </Text>
<Text style={[s.gray5]}>@{store.me.handle}</Text> <Text style={pal.textLight}>@{store.me.handle}</Text>
</View> </View>
</View> </View>
</Link> </Link>
<Link href="/debug" title="Debug tools"> <Link href="/debug" title="Debug tools">
<Text style={s.blue3}>Debug tools</Text> <Text style={pal.link}>Debug tools</Text>
</Link> </Link>
</View> </View>
</View> </View>
@ -75,7 +79,6 @@ const styles = StyleSheet.create({
profile: { profile: {
flexDirection: 'row', flexDirection: 'row',
marginVertical: 6, marginVertical: 6,
backgroundColor: colors.white,
borderRadius: 4, borderRadius: 4,
paddingVertical: 10, paddingVertical: 10,
paddingHorizontal: 10, paddingHorizontal: 10,

View File

@ -145,7 +145,7 @@ export const Menu = ({
icon={<BellIcon style={pal.text as StyleProp<ViewStyle>} size="28" />} icon={<BellIcon style={pal.text as StyleProp<ViewStyle>} size="28" />}
label="Notifications" label="Notifications"
url="/notifications" url="/notifications"
count={store.me.notificationCount || 10} count={store.me.notificationCount}
/> />
</View> </View>
<View style={[styles.section, pal.border]}> <View style={[styles.section, pal.border]}>

View File

@ -346,7 +346,7 @@ export const MobileShell: React.FC = observer(() => {
const isAtNotifications = store.nav.tab.current.url === '/notifications' const isAtNotifications = store.nav.tab.current.url === '/notifications'
const screenBg = { const screenBg = {
backgroundColor: theme.colorScheme === 'dark' ? colors.black : colors.gray1, backgroundColor: theme.colorScheme === 'dark' ? colors.gray7 : colors.gray1,
} }
return ( return (
<View style={styles.outerContainer}> <View style={styles.outerContainer}>