Skip to content

Commit 297de6d

Browse files
committed
feat(menu): remove menus and custom animations
1 parent a34ccb5 commit 297de6d

9 files changed

Lines changed: 79 additions & 388 deletions

File tree

src/components/Drawer/Drawer.mdx

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,56 @@ import { Text } from '../Typography';
1616
### Usage
1717

1818
<Playground>
19-
<Drawer
20-
space="30%"
21-
isVisible={false}
22-
onClose={() => console.log('Close')}
23-
offset={0}
24-
position="left"
25-
getStyles={(props, theme) => ({
26-
modalContainerStyle: {},
27-
containerStyle: {},
28-
})}
29-
/>
19+
<Drawer />
20+
<Toggle>
21+
{({ on, toggle }) => (
22+
<>
23+
<Button onPress={toggle} isInline title="Open drawer menu" />
24+
<Drawer
25+
space={null} // px or %, null fits the content
26+
offset={0}
27+
position="bottom"
28+
isVisible={on}
29+
onClose={toggle}
30+
getStyles={(props, theme) => ({
31+
modalContainerStyle: {},
32+
containerStyle: {},
33+
})}
34+
>
35+
<Spacing padding={3}>
36+
<Box elevation={1} backgroundColor="white" borderRadius={4}>
37+
{[
38+
{
39+
onPress: toggle,
40+
title: 'Menu Option 1',
41+
color: 'danger',
42+
},
43+
{
44+
onPress: toggle,
45+
title: 'Menu Option 2',
46+
color: 'primary',
47+
},
48+
{
49+
onPress: toggle,
50+
title: 'Menu Option 3',
51+
color: 'secondary',
52+
},
53+
{
54+
onPress: toggle,
55+
title: 'Menu Option 4',
56+
},
57+
].map(option => (
58+
<Button key={option.title} appearance="minimal" {...option} />
59+
))}
60+
</Box>
61+
<Spacing paddingTop={3}>
62+
<Button onPress={toggle} title="Close" />
63+
</Spacing>
64+
</Spacing>
65+
</Drawer>
66+
</>
67+
)}
68+
</Toggle>
3069
</Playground>
3170

3271
### Variants

src/components/Drawer/Drawer.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export const Drawer = (props: DrawerProps) => {
5050
)(theme);
5151

5252
const animation = useSpring({
53-
config: {
54-
clamp: true,
55-
friction: 24,
56-
tension: 240,
57-
},
58-
5953
[position]: offset,
6054
from: { [position]: -600 },
6155
reset: true,

src/components/Menu/DrawerMenu.mdx

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/components/Menu/DrawerMenu.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/components/Menu/DropdownMenu.mdx

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/components/Menu/DropdownMenu.tsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/components/Menu/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/components/Modal/ModalBase.web.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ export const ModalBase = (props: ModalBaseProps): React.ReactPortal | null => {
6565
}, [visible]);
6666

6767
const { opacity, y } = useSpring({
68-
config: {
69-
clamp: true,
70-
friction: 24,
71-
tension: 240,
72-
},
7368
onRest: () => {
7469
if (!visible) setIsInView(false);
7570
},

0 commit comments

Comments
 (0)