Skip to content

Commit

Permalink
feat: make it hideable
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Jan 20, 2025
1 parent 8a94005 commit e4ceaf2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 2 additions & 0 deletions examples/expo-example/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const preview: Preview = {
date: /Date$/,
},
},
hideFullScreenButton: false,
noSafeArea: false,
my_param: 'anything',
backgrounds: {
default: Appearance.getColorScheme() === 'dark' ? 'dark' : 'plain',
Expand Down
40 changes: 21 additions & 19 deletions packages/react-native-ui/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,27 @@ export const Layout = ({
<View style={{ flex: 1, overflow: 'hidden' }}>
{children}

<TouchableOpacity
style={{
position: 'absolute',
bottom: uiHidden ? 56 + insets.bottom : 16,
right: 16,
backgroundColor: theme.background.content,
padding: 4,
borderRadius: 4,
borderWidth: 1,
borderColor: theme.appBorderColor,
}}
onPress={() => setUiHidden((prev) => !prev)}
>
{uiHidden ? (
<CloseFullscreenIcon color={theme.color.mediumdark} />
) : (
<FullscreenIcon color={theme.color.mediumdark} />
)}
</TouchableOpacity>
{story.parameters.hideFullScreenButton ? null : (
<TouchableOpacity
style={{
position: 'absolute',
bottom: uiHidden ? 56 + insets.bottom : 16,
right: 16,
backgroundColor: theme.background.content,
padding: 4,
borderRadius: 4,
borderWidth: 1,
borderColor: theme.appBorderColor,
}}
onPress={() => setUiHidden((prev) => !prev)}
>
{uiHidden ? (
<CloseFullscreenIcon color={theme.color.mediumdark} />
) : (
<FullscreenIcon color={theme.color.mediumdark} />
)}
</TouchableOpacity>
)}
</View>

<MobileMenuDrawer ref={mobileMenuDrawerRef}>
Expand Down

0 comments on commit e4ceaf2

Please sign in to comment.