Feed interstitial snapping (#4737)

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
zio/stable
Samuel Newman 2024-07-05 18:01:13 +01:00 committed by GitHub
parent 3407206f52
commit 58e48fd31b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 3 deletions

View File

@ -27,6 +27,8 @@ import * as ProfileCard from '#/components/ProfileCard'
import {Text} from '#/components/Typography'
import {ProgressGuideList} from './ProgressGuide/List'
const MOBILE_CARD_WIDTH = 300
function CardOuter({
children,
style,
@ -43,7 +45,7 @@ function CardOuter({
t.atoms.bg,
t.atoms.border_contrast_low,
!gtMobile && {
width: 300,
width: MOBILE_CARD_WIDTH,
},
style,
]}>
@ -266,7 +268,11 @@ export function SuggestedFollows() {
</View>
</View>
) : (
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
snapToInterval={MOBILE_CARD_WIDTH + a.gap_md.gap}
decelerationRate="fast">
<View style={[a.px_lg, a.pt_md, a.pb_xl, a.flex_row, a.gap_md]}>
{content}
@ -392,7 +398,11 @@ export function SuggestedFeeds() {
</View>
</View>
) : (
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
snapToInterval={MOBILE_CARD_WIDTH + a.gap_md.gap}
decelerationRate="fast">
<View style={[a.px_lg, a.pt_md, a.pb_xl, a.flex_row, a.gap_md]}>
{content}