diff --git a/src/view/com/posts/PostFeedItemCarousel.tsx b/src/view/com/posts/PostFeedItemCarousel.tsx index f6859033a..6560e68d2 100644 --- a/src/view/com/posts/PostFeedItemCarousel.tsx +++ b/src/view/com/posts/PostFeedItemCarousel.tsx @@ -1,12 +1,7 @@ -import {useCallback, useRef} from 'react' -import { - type FlatList, - ScrollView, - useWindowDimensions, - View, -} from 'react-native' -import {Plural, useLingui} from '@lingui/react/macro' +import {useCallback, useRef, useState} from 'react' +import {ScrollView, useWindowDimensions, View} from 'react-native' import {LinearGradient} from 'expo-linear-gradient' +import {Plural, useLingui} from '@lingui/react/macro' import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type FeedPostSlice} from '#/state/queries/post-feed' @@ -14,8 +9,10 @@ import {BlockDrawerGesture} from '#/view/shell/BlockDrawerGesture' import {atoms as a, useTheme, utils, web} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' import { + ChevronBottom_Stroke2_Corner0_Rounded as ChevronBottom, ChevronLeft_Stroke2_Corner0_Rounded as ChevronLeft, ChevronRight_Stroke2_Corner0_Rounded as ChevronRight, + ChevronTop_Stroke2_Corner0_Rounded as ChevronTop, } from '#/components/icons/Chevron' import {GalleryBleed} from '#/components/images/Gallery' import {ITEM_GAP} from '#/components/images/Gallery/const' @@ -34,7 +31,13 @@ const MAX_CAROUSEL_HEIGHT = 520 const CAROUSEL_VIEWPORT_RATIO = 0.55 const BOTTOM_FADE_HEIGHT = 96 -function RepostCarouselViewport({children}: {children: React.ReactNode}) { +function RepostCarouselViewport({ + children, + expanded, +}: { + children: React.ReactNode + expanded: boolean +}) { const t = useTheme() const {height} = useWindowDimensions() const maxHeight = Math.min( @@ -43,26 +46,33 @@ function RepostCarouselViewport({children}: {children: React.ReactNode}) { ) return ( - + {children} - + {!expanded && ( + + )} ) } @@ -118,10 +128,14 @@ function RepostCard({ function RepostCarouselHeader({ count, + expanded, + onToggleExpanded, onScrollLeft, onScrollRight, }: { count: number + expanded: boolean + onToggleExpanded: () => void onScrollLeft: () => void onScrollRight: () => void }) { @@ -139,9 +153,23 @@ function RepostCarouselHeader({ a.align_center, a.justify_between, ]}> - - {count} - + + + + {count} + +