6
6
Flex ,
7
7
Icon ,
8
8
List ,
9
+ Show ,
9
10
} from "@chakra-ui/react"
10
11
import React from "react"
11
12
import { MdExpandMore } from "react-icons/md"
@@ -27,46 +28,49 @@ const Mobile: React.FC<IPropsTableOfContentsMobile> = ({ items, maxDepth }) => {
27
28
}
28
29
29
30
return (
30
- < Box
31
- as = "aside"
32
- background = "background"
33
- border = "1px"
34
- borderColor = "border"
35
- borderRadius = "4px"
36
- py = { 2 }
37
- px = { 4 }
38
- >
39
- < Flex
40
- color = "text200"
41
- cursor = "pointer"
42
- alignItems = "center"
43
- justify = "space-between"
44
- { ...getButtonProps ( ) }
31
+ < Show below = "l" >
32
+ { /* TODO: switch `l` to `lg` after UI migration */ }
33
+ < Box
34
+ as = "aside"
35
+ background = "background"
36
+ border = "1px"
37
+ borderColor = "border"
38
+ borderRadius = "4px"
39
+ py = { 2 }
40
+ px = { 4 }
45
41
>
46
- < chakra . span flex = { 1 } fontWeight = { 500 } >
47
- < Translation id = "on-this-page" />
48
- </ chakra . span >
49
- < Icon
50
- as = { MdExpandMore }
51
- transform = { isOpen ? "rotate(0)" : "rotate(-90deg)" }
52
- boxSize = { 6 }
53
- transition = "transform .4s"
54
- />
55
- </ Flex >
56
- < Fade
57
- in = { isOpen }
58
- { ...getDisclosureProps ( ) }
59
- transition = { { enter : { duration : 0.6 } } }
60
- >
61
- < List { ...outerListProps } >
62
- < ItemsList
63
- items = { items }
64
- depth = { 0 }
65
- maxDepth = { maxDepth ? maxDepth : 1 }
42
+ < Flex
43
+ color = "text200"
44
+ cursor = "pointer"
45
+ alignItems = "center"
46
+ justify = "space-between"
47
+ { ...getButtonProps ( ) }
48
+ >
49
+ < chakra . span flex = { 1 } fontWeight = { 500 } >
50
+ < Translation id = "on-this-page" />
51
+ </ chakra . span >
52
+ < Icon
53
+ as = { MdExpandMore }
54
+ transform = { isOpen ? "rotate(0)" : "rotate(-90deg)" }
55
+ boxSize = { 6 }
56
+ transition = "transform .4s"
66
57
/>
67
- </ List >
68
- </ Fade >
69
- </ Box >
58
+ </ Flex >
59
+ < Fade
60
+ in = { isOpen }
61
+ { ...getDisclosureProps ( ) }
62
+ transition = { { enter : { duration : 0.6 } } }
63
+ >
64
+ < List { ...outerListProps } >
65
+ < ItemsList
66
+ items = { items }
67
+ depth = { 0 }
68
+ maxDepth = { maxDepth ? maxDepth : 1 }
69
+ />
70
+ </ List >
71
+ </ Fade >
72
+ </ Box >
73
+ </ Show >
70
74
)
71
75
}
72
76
0 commit comments