Merge pull request #8702 from internet-development/caidan/app-1328-new-trending-video-interstitial

feat(ui): new trending video design
This commit is contained in:
jim
2025-07-24 13:51:05 -07:00
committed by GitHub
3 changed files with 32 additions and 19 deletions
+3
View File
@@ -67,6 +67,9 @@ export const atoms = {
zIndex: 50, zIndex: 50,
}, },
overflow_visible: {
overflow: 'visible',
},
overflow_hidden: { overflow_hidden: {
overflow: 'hidden', overflow: 'hidden',
}, },
+13 -4
View File
@@ -411,6 +411,7 @@ export function CompactVideoPostCard({
onPressOut={onPressOut} onPressOut={onPressOut}
style={[ style={[
a.flex_col, a.flex_col,
t.atoms.shadow_sm,
{ {
alignItems: undefined, alignItems: undefined,
justifyContent: undefined, justifyContent: undefined,
@@ -421,8 +422,10 @@ export function CompactVideoPostCard({
<View <View
style={[ style={[
a.justify_center, a.justify_center,
a.rounded_md, a.rounded_lg,
a.overflow_hidden, a.overflow_hidden,
a.border,
t.atoms.border_contrast_low,
{ {
backgroundColor: black, backgroundColor: black,
aspectRatio: 9 / 16, aspectRatio: 9 / 16,
@@ -443,6 +446,8 @@ export function CompactVideoPostCard({
a.inset_0, a.inset_0,
a.justify_center, a.justify_center,
a.align_center, a.align_center,
a.border,
t.atoms.border_contrast_low,
{ {
backgroundColor: 'black', backgroundColor: 'black',
opacity: 0.2, opacity: 0.2,
@@ -462,8 +467,10 @@ export function CompactVideoPostCard({
<View <View
style={[ style={[
a.justify_center, a.justify_center,
a.rounded_md, a.rounded_lg,
a.overflow_hidden, a.overflow_hidden,
a.border,
t.atoms.border_contrast_low,
{ {
backgroundColor: black, backgroundColor: black,
aspectRatio: 9 / 16, aspectRatio: 9 / 16,
@@ -534,11 +541,13 @@ export function CompactVideoPostCardPlaceholder() {
const black = getBlackColor(t) const black = getBlackColor(t)
return ( return (
<View style={[a.flex_1]}> <View style={[a.flex_1, t.atoms.shadow_sm]}>
<View <View
style={[ style={[
a.rounded_md, a.rounded_lg,
a.overflow_hidden, a.overflow_hidden,
a.border,
t.atoms.border_contrast_low,
{ {
backgroundColor: black, backgroundColor: black,
aspectRatio: 9 / 16, aspectRatio: 9 / 16,
+16 -15
View File
@@ -16,7 +16,6 @@ import {atoms as a, useGutters, useTheme} from '#/alf'
import {Button, ButtonIcon} from '#/components/Button' import {Button, ButtonIcon} from '#/components/Button'
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron' import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron'
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {Trending2_Stroke2_Corner2_Rounded as Graph} from '#/components/icons/Trending'
import {Link} from '#/components/Link' import {Link} from '#/components/Link'
import * as Prompt from '#/components/Prompt' import * as Prompt from '#/components/Prompt'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
@@ -25,7 +24,7 @@ import {
CompactVideoPostCardPlaceholder, CompactVideoPostCardPlaceholder,
} from '#/components/VideoPostCard' } from '#/components/VideoPostCard'
const CARD_WIDTH = 100 const CARD_WIDTH = 108
const FEED_DESC = `feedgen|${VIDEO_FEED_URI}` const FEED_DESC = `feedgen|${VIDEO_FEED_URI}`
const FEED_PARAMS: { const FEED_PARAMS: {
@@ -68,9 +67,10 @@ export function TrendingVideos() {
return ( return (
<View <View
style={[ style={[
a.pt_lg, a.pt_sm,
a.pb_lg, a.pb_lg,
a.border_t, a.border_t,
a.overflow_hidden,
t.atoms.border_contrast_low, t.atoms.border_contrast_low,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_25,
]}> ]}>
@@ -82,20 +82,17 @@ export function TrendingVideos() {
a.align_center, a.align_center,
a.justify_between, a.justify_between,
]}> ]}>
<View style={[a.flex_1, a.flex_row, a.align_center, a.gap_xs]}> <Text style={[a.text_sm, a.font_bold, a.leading_snug]}>
<Graph /> <Trans>Trending Videos</Trans>
<Text style={[a.text_md, a.font_bold, a.leading_snug]}> </Text>
<Trans>Trending Videos</Trans>
</Text>
</View>
<Button <Button
label={_(msg`Dismiss this section`)} label={_(msg`Dismiss this section`)}
size="tiny" size="tiny"
variant="ghost" variant="solid"
color="secondary" color="secondary"
shape="round" shape="square"
onPress={() => trendingPrompt.open()}> onPress={() => trendingPrompt.open()}>
<ButtonIcon icon={X} /> <ButtonIcon icon={X} size="sm" />
</Button> </Button>
</View> </View>
@@ -104,11 +101,12 @@ export function TrendingVideos() {
horizontal horizontal
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
decelerationRate="fast" decelerationRate="fast"
snapToInterval={CARD_WIDTH + a.gap_sm.gap}> snapToInterval={CARD_WIDTH + a.gap_md.gap}
style={[a.overflow_visible]}>
<View <View
style={[ style={[
a.flex_row, a.flex_row,
a.gap_sm, a.gap_md,
{ {
paddingLeft: gutters.paddingLeft, paddingLeft: gutters.paddingLeft,
paddingRight: gutters.paddingRight, paddingRight: gutters.paddingRight,
@@ -193,8 +191,11 @@ function VideoCards({
a.justify_center, a.justify_center,
a.align_center, a.align_center,
a.flex_1, a.flex_1,
a.rounded_md, a.rounded_lg,
a.border,
t.atoms.border_contrast_low,
t.atoms.bg, t.atoms.bg,
t.atoms.shadow_sm,
]}> ]}>
{({pressed}) => ( {({pressed}) => (
<View <View