From 9084e0e4a8ba14c59ec2ee29f8035eb854d11e87 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 30 Dec 2022 13:20:55 -0600 Subject: [PATCH] Integrate profile listings into design system --- src/view/com/profile/ProfileCard.tsx | 21 ++++++++++----------- src/view/com/profile/ProfileFollowers.tsx | 13 ++++++++----- src/view/com/profile/ProfileFollows.tsx | 13 ++++++++----- src/view/com/util/ViewHeader.tsx | 8 ++++---- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index 6ce5f29e..5d1992b7 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -3,26 +3,26 @@ import {StyleSheet, TouchableOpacity, View} from 'react-native' import {Link} from '../util/Link' import {Text} from '../util/text/Text' import {UserAvatar} from '../util/UserAvatar' -import {s, colors} from '../../lib/styles' +import {s} from '../../lib/styles' +import {usePalette} from '../../lib/hooks/usePalette' export function ProfileCard({ - did, handle, displayName, avatar, renderButton, onPressButton, }: { - did: string handle: string displayName?: string avatar?: string renderButton?: () => JSX.Element onPressButton?: () => void }) { + const pal = usePalette('default') return ( @@ -36,16 +36,18 @@ export function ProfileCard({ /> - + {displayName || handle} - + @{handle} {renderButton ? ( - + {renderButton()} @@ -57,9 +59,7 @@ export function ProfileCard({ const styles = StyleSheet.create({ outer: { - marginTop: 1, - backgroundColor: colors.white, - borderRadius: 6, + borderTopWidth: 1, }, layout: { flexDirection: 'row', @@ -93,7 +93,6 @@ const styles = StyleSheet.create({ paddingVertical: 7, paddingHorizontal: 14, borderRadius: 50, - backgroundColor: colors.gray1, marginLeft: 6, }, }) diff --git a/src/view/com/profile/ProfileFollowers.tsx b/src/view/com/profile/ProfileFollowers.tsx index 0d088d7a..175a582c 100644 --- a/src/view/com/profile/ProfileFollowers.tsx +++ b/src/view/com/profile/ProfileFollowers.tsx @@ -11,6 +11,7 @@ import {ErrorMessage} from '../util/error/ErrorMessage' import {UserAvatar} from '../util/UserAvatar' import {useStores} from '../../../state' import {s, colors} from '../../lib/styles' +import {usePalette} from '../../lib/hooks/usePalette' export const ProfileFollowers = observer(function ProfileFollowers({ name, @@ -80,9 +81,10 @@ export const ProfileFollowers = observer(function ProfileFollowers({ }) const User = ({item}: {item: FollowerItem}) => { + const pal = usePalette('default') return ( @@ -96,10 +98,12 @@ const User = ({item}: {item: FollowerItem}) => { /> - + {item.displayName || item.handle} - @{item.handle} + + @{item.handle} + @@ -108,8 +112,7 @@ const User = ({item}: {item: FollowerItem}) => { const styles = StyleSheet.create({ outer: { - marginTop: 1, - backgroundColor: colors.white, + borderTopWidth: 1, }, layout: { flexDirection: 'row', diff --git a/src/view/com/profile/ProfileFollows.tsx b/src/view/com/profile/ProfileFollows.tsx index 2cd471b0..2d40af24 100644 --- a/src/view/com/profile/ProfileFollows.tsx +++ b/src/view/com/profile/ProfileFollows.tsx @@ -11,6 +11,7 @@ import {Text} from '../util/text/Text' import {ErrorMessage} from '../util/error/ErrorMessage' import {UserAvatar} from '../util/UserAvatar' import {s, colors} from '../../lib/styles' +import {usePalette} from '../../lib/hooks/usePalette' export const ProfileFollows = observer(function ProfileFollows({ name, @@ -80,9 +81,10 @@ export const ProfileFollows = observer(function ProfileFollows({ }) const User = ({item}: {item: FollowItem}) => { + const pal = usePalette('default') return ( @@ -96,10 +98,12 @@ const User = ({item}: {item: FollowItem}) => { /> - + {item.displayName || item.handle} - @{item.handle} + + @{item.handle} + @@ -108,8 +112,7 @@ const User = ({item}: {item: FollowItem}) => { const styles = StyleSheet.create({ outer: { - marginTop: 1, - backgroundColor: colors.white, + borderTopWidth: 1, }, layout: { flexDirection: 'row', diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index 74886b97..a714c2db 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -74,13 +74,13 @@ export const ViewHeader = observer(function ViewHeader({ )} - + {title} {subtitle ? ( {subtitle} @@ -147,7 +147,7 @@ const styles = StyleSheet.create({ marginRight: 'auto', }, subtitle: { - marginLeft: 6, + marginLeft: 4, maxWidth: 200, },