Clean up Slot API
This commit is contained in:
@@ -7,13 +7,7 @@ import {useNavigation} from '@react-navigation/native'
|
|||||||
import {NavigationProp} from '#/lib/routes/types'
|
import {NavigationProp} from '#/lib/routes/types'
|
||||||
import {isIOS} from '#/platform/detection'
|
import {isIOS} from '#/platform/detection'
|
||||||
import {useSetDrawerOpen} from '#/state/shell'
|
import {useSetDrawerOpen} from '#/state/shell'
|
||||||
import {
|
import {atoms as a, useBreakpoints, useGutterStyles, useTheme} from '#/alf'
|
||||||
atoms as a,
|
|
||||||
useBreakpoints,
|
|
||||||
useGutterStyles,
|
|
||||||
useTheme,
|
|
||||||
ViewStyleProp,
|
|
||||||
} from '#/alf'
|
|
||||||
import {Button, ButtonIcon} from '#/components/Button'
|
import {Button, ButtonIcon} from '#/components/Button'
|
||||||
import {ArrowLeft_Stroke2_Corner0_Rounded as ArrowLeft} from '#/components/icons/Arrow'
|
import {ArrowLeft_Stroke2_Corner0_Rounded as ArrowLeft} from '#/components/icons/Arrow'
|
||||||
import {Menu_Stroke2_Corner0_Rounded as Menu} from '#/components/icons/Menu'
|
import {Menu_Stroke2_Corner0_Rounded as Menu} from '#/components/icons/Menu'
|
||||||
@@ -63,8 +57,11 @@ export function Content({children}: {children: React.ReactNode}) {
|
|||||||
|
|
||||||
export function Slot({
|
export function Slot({
|
||||||
children,
|
children,
|
||||||
style,
|
position = 'left',
|
||||||
}: {children?: React.ReactNode} & ViewStyleProp) {
|
}: {
|
||||||
|
children?: React.ReactNode
|
||||||
|
position?: 'left' | 'right'
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
@@ -73,9 +70,9 @@ export function Slot({
|
|||||||
a.z_50,
|
a.z_50,
|
||||||
{
|
{
|
||||||
width: BUTTON_SIZE,
|
width: BUTTON_SIZE,
|
||||||
right: 'auto',
|
right: position === 'left' ? 'auto' : 0,
|
||||||
|
left: position === 'right' ? 'auto' : 0,
|
||||||
},
|
},
|
||||||
style,
|
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ export function ThreadPreferencesScreen({}: Props) {
|
|||||||
<Trans>Thread Preferences</Trans>
|
<Trans>Thread Preferences</Trans>
|
||||||
</Layout.Header.TitleText>
|
</Layout.Header.TitleText>
|
||||||
</Layout.Header.Content>
|
</Layout.Header.Content>
|
||||||
<Layout.Header.Slot />
|
|
||||||
</Layout.Header.Outer>
|
</Layout.Header.Outer>
|
||||||
|
|
||||||
<SettingsList.Container>
|
<SettingsList.Container>
|
||||||
|
|||||||
Reference in New Issue
Block a user