File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ export const getSections = ({
7
7
return [
8
8
{
9
9
title : `Astro ${ title } ` ,
10
+ type : 'astro' ,
10
11
component : components [ 0 ] ,
11
12
...( props && props )
12
13
} ,
13
14
...( components [ 1 ] ? [ {
14
15
title : `Svelte ${ title } ` ,
16
+ type : 'svelte' ,
15
17
component : components [ 1 ] ,
16
18
...( showSubTitle && {
17
19
subTitle : 'For interactive examples, visit <a href="/svelte">Svelte Playground</a>'
@@ -20,6 +22,7 @@ export const getSections = ({
20
22
} ] : [ ] ) ,
21
23
...( components [ 2 ] ? [ {
22
24
title : `React ${ title } ` ,
25
+ type : 'react' ,
23
26
component : components [ 2 ] ,
24
27
...( showSubTitle && {
25
28
subTitle : 'For interactive examples, visit <a href="/react">React Playground</a>'
Original file line number Diff line number Diff line change 2
2
import ComponentWrapper from ' @static/ComponentWrapper.astro'
3
3
import Layout from ' @static/Layout.astro'
4
4
5
+ import Button from ' @components/Button/Button.astro'
6
+ import Sheet from ' @components/Sheet/Sheet.astro'
5
7
import AstroSidebar from ' @components/Sidebar/Sidebar.astro'
6
8
import SvelteSidebar from ' @components/Sidebar/Sidebar.svelte'
7
9
import ReactSidebar from ' @components/Sidebar/Sidebar.tsx'
@@ -69,6 +71,35 @@ const sections = getSections({
69
71
<ComponentWrapper title = " Sidebar with icons & states" >
70
72
<section.component groups = { itemGroupsWithIcons } />
71
73
</ComponentWrapper >
74
+
75
+ { section .type === ' astro' && (
76
+ <ComponentWrapper title = " Sidebar sheet" >
77
+ <Button theme = " secondary" id = " open-sidebar" >
78
+ Open Sidebar
79
+ </Button >
80
+ <Sheet
81
+ id = " sidebar"
82
+ position = " left"
83
+ >
84
+ <section.component groups = { itemGroupsWithIcons } />
85
+ </Sheet >
86
+ </ComponentWrapper >
87
+ )}
72
88
</div >
73
89
))}
74
90
</Layout >
91
+
92
+ <style >
93
+ #sidebar {
94
+ width: 300px;
95
+ }
96
+ </style >
97
+
98
+ <script >
99
+ import { modal } from '@utils/modal'
100
+
101
+ modal({
102
+ trigger: '#open-sidebar',
103
+ modal: '#sidebar'
104
+ })
105
+ </script >
You can’t perform that action at this time.
0 commit comments