feat(ui): remove like count from trending videos (#8689)
* feat(ui): add showLikeCount flag to CompactVideoPostCard Introduced a showLikeCount flag to control the display of like count in the CompactVideoPostCard component. The like count is now only shown if both likeCount > 0 and showLikeCount are true. This allows for more flexible UI configurations and easier toggling of like count visibility. * fix(ui): hide gradient shadow when hiding like count * fix(ui): increase trending video profile pic size from 20 -> 24 * fix(ui): add small drop shadow to trending video profile pic * fix(ui): a.shadow_sm -> t.atoms.shadow_sm based on PR feedback
This commit is contained in:
@@ -390,6 +390,7 @@ export function CompactVideoPostCard({
|
|||||||
if (!AppBskyEmbedVideo.isView(embed)) return null
|
if (!AppBskyEmbedVideo.isView(embed)) return null
|
||||||
|
|
||||||
const likeCount = post?.likeCount ?? 0
|
const likeCount = post?.likeCount ?? 0
|
||||||
|
const showLikeCount = false
|
||||||
const {thumbnail} = embed
|
const {thumbnail} = embed
|
||||||
const black = getBlackColor(t)
|
const black = getBlackColor(t)
|
||||||
|
|
||||||
@@ -475,18 +476,20 @@ export function CompactVideoPostCard({
|
|||||||
/>
|
/>
|
||||||
<MediaInsetBorder />
|
<MediaInsetBorder />
|
||||||
|
|
||||||
<View style={[a.absolute, a.inset_0]}>
|
<View style={[a.absolute, a.inset_0, t.atoms.shadow_sm]}>
|
||||||
<View style={[a.absolute, a.inset_0, a.p_sm, {bottom: 'auto'}]}>
|
<View style={[a.absolute, a.inset_0, a.p_sm, {bottom: 'auto'}]}>
|
||||||
<View
|
<View
|
||||||
style={[a.relative, a.rounded_full, {width: 20, height: 20}]}>
|
style={[a.relative, a.rounded_full, {width: 24, height: 24}]}>
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
type="user"
|
type="user"
|
||||||
size={20}
|
size={24}
|
||||||
avatar={post.author.avatar}
|
avatar={post.author.avatar}
|
||||||
/>
|
/>
|
||||||
<MediaInsetBorder />
|
<MediaInsetBorder />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{showLikeCount && (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.absolute,
|
a.absolute,
|
||||||
@@ -509,13 +512,15 @@ export function CompactVideoPostCard({
|
|||||||
{likeCount > 0 && (
|
{likeCount > 0 && (
|
||||||
<View style={[a.flex_row, a.align_center, a.gap_xs]}>
|
<View style={[a.flex_row, a.align_center, a.gap_xs]}>
|
||||||
<Heart size="sm" fill="white" />
|
<Heart size="sm" fill="white" />
|
||||||
<Text style={[a.text_sm, a.font_bold, {color: 'white'}]}>
|
<Text
|
||||||
|
style={[a.text_sm, a.font_bold, {color: 'white'}]}>
|
||||||
{formatCount(i18n, likeCount)}
|
{formatCount(i18n, likeCount)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Hider.Content>
|
</Hider.Content>
|
||||||
|
|||||||
Reference in New Issue
Block a user