-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove vertical scrollbars from views on native #3429
Changes from 8 commits
a1b8fcc
d953c5b
359f6c4
e3eb858
9d6053a
68b60c6
791b39d
80b112d
70bd39b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import React, {memo} from 'react' | ||
import {FlatListProps, RefreshControl} from 'react-native' | ||
import {FlatList_INTERNAL} from './Views' | ||
import {addStyle} from 'lib/styles' | ||
import {useScrollHandlers} from '#/lib/ScrollContext' | ||
import {runOnJS, useSharedValue} from 'react-native-reanimated' | ||
|
||
import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED' | ||
import {usePalette} from '#/lib/hooks/usePalette' | ||
import {useScrollHandlers} from '#/lib/ScrollContext' | ||
import {useGate} from 'lib/statsig/statsig' | ||
import {addStyle} from 'lib/styles' | ||
import {isWeb} from 'platform/detection' | ||
import {FlatList_INTERNAL} from './Views' | ||
|
||
export type ListMethods = FlatList_INTERNAL | ||
export type ListProps<ItemT> = Omit< | ||
|
@@ -37,7 +40,8 @@ function ListImpl<ItemT>( | |
const isScrolledDown = useSharedValue(false) | ||
const contextScrollHandlers = useScrollHandlers() | ||
const pal = usePalette('default') | ||
|
||
const showsVerticalScrollIndicator = | ||
!useGate('hide_vertical_scroll_indicators') && isWeb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be && or should it be || ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nm that's correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait. is it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. God I had my explanation typed out and then realized you're right. What a mind fuck. Sec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay fixed... Case 1:
Case 2:
Case 3:
Case 4:
|
||
function handleScrolledDownChange(didScrollDown: boolean) { | ||
onScrolledDownChange?.(didScrollDown) | ||
} | ||
|
@@ -93,6 +97,7 @@ function ListImpl<ItemT>( | |
scrollEventThrottle={1} | ||
style={style} | ||
ref={ref} | ||
showsVerticalScrollIndicator={showsVerticalScrollIndicator} | ||
/> | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These screens actually look better in general without indicators (and already do not show them on web) so let's just set the prop to false.