-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
174 lines (170 loc) · 5.74 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import React from 'react';
// import ReduxAccordion from './src/Redux-accordion.jsx';
import {Accordion, AccordionSection} from './src/redux-accordion.jsx';
export default class App extends React.Component {
constructor(props) {
super(props);
}
render() {
return(
<section className="redux-accordion-test-page">
<h1>React Accordion Examples:</h1>
<p className="sub-title">Single Open, second section open by default: </p>
<Accordion
{...this.props}
singleOpen={true}
uniqId={'testAccordion1'}
className="test"
>
<AccordionSection
title="Section 1"
openByDefault={false}>
<ul>
<li>item 1 (li)</li>
<li>item 2 (li)</li>
<li>item 3 (li)</li>
<li>item 4 (li)</li>
</ul>
</AccordionSection>
<AccordionSection
title="Section 2"
openByDefault={true}>
<ul>
<li>item 1 (li)</li>
<li>item 2 (li)</li>
<li>item 3 (li)</li>
<li>item 4 (li)</li>
</ul>
</AccordionSection>
<AccordionSection
title="Section 3"
openByDefault={false}>
<ul>
<li>item 1 (li)</li>
<li>item 2 (li)</li>
<li>item 3 (li)</li>
<li>item 4 (li)</li>
</ul>
</AccordionSection>
</Accordion>
<br/><br/><br/>
<p className="sub-title">Multiple Open, second & third section open by default</p>
<Accordion
{...this.props}
singleOpen={false}
openByDefault={false}
uniqId={'testAccordion2'}>
<AccordionSection
title="Section 1">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 2" openByDefault={true}>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 3" openByDefault={true}>
<p>hello</p>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 4">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
</Accordion>
<br/><br/><br/>
<p className="sub-title">Multiple Open, second and fourth section open by default</p>
<Accordion
{...this.props}
singleOpen={false}
openByDefault={false}
uniqId={'testAccordion2'}>
<AccordionSection
title="Section 1">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 2" openByDefault={true}>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 3">
<p>hello</p>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 4" openByDefault={true}>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
</Accordion>
<br/><br/><br/>
<p className="sub-title">Multiple Open, closed by default</p>
<Accordion
{...this.props}
uniqId={'testAccordion3'}>
<AccordionSection
title="Section 1">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 2">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 3">
<p>hello</p>
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
<AccordionSection
title="Section 4">
<p>item 1 (paragraph)</p>
<p>item 2 (paragraph)</p>
<p>item 3 (paragraph)</p>
<p>item 4 (paragraph)</p>
</AccordionSection>
</Accordion>
<p className="sub-title">Single Item (note, singleOpen must be `false`)</p>
<Accordion singleOpen={false} className="test" uniqId={'testAccordion4'}>
<AccordionSection
title="Section 1"
openByDefault={false}>
Testing single section
</AccordionSection>
</Accordion>
</section>
);
}
}