Commit 69fe327 1 parent 6681466 commit 69fe327 Copy full SHA for 69fe327
File tree 2 files changed +9
-11
lines changed
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Color from 'color'
3
3
import styled from 'styled-components'
4
4
import { ArrowDown } from 'components/icons'
5
5
import {
6
+ useDisclosureState ,
6
7
Disclosure as ReakitDisclosure ,
7
8
DisclosureContent as ReakitDisclosureContent ,
8
9
} from 'reakit/Disclosure'
@@ -77,7 +78,9 @@ const DisclosureContent = styled(ReakitDisclosureContent)`
77
78
}
78
79
`
79
80
80
- const Sidebar = ( { sidebarIcon, disclosure, children, ...props } ) => {
81
+ const Sidebar = ( { sidebarIcon, children, ...props } ) => {
82
+ const disclosure = useDisclosureState ( { animated : true , visible : true } )
83
+
81
84
const openingIcon = sidebarIcon || (
82
85
< Arrow style = { { transform : 'rotate(270deg)' } } />
83
86
)
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import { useDisclosureState } from 'reakit/Disclosure'
3
2
4
3
import Box from 'components/Box'
5
4
import Sidebar from 'components/Sidebar'
@@ -13,15 +12,11 @@ export default {
13
12
} ,
14
13
}
15
14
16
- const Template = ( args ) => {
17
- const disclosure = useDisclosureState ( { animated : true } )
18
-
19
- return (
20
- < Box position = "relative" height = "100vh" >
21
- < Sidebar disclosure = { disclosure } { ...args } />
22
- </ Box >
23
- )
24
- }
15
+ const Template = ( args ) => (
16
+ < Box height = "100vh" >
17
+ < Sidebar { ...args } />
18
+ </ Box >
19
+ )
25
20
26
21
export const Default = Template . bind ( { } )
27
22
Default . args = {
You can’t perform that action at this time.
0 commit comments