Lighten post controls a little in light-mode and add them to the theme

zio/stable
Paul Frazee 2023-01-17 11:20:07 -06:00
parent b574607466
commit b9778b7943
2 changed files with 17 additions and 12 deletions

View File

@ -34,12 +34,16 @@ interface PostCtrlsOpts {
onDeletePost: () => void onDeletePost: () => void
} }
const redgray = '#7A6161'
const sRedgray = {color: redgray}
const HITSLOP = {top: 2, left: 2, bottom: 2, right: 2} const HITSLOP = {top: 2, left: 2, bottom: 2, right: 2}
export function PostCtrls(opts: PostCtrlsOpts) { export function PostCtrls(opts: PostCtrlsOpts) {
const theme = useTheme() const theme = useTheme()
const defaultCtrlColor = React.useMemo(
() => ({
color: theme.palette.default.postCtrl,
}),
[theme],
)
const interp1 = useAnimatedValue(0) const interp1 = useAnimatedValue(0)
const interp2 = useAnimatedValue(0) const interp2 = useAnimatedValue(0)
@ -119,12 +123,14 @@ export function PostCtrls(opts: PostCtrlsOpts) {
hitSlop={HITSLOP} hitSlop={HITSLOP}
onPress={opts.onPressReply}> onPress={opts.onPressReply}>
<CommentBottomArrow <CommentBottomArrow
style={styles.ctrlIcon} style={defaultCtrlColor}
strokeWidth={3} strokeWidth={3}
size={opts.big ? 20 : 15} size={opts.big ? 20 : 15}
/> />
{typeof opts.replyCount !== 'undefined' ? ( {typeof opts.replyCount !== 'undefined' ? (
<Text style={[sRedgray, s.ml5, s.f15]}>{opts.replyCount}</Text> <Text style={[defaultCtrlColor, s.ml5, s.f15]}>
{opts.replyCount}
</Text>
) : undefined} ) : undefined}
</TouchableOpacity> </TouchableOpacity>
</View> </View>
@ -136,7 +142,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
<Animated.View style={anim1Style}> <Animated.View style={anim1Style}>
<FontAwesomeIcon <FontAwesomeIcon
style={ style={
opts.isReposted ? styles.ctrlIconReposted : styles.ctrlIcon opts.isReposted ? styles.ctrlIconReposted : defaultCtrlColor
} }
icon="retweet" icon="retweet"
size={opts.big ? 22 : 19} size={opts.big ? 22 : 19}
@ -147,7 +153,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
style={ style={
opts.isReposted opts.isReposted
? [s.bold, s.green3, s.f15, s.ml5] ? [s.bold, s.green3, s.f15, s.ml5]
: [sRedgray, s.f15, s.ml5] : [defaultCtrlColor, s.f15, s.ml5]
}> }>
{opts.repostCount} {opts.repostCount}
</Text> </Text>
@ -167,7 +173,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
/> />
) : ( ) : (
<UpIcon <UpIcon
style={[styles.ctrlIcon]} style={defaultCtrlColor}
size={opts.big ? 22 : 19} size={opts.big ? 22 : 19}
strokeWidth={1.5} strokeWidth={1.5}
/> />
@ -178,7 +184,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
style={ style={
opts.isUpvoted opts.isUpvoted
? [s.bold, s.red3, s.f15, s.ml5] ? [s.bold, s.red3, s.f15, s.ml5]
: [sRedgray, s.f15, s.ml5] : [defaultCtrlColor, s.f15, s.ml5]
}> }>
{opts.upvoteCount} {opts.upvoteCount}
</Text> </Text>
@ -202,7 +208,7 @@ export function PostCtrls(opts: PostCtrlsOpts) {
s.mr5, s.mr5,
{ {
color: color:
theme.colorScheme === 'light' ? colors.gray3 : colors.gray5, theme.colorScheme === 'light' ? colors.gray4 : colors.gray5,
}, },
]} ]}
/> />
@ -221,9 +227,6 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
}, },
ctrlIcon: {
color: redgray,
},
ctrlIconReposted: { ctrlIconReposted: {
color: colors.green3, color: colors.green3,
}, },

View File

@ -20,6 +20,7 @@ export const defaultTheme: Theme = {
replyLine: colors.gray2, replyLine: colors.gray2,
replyLineDot: colors.gray3, replyLineDot: colors.gray3,
unreadNotifBg: '#ebf6ff', unreadNotifBg: '#ebf6ff',
postCtrl: '#8A7171',
}, },
primary: { primary: {
background: colors.blue3, background: colors.blue3,
@ -164,6 +165,7 @@ export const darkTheme: Theme = {
replyLine: colors.gray5, replyLine: colors.gray5,
replyLineDot: colors.gray6, replyLineDot: colors.gray6,
unreadNotifBg: colors.blue5, unreadNotifBg: colors.blue5,
postCtrl: '#7A6161',
}, },
primary: { primary: {
...defaultTheme.palette.primary, ...defaultTheme.palette.primary,