Skip to content

Commit f4aad53

Browse files
authored
Merge branch 'next' into fix-withstorybook-typing
2 parents 567d608 + 1287053 commit f4aad53

File tree

5 files changed

+52
-8
lines changed

5 files changed

+52
-8
lines changed

packages/react-native-theming/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"main": "dist/index.js",
2222
"types": "dist/index.d.ts",
2323
"scripts": {
24-
"dev": "npx tsx ./scripts/gendtsdev.ts && tsup --watch",
25-
"prepare": "tsup && npx tsx ./scripts/patchdts.ts"
24+
"dev": "npx --yes tsx ./scripts/gendtsdev.ts && tsup --watch",
25+
"prepare": "tsup && npx --yes tsx ./scripts/patchdts.ts"
2626
},
2727
"dependencies": {
2828
"polished": "^4.3.1"

packages/react-native-ui/src/Layout.stories.tsx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { Layout } from './Layout';
33
import { mockDataset } from './mockdata';
4-
import { Text } from 'react-native';
4+
import { Text, View } from 'react-native';
55
import { GestureHandlerRootView } from 'react-native-gesture-handler';
66
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
7+
import { LayoutProvider } from './LayoutProvider';
78

89
const meta = {
910
title: 'components/Layout',
@@ -12,7 +13,9 @@ const meta = {
1213
(Story) => (
1314
<GestureHandlerRootView style={{ flex: 1 }}>
1415
<BottomSheetModalProvider>
15-
<Story />
16+
<LayoutProvider>
17+
<Story />
18+
</LayoutProvider>
1619
</BottomSheetModalProvider>
1720
</GestureHandlerRootView>
1821
),
@@ -31,3 +34,44 @@ export const Basic: Story = {
3134
storyId: 'emails-buildnotification--with-changes',
3235
},
3336
};
37+
38+
export const OverflowSidebarExample: Story = {
39+
args: {
40+
children: (
41+
<View
42+
style={{
43+
width: '100%',
44+
backgroundColor: 'lightgreen',
45+
alignItems: 'flex-end',
46+
left: '-50%',
47+
}}
48+
>
49+
<Text style={{ width: '50%', textAlign: 'right' }}>
50+
This box should not overflow the side navigation in desktop mode
51+
</Text>
52+
</View>
53+
),
54+
//@ts-ignore
55+
storyHash: mockDataset.withRoot,
56+
storyId: 'emails-buildnotification--with-changes',
57+
},
58+
};
59+
60+
export const OverflowAddonsExample: Story = {
61+
args: {
62+
children: (
63+
<View
64+
style={{
65+
height: '100%',
66+
backgroundColor: 'lightgreen',
67+
bottom: '-50%',
68+
}}
69+
>
70+
<Text style={{ height: '50%' }}>This box should not overflow the addons panel</Text>
71+
</View>
72+
),
73+
//@ts-ignore
74+
storyHash: mockDataset.withRoot,
75+
storyId: 'emails-buildnotification--with-changes',
76+
},
77+
};

packages/react-native-ui/src/Layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const Layout = ({
105105
</View>
106106

107107
<View style={{ flex: 1 }}>
108-
<View style={{ flex: 1 }}>{children}</View>
108+
<View style={{ flex: 1, overflow: 'hidden' }}>{children}</View>
109109

110110
<View
111111
style={{
@@ -133,7 +133,7 @@ export const Layout = ({
133133

134134
return (
135135
<View style={{ flex: 1, paddingTop: insets.top, backgroundColor: theme.background.content }}>
136-
<View style={{ flex: 1 }}>{children}</View>
136+
<View style={{ flex: 1, overflow: 'hidden' }}>{children}</View>
137137

138138
<MobileMenuDrawer ref={mobileMenuDrawerRef} onStateChange={setDrawerOpen}>
139139
<View style={{ paddingLeft: 16, paddingTop: 4, paddingBottom: 4 }}>

packages/react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"template/**/*"
3434
],
3535
"scripts": {
36-
"dev": "npx tsx buildscripts/gendtsdev.ts && tsup --watch",
36+
"dev": "npx --yes tsx buildscripts/gendtsdev.ts && tsup --watch",
3737
"prepare": "rm -rf dist/ && tsup && npm run prepare:withStorybook",
3838
"prepare:withStorybook": "tsup metro/withStorybook.ts --dts --outDir metro/ --clean false",
3939
"test": "jest",

packages/react-native/src/components/StoryView/StoryView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const StoryView = () => {
3737

3838
return (
3939
<View
40-
style={{ flex: 1, backgroundColor: theme.background?.content }}
40+
style={{ flex: 1, backgroundColor: theme.background?.content, overflow: 'hidden' }}
4141
key={id}
4242
testID={id}
4343
onStartShouldSetResponder={dismissOnStartResponder}

0 commit comments

Comments
 (0)