move indicatorStyle to List (#7526)

This commit is contained in:
Samuel Newman
2025-01-21 21:36:09 +00:00
committed by GitHub
parent f5b277c9f8
commit f0cc83154b
6 changed files with 3 additions and 8 deletions
+2
View File
@@ -58,6 +58,7 @@ export const Content = React.memo(function Content({
contentContainerStyle, contentContainerStyle,
...props ...props
}: ContentProps) { }: ContentProps) {
const t = useTheme()
const {footerHeight} = useShellLayout() const {footerHeight} = useShellLayout()
const animatedProps = useAnimatedProps(() => { const animatedProps = useAnimatedProps(() => {
return { return {
@@ -73,6 +74,7 @@ export const Content = React.memo(function Content({
<Animated.ScrollView <Animated.ScrollView
id="content" id="content"
automaticallyAdjustsScrollIndicatorInsets={false} automaticallyAdjustsScrollIndicatorInsets={false}
indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'}
// sets the scroll inset to the height of the footer // sets the scroll inset to the height of the footer
animatedProps={animatedProps} animatedProps={animatedProps}
style={[scrollViewStyles.common, style]} style={[scrollViewStyles.common, style]}
@@ -136,7 +136,6 @@ export const ProfileStarterPacks = React.forwardRef<
headerOffset={headerOffset} headerOffset={headerOffset}
progressViewOffset={ios(0)} progressViewOffset={ios(0)}
contentContainerStyle={{paddingBottom: headerOffset + bottomBarOffset}} contentContainerStyle={{paddingBottom: headerOffset + bottomBarOffset}}
indicatorStyle={t.name === 'light' ? 'black' : 'white'}
removeClippedSubviews={true} removeClippedSubviews={true}
desktopFixedHeight desktopFixedHeight
onEndReached={onEndReached} onEndReached={onEndReached}
-2
View File
@@ -205,9 +205,7 @@ export const ProfileFeedgens = React.forwardRef<
headerOffset={headerOffset} headerOffset={headerOffset}
progressViewOffset={ios(0)} progressViewOffset={ios(0)}
contentContainerStyle={isMobile && {paddingBottom: headerOffset + 100}} contentContainerStyle={isMobile && {paddingBottom: headerOffset + 100}}
indicatorStyle={t.name === 'light' ? 'black' : 'white'}
removeClippedSubviews={true} removeClippedSubviews={true}
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
onEndReached={onEndReached} onEndReached={onEndReached}
/> />
-2
View File
@@ -203,9 +203,7 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
contentContainerStyle={ contentContainerStyle={
isMobile && {paddingBottom: headerOffset + 100} isMobile && {paddingBottom: headerOffset + 100}
} }
indicatorStyle={t.name === 'light' ? 'black' : 'white'}
removeClippedSubviews={true} removeClippedSubviews={true}
// @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
onEndReached={onEndReached} onEndReached={onEndReached}
/> />
-3
View File
@@ -18,7 +18,6 @@ import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants'
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender' import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {logEvent} from '#/lib/statsig/statsig' import {logEvent} from '#/lib/statsig/statsig'
import {useTheme} from '#/lib/ThemeContext'
import {logger} from '#/logger' import {logger} from '#/logger'
import {isIOS, isNative, isWeb} from '#/platform/detection' import {isIOS, isNative, isWeb} from '#/platform/detection'
import {listenPostCreated} from '#/state/events' import {listenPostCreated} from '#/state/events'
@@ -187,7 +186,6 @@ let PostFeed = ({
initialNumToRender?: number initialNumToRender?: number
isVideoFeed?: boolean isVideoFeed?: boolean
}): React.ReactNode => { }): React.ReactNode => {
const theme = useTheme()
const {_} = useLingui() const {_} = useLingui()
const queryClient = useQueryClient() const queryClient = useQueryClient()
const {currentAccount, hasSession} = useSession() const {currentAccount, hasSession} = useSession()
@@ -715,7 +713,6 @@ let PostFeed = ({
minHeight: Dimensions.get('window').height * 1.5, minHeight: Dimensions.get('window').height * 1.5,
}} }}
onScrolledDownChange={onScrolledDownChange} onScrolledDownChange={onScrolledDownChange}
indicatorStyle={theme.colorScheme === 'dark' ? 'white' : 'black'}
onEndReached={onEndReached} onEndReached={onEndReached}
onEndReachedThreshold={2} // number of posts left to trigger load more onEndReachedThreshold={2} // number of posts left to trigger load more
removeClippedSubviews={true} removeClippedSubviews={true}
+1
View File
@@ -164,6 +164,7 @@ let List = React.forwardRef<ListMethods, ListProps>(
right: 1, right: 1,
...props.scrollIndicatorInsets, ...props.scrollIndicatorInsets,
}} }}
indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'}
contentOffset={contentOffset} contentOffset={contentOffset}
refreshControl={refreshControl} refreshControl={refreshControl}
onScroll={scrollHandler} onScroll={scrollHandler}