Skip to content

Commit

Permalink
Clean up Slot API
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Dec 2, 2024
1 parent 0aa1a0f commit 2e32d1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/components/Layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import {useNavigation} from '@react-navigation/native'
import {NavigationProp} from '#/lib/routes/types'
import {isIOS} from '#/platform/detection'
import {useSetDrawerOpen} from '#/state/shell'
import {
atoms as a,
useBreakpoints,
useGutterStyles,
useTheme,
ViewStyleProp,
} from '#/alf'
import {atoms as a, useBreakpoints, useGutterStyles, useTheme} from '#/alf'
import {Button, ButtonIcon} from '#/components/Button'
import {ArrowLeft_Stroke2_Corner0_Rounded as ArrowLeft} from '#/components/icons/Arrow'
import {Menu_Stroke2_Corner0_Rounded as Menu} from '#/components/icons/Menu'
Expand Down Expand Up @@ -63,8 +57,11 @@ export function Content({children}: {children: React.ReactNode}) {

export function Slot({
children,
style,
}: {children?: React.ReactNode} & ViewStyleProp) {
position = 'left',
}: {
children?: React.ReactNode
position?: 'left' | 'right'
}) {
return (
<View
style={[
Expand All @@ -73,9 +70,9 @@ export function Slot({
a.z_50,
{
width: BUTTON_SIZE,
right: 'auto',
right: position === 'left' ? 'auto' : 0,
left: position === 'right' ? 'auto' : 0,
},
style,
]}>
{children}
</View>
Expand Down
1 change: 0 additions & 1 deletion src/screens/Settings/ThreadPreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export function ThreadPreferencesScreen({}: Props) {
<Trans>Thread Preferences</Trans>
</Layout.Header.TitleText>
</Layout.Header.Content>
<Layout.Header.Slot />
</Layout.Header.Outer>

<SettingsList.Container>
Expand Down

0 comments on commit 2e32d1d

Please sign in to comment.