Finesse post controls
This commit is contained in:
@@ -196,7 +196,7 @@ let PostControls = ({
|
|||||||
<View style={[a.flex_row, a.justify_between, a.flex_1]}>
|
<View style={[a.flex_row, a.justify_between, a.flex_1]}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
big ? a.align_center : [a.flex_1, a.align_start, {marginLeft: -6}],
|
{marginLeft: big ? -2 : -6},
|
||||||
replyDisabled ? {opacity: 0.5} : undefined,
|
replyDisabled ? {opacity: 0.5} : undefined,
|
||||||
]}>
|
]}>
|
||||||
<PostControlButton
|
<PostControlButton
|
||||||
@@ -225,65 +225,57 @@ let PostControls = ({
|
|||||||
)}
|
)}
|
||||||
</PostControlButton>
|
</PostControlButton>
|
||||||
</View>
|
</View>
|
||||||
<View style={big ? a.align_center : [a.flex_1, a.align_start]}>
|
<RepostButton
|
||||||
<RepostButton
|
isReposted={!!post.viewer?.repost}
|
||||||
isReposted={!!post.viewer?.repost}
|
repostCount={(post.repostCount ?? 0) + (post.quoteCount ?? 0)}
|
||||||
repostCount={(post.repostCount ?? 0) + (post.quoteCount ?? 0)}
|
onRepost={onRepost}
|
||||||
onRepost={onRepost}
|
onQuote={onQuote}
|
||||||
onQuote={onQuote}
|
big={big}
|
||||||
|
embeddingDisabled={Boolean(post.viewer?.embeddingDisabled)}
|
||||||
|
/>
|
||||||
|
<PostControlButton
|
||||||
|
testID="likeBtn"
|
||||||
|
big={big}
|
||||||
|
onPress={() => requireAuth(() => onPressToggleLike())}
|
||||||
|
label={
|
||||||
|
post.viewer?.like
|
||||||
|
? _(
|
||||||
|
msg({
|
||||||
|
message: `Unlike (${plural(post.likeCount || 0, {
|
||||||
|
one: '# like',
|
||||||
|
other: '# likes',
|
||||||
|
})})`,
|
||||||
|
comment:
|
||||||
|
'Accessibility label for the like button when the post has been liked, verb followed by number of likes and noun',
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
: _(
|
||||||
|
msg({
|
||||||
|
message: `Like (${plural(post.likeCount || 0, {
|
||||||
|
one: '# like',
|
||||||
|
other: '# likes',
|
||||||
|
})})`,
|
||||||
|
comment:
|
||||||
|
'Accessibility label for the like button when the post has not been liked, verb form followed by number of likes and noun form',
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}>
|
||||||
|
<AnimatedLikeIcon
|
||||||
|
isLiked={Boolean(post.viewer?.like)}
|
||||||
big={big}
|
big={big}
|
||||||
embeddingDisabled={Boolean(post.viewer?.embeddingDisabled)}
|
hasBeenToggled={hasLikeIconBeenToggled}
|
||||||
/>
|
/>
|
||||||
</View>
|
<CountWheel
|
||||||
<View style={big ? a.align_center : [a.flex_1, a.align_start]}>
|
likeCount={post.likeCount ?? 0}
|
||||||
<PostControlButton
|
|
||||||
testID="likeBtn"
|
|
||||||
big={big}
|
big={big}
|
||||||
onPress={() => requireAuth(() => onPressToggleLike())}
|
isLiked={Boolean(post.viewer?.like)}
|
||||||
label={
|
hasBeenToggled={hasLikeIconBeenToggled}
|
||||||
post.viewer?.like
|
/>
|
||||||
? _(
|
</PostControlButton>
|
||||||
msg({
|
{/* Spacer! */}
|
||||||
message: `Unlike (${plural(post.likeCount || 0, {
|
<View />
|
||||||
one: '# like',
|
|
||||||
other: '# likes',
|
|
||||||
})})`,
|
|
||||||
comment:
|
|
||||||
'Accessibility label for the like button when the post has been liked, verb followed by number of likes and noun',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
: _(
|
|
||||||
msg({
|
|
||||||
message: `Like (${plural(post.likeCount || 0, {
|
|
||||||
one: '# like',
|
|
||||||
other: '# likes',
|
|
||||||
})})`,
|
|
||||||
comment:
|
|
||||||
'Accessibility label for the like button when the post has not been liked, verb form followed by number of likes and noun form',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}>
|
|
||||||
<AnimatedLikeIcon
|
|
||||||
isLiked={Boolean(post.viewer?.like)}
|
|
||||||
big={big}
|
|
||||||
hasBeenToggled={hasLikeIconBeenToggled}
|
|
||||||
/>
|
|
||||||
<CountWheel
|
|
||||||
likeCount={post.likeCount ?? 0}
|
|
||||||
big={big}
|
|
||||||
isLiked={Boolean(post.viewer?.like)}
|
|
||||||
hasBeenToggled={hasLikeIconBeenToggled}
|
|
||||||
/>
|
|
||||||
</PostControlButton>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View style={[a.flex_row, a.justify_end, big && a.gap_sm]}>
|
||||||
style={[
|
|
||||||
a.flex_row,
|
|
||||||
a.justify_end,
|
|
||||||
a.flex_1,
|
|
||||||
big ? a.gap_sm : a.gap_xs,
|
|
||||||
]}>
|
|
||||||
<BookmarkButton post={post} big={big} />
|
<BookmarkButton post={post} big={big} />
|
||||||
<ShareMenuButton
|
<ShareMenuButton
|
||||||
testID="postShareBtn"
|
testID="postShareBtn"
|
||||||
|
|||||||
Reference in New Issue
Block a user