More layout

This commit is contained in:
Dan Abramov
2023-12-08 02:21:38 +00:00
parent a71f96a527
commit d3ed9abd8d
+13 -4
View File
@@ -11,6 +11,7 @@ import {Pager, PagerRef, RenderTabBarFnProps} from 'view/com/pager/Pager'
import {TabBar} from './TabBar' import {TabBar} from './TabBar'
import {OnScrollHandler} from 'lib/hooks/useOnMainScroll' import {OnScrollHandler} from 'lib/hooks/useOnMainScroll'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
import {usePalette} from '#/lib/hooks/usePalette'
const SCROLLED_DOWN_LIMIT = 200 const SCROLLED_DOWN_LIMIT = 200
@@ -150,10 +151,13 @@ let PagerTabBar = ({
onCurrentPageSelected?: (index: number) => void onCurrentPageSelected?: (index: number) => void
onSelect?: (index: number) => void onSelect?: (index: number) => void
}): React.ReactNode => { }): React.ReactNode => {
const pal = usePalette('default')
return ( return (
<> <>
<View style={styles.headerContainer}>{renderHeader?.()}</View> <View style={[styles.headerContainer, pal.border]}>
<View style={styles.tabBarContainer}> {renderHeader?.()}
</View>
<View style={[styles.tabBarContainer, pal.border]}>
<TabBar <TabBar
testID={testID} testID={testID}
items={items} items={items}
@@ -201,16 +205,21 @@ const styles = StyleSheet.create({
headerContainer: { headerContainer: {
marginLeft: 'auto', marginLeft: 'auto',
marginRight: 'auto', marginRight: 'auto',
width: 598, width: 600,
borderLeftWidth: 1,
borderRightWidth: 1,
}, },
tabBarContainer: { tabBarContainer: {
// @ts-ignore web-only // @ts-ignore web-only
position: 'sticky', position: 'sticky',
overflow: 'hidden',
top: 0, top: 0,
zIndex: 1, zIndex: 1,
marginLeft: 'auto', marginLeft: 'auto',
marginRight: 'auto', marginRight: 'auto',
width: 598, width: 600,
borderLeftWidth: 1,
borderRightWidth: 1,
}, },
}) })