Remove dead code for pager (#2651)

zio/stable
dan 2024-02-05 22:40:07 +00:00 committed by GitHub
parent f0e046a44b
commit b7056365dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 35 deletions

View File

@ -22,7 +22,6 @@ export interface RenderTabBarFnProps {
export type RenderTabBarFn = (props: RenderTabBarFnProps) => JSX.Element
interface Props {
tabBarPosition?: 'top' | 'bottom'
initialPage?: number
renderTabBar: RenderTabBarFn
onPageSelected?: (index: number) => void
@ -36,7 +35,6 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(
function PagerImpl(
{
children,
tabBarPosition = 'top',
initialPage = 0,
renderTabBar,
onPageScrollStateChanged,
@ -122,8 +120,7 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(
return (
<View testID={testID} style={s.flex1}>
{tabBarPosition === 'top' &&
renderTabBar({
{renderTabBar({
selectedPage,
onSelect: onTabBarSelect,
})}
@ -136,11 +133,6 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(
onPageScroll={onPageScroll}>
{children}
</AnimatedPagerView>
{tabBarPosition === 'bottom' &&
renderTabBar({
selectedPage,
onSelect: onTabBarSelect,
})}
</View>
)
},

View File

@ -11,7 +11,6 @@ export interface RenderTabBarFnProps {
export type RenderTabBarFn = (props: RenderTabBarFnProps) => JSX.Element
interface Props {
tabBarPosition?: 'top' | 'bottom'
initialPage?: number
renderTabBar: RenderTabBarFn
onPageSelected?: (index: number) => void
@ -20,7 +19,6 @@ interface Props {
export const Pager = React.forwardRef(function PagerImpl(
{
children,
tabBarPosition = 'top',
initialPage = 0,
renderTabBar,
onPageSelected,
@ -72,8 +70,7 @@ export const Pager = React.forwardRef(function PagerImpl(
return (
<View style={s.hContentRegion}>
{tabBarPosition === 'top' &&
renderTabBar({
{renderTabBar({
selectedPage,
tabBarAnchor: <View ref={anchorRef} />,
onSelect: onTabBarSelect,
@ -83,11 +80,6 @@ export const Pager = React.forwardRef(function PagerImpl(
{child}
</View>
))}
{tabBarPosition === 'bottom' &&
renderTabBar({
selectedPage,
onSelect: onTabBarSelect,
})}
</View>
)
})

View File

@ -183,8 +183,7 @@ export const PagerWithHeader = React.forwardRef<PagerRef, PagerWithHeaderProps>(
initialPage={initialPage}
onPageSelected={onPageSelectedInner}
onPageSelecting={onPageSelecting}
renderTabBar={renderTabBar}
tabBarPosition="top">
renderTabBar={renderTabBar}>
{toArray(children)
.filter(Boolean)
.map((child, i) => {

View File

@ -76,8 +76,7 @@ export const PagerWithHeader = React.forwardRef<PagerRef, PagerWithHeaderProps>(
initialPage={initialPage}
onPageSelected={onPageSelectedInner}
onPageSelecting={onPageSelecting}
renderTabBar={renderTabBar}
tabBarPosition="top">
renderTabBar={renderTabBar}>
{toArray(children)
.filter(Boolean)
.map((child, i) => {

View File

@ -184,8 +184,7 @@ function HomeScreenReady({
initialPage={clamp(selectedPageIndex, 0, customFeeds.length)}
onPageSelected={onPageSelected}
onPageScrollStateChanged={onPageScrollStateChanged}
renderTabBar={renderTabBar}
tabBarPosition="top">
renderTabBar={renderTabBar}>
<FeedPage
key="1"
testID="followingFeedPage"
@ -212,8 +211,7 @@ function HomeScreenReady({
testID="homeScreen"
onPageSelected={onPageSelected}
onPageScrollStateChanged={onPageScrollStateChanged}
renderTabBar={renderTabBar}
tabBarPosition="top">
renderTabBar={renderTabBar}>
<HomeLoggedOutCTA />
</Pager>
)

View File

@ -337,7 +337,6 @@ export function SearchScreenInner({
if (hasSession) {
return query ? (
<Pager
tabBarPosition="top"
onPageSelected={onPageSelected}
renderTabBar={props => (
<CenteredView
@ -380,7 +379,6 @@ export function SearchScreenInner({
return query ? (
<Pager
tabBarPosition="top"
onPageSelected={onPageSelected}
renderTabBar={props => (
<CenteredView