import React, {useCallback} from 'react' import {type ListRenderItemInfo, View} from 'react-native' import {type AppBskyFeedDefs} from '@atproto/api' import {useBottomBarOffset} from '#/lib/hooks/useBottomBarOffset' import {isNative, isWeb} from '#/platform/detection' import {List, type ListRef} from '#/view/com/util/List' import {type SectionRef} from '#/screens/Profile/Sections/types' import {atoms as a, useTheme} from '#/alf' import * as FeedCard from '#/components/FeedCard' function keyExtractor(item: AppBskyFeedDefs.GeneratorView) { return item.uri } interface ProfilesListProps { feeds: AppBskyFeedDefs.GeneratorView[] headerHeight: number scrollElRef: ListRef } export const FeedsList = React.forwardRef( function FeedsListImpl({feeds, headerHeight, scrollElRef}, ref) { const [initialHeaderHeight] = React.useState(headerHeight) const bottomBarOffset = useBottomBarOffset(20) const t = useTheme() const onScrollToTop = useCallback(() => { scrollElRef.current?.scrollToOffset({ animated: isNative, offset: -headerHeight, }) }, [scrollElRef, headerHeight]) React.useImperativeHandle(ref, () => ({ scrollToTop: onScrollToTop, })) const renderItem = ({ item, index, }: ListRenderItemInfo) => { return ( ) } return ( } showsVerticalScrollIndicator={false} desktopFixedHeight={true} /> ) }, )