playbook_ui 14.17.0.pre.alpha.PLAY1967bracketlayoutphase27221 → 14.17.0.pre.alpha.PLAY20267223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +23 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +11 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +60 -128
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +97 -0
- data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -50
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +0 -2
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +118 -318
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +41 -61
- data/dist/chunks/{_typeahead-DZZ1n1Oe.js → _typeahead-HqfDnjRe.js} +1 -1
- data/dist/chunks/_weekday_stacked-CPNaHtxQ.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +6 -4
- data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +0 -73
- data/dist/chunks/_weekday_stacked-C-B5y5yN.js +0 -45
@@ -1,102 +1,11 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import Layout from '../../pb_layout/_layout'
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
5
|
+
import Body from '../../pb_body/_body'
|
4
6
|
import Caption from '../../pb_caption/_caption'
|
5
7
|
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
6
8
|
|
7
|
-
const teamData = {
|
8
|
-
eagles: {
|
9
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/8/8e/Philadelphia_Eagles_logo.svg/1920px-Philadelphia_Eagles_logo.svg.png",
|
10
|
-
name:"Eagles",
|
11
|
-
rank:"#1 NFC East",
|
12
|
-
territory:"PHI",
|
13
|
-
},
|
14
|
-
packers: {
|
15
|
-
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Green_Bay_Packers_logo.svg/1920px-Green_Bay_Packers_logo.svg.png",
|
16
|
-
name:"Packers",
|
17
|
-
rank:"#3 NFC North",
|
18
|
-
territory:"GB",
|
19
|
-
},
|
20
|
-
vikings: {
|
21
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/4/48/Minnesota_Vikings_logo.svg/1024px-Minnesota_Vikings_logo.svg.png",
|
22
|
-
name:"Vikings",
|
23
|
-
rank:"#2 NFC North",
|
24
|
-
territory:"MIN",
|
25
|
-
},
|
26
|
-
rams: {
|
27
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/8/8a/Los_Angeles_Rams_logo.svg/1920px-Los_Angeles_Rams_logo.svg.png",
|
28
|
-
name:"Rams",
|
29
|
-
rank:"#1 NFC West",
|
30
|
-
territory:"LAR",
|
31
|
-
},
|
32
|
-
lions: {
|
33
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/7/71/Detroit_Lions_logo.svg/1920px-Detroit_Lions_logo.svg.png",
|
34
|
-
name:"Lions",
|
35
|
-
rank:"#1 NFC North",
|
36
|
-
territory:"DET",
|
37
|
-
},
|
38
|
-
commanders: {
|
39
|
-
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Washington_Commanders_logo.svg/2560px-Washington_Commanders_logo.svg.png",
|
40
|
-
name:"Commanders",
|
41
|
-
rank:"#2 NFC East",
|
42
|
-
territory:"WAS",
|
43
|
-
},
|
44
|
-
buccaneers: {
|
45
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/a/a2/Tampa_Bay_Buccaneers_logo.svg/1920px-Tampa_Bay_Buccaneers_logo.svg.png",
|
46
|
-
name:"Buccaneers",
|
47
|
-
rank:"#1 NFC South",
|
48
|
-
territory:"TB",
|
49
|
-
},
|
50
|
-
chiefs: {
|
51
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/e/e1/Kansas_City_Chiefs_logo.svg/2560px-Kansas_City_Chiefs_logo.svg.png",
|
52
|
-
name:"Chiefs",
|
53
|
-
rank:"#1 AFC West",
|
54
|
-
territory:"KC",
|
55
|
-
},
|
56
|
-
chargers: {
|
57
|
-
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Los_Angeles_Chargers_logo.svg/2560px-Los_Angeles_Chargers_logo.svg.png",
|
58
|
-
name:"Chargers",
|
59
|
-
rank:"#2 AFC West",
|
60
|
-
territory:"LAC",
|
61
|
-
},
|
62
|
-
texans: {
|
63
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/2/28/Houston_Texans_logo.svg/1280px-Houston_Texans_logo.svg.png",
|
64
|
-
name:"Texans",
|
65
|
-
rank:"#1 AFC South",
|
66
|
-
territory:"HOU",
|
67
|
-
},
|
68
|
-
broncos: {
|
69
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/4/44/Denver_Broncos_logo.svg/2560px-Denver_Broncos_logo.svg.png",
|
70
|
-
name:"Broncos",
|
71
|
-
rank:"#3 AFC West",
|
72
|
-
territory:"DEN",
|
73
|
-
},
|
74
|
-
bills: {
|
75
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/7/77/Buffalo_Bills_logo.svg/1920px-Buffalo_Bills_logo.svg.png",
|
76
|
-
name:"Bills",
|
77
|
-
rank:"#1 AFC East",
|
78
|
-
territory:"BUF",
|
79
|
-
},
|
80
|
-
steelers: {
|
81
|
-
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Pittsburgh_Steelers_logo.svg/1280px-Pittsburgh_Steelers_logo.svg.png",
|
82
|
-
name:"Steelers",
|
83
|
-
rank:"#2 AFC North",
|
84
|
-
territory:"PIT",
|
85
|
-
},
|
86
|
-
ravens: {
|
87
|
-
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/1/16/Baltimore_Ravens_logo.svg/2560px-Baltimore_Ravens_logo.svg.png",
|
88
|
-
name:"Ravens",
|
89
|
-
rank:"#1 AFC North",
|
90
|
-
territory:"BAL",
|
91
|
-
},
|
92
|
-
bye: {
|
93
|
-
avatar:"",
|
94
|
-
name:"BYE",
|
95
|
-
rank:"",
|
96
|
-
territory:"",
|
97
|
-
},
|
98
|
-
}
|
99
|
-
|
100
9
|
const LayoutBracket = () => {
|
101
10
|
return (
|
102
11
|
<div>
|
@@ -109,140 +18,80 @@ const LayoutBracket = () => {
|
|
109
18
|
</Layout.RoundLabel>
|
110
19
|
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
111
20
|
<Layout.Game>
|
112
|
-
<
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
avatar={teamData.eagles.avatar}
|
121
|
-
name={teamData.eagles.name}
|
122
|
-
points="22"
|
123
|
-
rank={teamData.eagles.rank}
|
124
|
-
territory={teamData.eagles.territory}
|
125
|
-
winner
|
126
|
-
/>
|
21
|
+
<Flex justify="between">
|
22
|
+
<Body>Packers</Body>
|
23
|
+
<Body>10</Body>
|
24
|
+
</Flex>
|
25
|
+
<Flex justify="between">
|
26
|
+
<Body><strong>Eagles</strong></Body>
|
27
|
+
<Body>22</Body>
|
28
|
+
</Flex>
|
127
29
|
</Layout.Game>
|
128
30
|
<Layout.Game>
|
129
|
-
<
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
avatar={teamData.rams.avatar}
|
138
|
-
name={teamData.rams.name}
|
139
|
-
points="27"
|
140
|
-
rank={teamData.rams.rank}
|
141
|
-
territory={teamData.rams.territory}
|
142
|
-
winner
|
143
|
-
/>
|
31
|
+
<Flex justify="between">
|
32
|
+
<Body>Vikings</Body>
|
33
|
+
<Body>9</Body>
|
34
|
+
</Flex>
|
35
|
+
<Flex justify="between">
|
36
|
+
<Body><strong>Rams</strong></Body>
|
37
|
+
<Body>27</Body>
|
38
|
+
</Flex>
|
144
39
|
</Layout.Game>
|
145
40
|
<Layout.Game>
|
146
|
-
<
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
winner
|
153
|
-
/>
|
154
|
-
<Layout.Participant
|
155
|
-
avatar={teamData.bye.avatar}
|
156
|
-
name={teamData.bye.name}
|
157
|
-
points=""
|
158
|
-
rank={teamData.bye.rank}
|
159
|
-
territory={teamData.bye.territory}
|
160
|
-
/>
|
41
|
+
<Flex justify="between">
|
42
|
+
<Body><strong>Lions</strong></Body>
|
43
|
+
</Flex>
|
44
|
+
<Flex justify="between">
|
45
|
+
<Body>BYE</Body>
|
46
|
+
</Flex>
|
161
47
|
</Layout.Game>
|
162
48
|
<Layout.Game>
|
163
|
-
<
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<Layout.Participant
|
172
|
-
avatar={teamData.buccaneers.avatar}
|
173
|
-
name={teamData.buccaneers.name}
|
174
|
-
points="20"
|
175
|
-
rank={teamData.buccaneers.rank}
|
176
|
-
territory={teamData.buccaneers.territory}
|
177
|
-
/>
|
49
|
+
<Flex justify="between">
|
50
|
+
<Body><strong>Commanders</strong></Body>
|
51
|
+
<Body>23</Body>
|
52
|
+
</Flex>
|
53
|
+
<Flex justify="between">
|
54
|
+
<Body>Buccaneers</Body>
|
55
|
+
<Body>20</Body>
|
56
|
+
</Flex>
|
178
57
|
</Layout.Game>
|
179
58
|
<Layout.Game>
|
180
|
-
<
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
winner
|
187
|
-
/>
|
188
|
-
<Layout.Participant
|
189
|
-
avatar={teamData.bye.avatar}
|
190
|
-
name={teamData.bye.name}
|
191
|
-
points=""
|
192
|
-
rank={teamData.bye.rank}
|
193
|
-
territory={teamData.bye.territory}
|
194
|
-
/>
|
59
|
+
<Flex justify="between">
|
60
|
+
<Body><strong>Chiefs</strong></Body>
|
61
|
+
</Flex>
|
62
|
+
<Flex justify="between">
|
63
|
+
<Body>BYE</Body>
|
64
|
+
</Flex>
|
195
65
|
</Layout.Game>
|
196
66
|
<Layout.Game>
|
197
|
-
<
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
avatar={teamData.texans.avatar}
|
206
|
-
name={teamData.texans.name}
|
207
|
-
points="32"
|
208
|
-
rank={teamData.texans.rank}
|
209
|
-
territory={teamData.texans.territory}
|
210
|
-
winner
|
211
|
-
/>
|
67
|
+
<Flex justify="between">
|
68
|
+
<Body>Chargers</Body>
|
69
|
+
<Body>12</Body>
|
70
|
+
</Flex>
|
71
|
+
<Flex justify="between">
|
72
|
+
<Body><strong>Texans</strong></Body>
|
73
|
+
<Body>32</Body>
|
74
|
+
</Flex>
|
212
75
|
</Layout.Game>
|
213
76
|
<Layout.Game>
|
214
|
-
<
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
avatar={teamData.bills.avatar}
|
223
|
-
name={teamData.bills.name}
|
224
|
-
points="31"
|
225
|
-
rank={teamData.bills.rank}
|
226
|
-
territory={teamData.bills.territory}
|
227
|
-
winner
|
228
|
-
/>
|
77
|
+
<Flex justify="between">
|
78
|
+
<Body>Broncos</Body>
|
79
|
+
<Body>7</Body>
|
80
|
+
</Flex>
|
81
|
+
<Flex justify="between">
|
82
|
+
<Body><strong>Bills</strong></Body>
|
83
|
+
<Body>31</Body>
|
84
|
+
</Flex>
|
229
85
|
</Layout.Game>
|
230
86
|
<Layout.Game>
|
231
|
-
<
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
avatar={teamData.ravens.avatar}
|
240
|
-
name={teamData.ravens.name}
|
241
|
-
points="28"
|
242
|
-
rank={teamData.ravens.rank}
|
243
|
-
territory={teamData.ravens.territory}
|
244
|
-
winner
|
245
|
-
/>
|
87
|
+
<Flex justify="between">
|
88
|
+
<Body>Steelers</Body>
|
89
|
+
<Body>14</Body>
|
90
|
+
</Flex>
|
91
|
+
<Flex justify="between">
|
92
|
+
<Body><strong>Ravens</strong></Body>
|
93
|
+
<Body>28</Body>
|
94
|
+
</Flex>
|
246
95
|
</Layout.Game>
|
247
96
|
</Layout.Round>
|
248
97
|
<Layout.RoundLabel>
|
@@ -251,72 +100,44 @@ const LayoutBracket = () => {
|
|
251
100
|
</Layout.RoundLabel>
|
252
101
|
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
253
102
|
<Layout.Game>
|
254
|
-
<
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
avatar={teamData.eagles.avatar}
|
263
|
-
name={teamData.eagles.name}
|
264
|
-
points="28"
|
265
|
-
rank={teamData.eagles.rank}
|
266
|
-
territory={teamData.eagles.territory}
|
267
|
-
winner
|
268
|
-
/>
|
103
|
+
<Flex justify="between">
|
104
|
+
<Body>Rams</Body>
|
105
|
+
<Body>22</Body>
|
106
|
+
</Flex>
|
107
|
+
<Flex justify="between">
|
108
|
+
<Body><strong>Eagles</strong></Body>
|
109
|
+
<Body>28</Body>
|
110
|
+
</Flex>
|
269
111
|
</Layout.Game>
|
270
112
|
<Layout.Game>
|
271
|
-
<
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
<Layout.Participant
|
280
|
-
avatar={teamData.lions.avatar}
|
281
|
-
name={teamData.lions.name}
|
282
|
-
points="31"
|
283
|
-
rank={teamData.lions.rank}
|
284
|
-
territory={teamData.lions.territory}
|
285
|
-
/>
|
113
|
+
<Flex justify="between">
|
114
|
+
<Body><strong>Commanders</strong></Body>
|
115
|
+
<Body>45</Body>
|
116
|
+
</Flex>
|
117
|
+
<Flex justify="between">
|
118
|
+
<Body>Lions</Body>
|
119
|
+
<Body>31</Body>
|
120
|
+
</Flex>
|
286
121
|
</Layout.Game>
|
287
122
|
<Layout.Game>
|
288
|
-
<
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
avatar={teamData.chiefs.avatar}
|
297
|
-
name={teamData.chiefs.name}
|
298
|
-
points="23"
|
299
|
-
rank={teamData.chiefs.rank}
|
300
|
-
territory={teamData.chiefs.territory}
|
301
|
-
winner
|
302
|
-
/>
|
123
|
+
<Flex justify="between">
|
124
|
+
<Body>Texans</Body>
|
125
|
+
<Body>14</Body>
|
126
|
+
</Flex>
|
127
|
+
<Flex justify="between">
|
128
|
+
<Body><strong>Chiefs</strong></Body>
|
129
|
+
<Body>23</Body>
|
130
|
+
</Flex>
|
303
131
|
</Layout.Game>
|
304
132
|
<Layout.Game>
|
305
|
-
<
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
avatar={teamData.bills.avatar}
|
314
|
-
name={teamData.bills.name}
|
315
|
-
points="27"
|
316
|
-
rank={teamData.bills.rank}
|
317
|
-
territory={teamData.bills.territory}
|
318
|
-
winner
|
319
|
-
/>
|
133
|
+
<Flex justify="between">
|
134
|
+
<Body>Ravens</Body>
|
135
|
+
<Body>25</Body>
|
136
|
+
</Flex>
|
137
|
+
<Flex justify="between">
|
138
|
+
<Body><strong>Bills</strong></Body>
|
139
|
+
<Body>27</Body>
|
140
|
+
</Flex>
|
320
141
|
</Layout.Game>
|
321
142
|
</Layout.Round>
|
322
143
|
<Layout.RoundLabel>
|
@@ -325,38 +146,24 @@ const LayoutBracket = () => {
|
|
325
146
|
</Layout.RoundLabel>
|
326
147
|
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
327
148
|
<Layout.Game>
|
328
|
-
<
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
avatar={teamData.eagles.avatar}
|
337
|
-
name={teamData.eagles.name}
|
338
|
-
points="55"
|
339
|
-
rank={teamData.eagles.rank}
|
340
|
-
territory={teamData.eagles.territory}
|
341
|
-
winner
|
342
|
-
/>
|
149
|
+
<Flex justify="between">
|
150
|
+
<Body>Commanders</Body>
|
151
|
+
<Body>23</Body>
|
152
|
+
</Flex>
|
153
|
+
<Flex justify="between">
|
154
|
+
<Body><strong>Eagles</strong></Body>
|
155
|
+
<Body>55</Body>
|
156
|
+
</Flex>
|
343
157
|
</Layout.Game>
|
344
158
|
<Layout.Game>
|
345
|
-
<
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
avatar={teamData.chiefs.avatar}
|
354
|
-
name={teamData.chiefs.name}
|
355
|
-
points="32"
|
356
|
-
rank={teamData.chiefs.rank}
|
357
|
-
territory={teamData.chiefs.territory}
|
358
|
-
winner
|
359
|
-
/>
|
159
|
+
<Flex justify="between">
|
160
|
+
<Body>Bills</Body>
|
161
|
+
<Body>29</Body>
|
162
|
+
</Flex>
|
163
|
+
<Flex justify="between">
|
164
|
+
<Body><strong>Chiefs</strong></Body>
|
165
|
+
<Body>32</Body>
|
166
|
+
</Flex>
|
360
167
|
</Layout.Game>
|
361
168
|
</Layout.Round>
|
362
169
|
<Layout.RoundLabel>
|
@@ -365,21 +172,14 @@ const LayoutBracket = () => {
|
|
365
172
|
</Layout.RoundLabel>
|
366
173
|
<Layout.Round>
|
367
174
|
<Layout.Game>
|
368
|
-
<
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
avatar={teamData.eagles.avatar}
|
377
|
-
name={teamData.eagles.name}
|
378
|
-
points="40"
|
379
|
-
rank={teamData.eagles.rank}
|
380
|
-
self
|
381
|
-
territory={teamData.eagles.territory}
|
382
|
-
/>
|
175
|
+
<Flex justify="between">
|
176
|
+
<Body>Chiefs</Body>
|
177
|
+
<Body>22</Body>
|
178
|
+
</Flex>
|
179
|
+
<Flex justify="between">
|
180
|
+
<Body><strong>Eagles</strong></Body>
|
181
|
+
<Body>40</Body>
|
182
|
+
</Flex>
|
383
183
|
</Layout.Game>
|
384
184
|
</Layout.Round>
|
385
185
|
</Layout>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Use `<Layout.RoundLabel>`, `<Layout.Round>`,
|
1
|
+
Use `<Layout.RoundLabel>`, `<Layout.Round>`, and `<Layout.Game>` to make a bracket layout.
|
2
2
|
|
3
3
|
On mobile devices, `<Layout.RoundLabel>` will display (on desktop these components are hidden) and the bracket will be in one column.
|
4
4
|
|
@@ -5,8 +5,6 @@ import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/glo
|
|
5
5
|
|
6
6
|
import Card from '../../pb_card/_card'
|
7
7
|
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
8
|
-
import Body from '../../pb_body/_body'
|
9
|
-
import Flex from '../../pb_flex/_flex'
|
10
8
|
|
11
9
|
type LayoutGameProps = {
|
12
10
|
children: React.ReactNode[] | React.ReactNode,
|
@@ -20,84 +18,66 @@ type LayoutGameProps = {
|
|
20
18
|
const Game = (props: LayoutGameProps) => {
|
21
19
|
const { children, className, numberOfRounds, numberOfGames, isOdd } = props
|
22
20
|
const dynamicInlineProps = globalInlineProps(props)
|
23
|
-
|
21
|
+
|
24
22
|
const numberOfChildren = Array.isArray(children) ? children.length : 0
|
25
|
-
|
23
|
+
|
26
24
|
const isMultiple = Array.isArray(children)
|
27
|
-
|
25
|
+
|
28
26
|
let ratio = 0
|
29
27
|
let exponent
|
30
28
|
if (numberOfGames > 1) {
|
31
29
|
exponent = (numberOfRounds) - Math.log2(numberOfGames) - 1
|
32
30
|
ratio = 2 ** exponent
|
33
31
|
}
|
34
|
-
|
35
|
-
let hasWinner = false
|
32
|
+
|
36
33
|
if (numberOfChildren === 2) {
|
37
34
|
const [firstChild, secondChild] = React.Children.toArray(children)
|
38
|
-
|
39
|
-
if (React.isValidElement(firstChild) && React.isValidElement(secondChild)) {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
35
|
+
|
36
|
+
if (React.isValidElement(firstChild) && React.isValidElement(secondChild)) {
|
37
|
+
return (
|
38
|
+
<div
|
39
|
+
className={classnames('layout_game', globalProps(props), className)}
|
40
|
+
style={dynamicInlineProps}
|
41
|
+
>
|
42
|
+
<Card
|
43
|
+
marginY="xs"
|
44
|
+
padding="none"
|
45
|
+
shadow="deep"
|
47
46
|
>
|
48
|
-
<Card
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
<div
|
60
|
-
className="half_box"
|
61
|
-
style={{ height: `calc(${ratio} * 100% + 4px)` }}
|
62
|
-
/>
|
63
|
-
}
|
64
|
-
{numberOfGames > 1 && hasWinner &&
|
65
|
-
<div className="polygon_node" />
|
66
|
-
}
|
67
|
-
</div>
|
47
|
+
<Card.Body padding="xs">{firstChild}</Card.Body>
|
48
|
+
<SectionSeparator />
|
49
|
+
<Card.Body padding="xs">{secondChild}</Card.Body>
|
50
|
+
</Card>
|
51
|
+
{isOdd && numberOfGames > 1 &&
|
52
|
+
<div
|
53
|
+
className="half_box"
|
54
|
+
style={{ height: `calc(${ratio} * 100% + 4px)` }}
|
55
|
+
/>
|
56
|
+
}
|
57
|
+
</div>
|
68
58
|
)
|
69
59
|
}
|
70
60
|
}
|
71
|
-
|
61
|
+
|
72
62
|
return (
|
73
63
|
<div
|
74
64
|
className={classnames('layout_game', globalProps(props), className)}
|
75
65
|
style={dynamicInlineProps}
|
76
66
|
>
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
<SectionSeparator />
|
92
|
-
<Card.Body padding="xs">
|
93
|
-
<Body color="lighter">
|
94
|
-
To be determined...
|
95
|
-
</Body>
|
96
|
-
</Card.Body>
|
97
|
-
</Card>
|
98
|
-
</div>
|
99
|
-
)}
|
100
|
-
{isOdd && numberOfGames > 1 &&
|
67
|
+
{((!isMultiple && children) || numberOfChildren >= 1 )? (
|
68
|
+
children
|
69
|
+
) : (
|
70
|
+
<Card
|
71
|
+
marginY="xs"
|
72
|
+
padding="none"
|
73
|
+
shadow="deep"
|
74
|
+
>
|
75
|
+
<Card.Body padding="xs">To be determined...</Card.Body>
|
76
|
+
<SectionSeparator />
|
77
|
+
<Card.Body padding="xs">To be determined...</Card.Body>
|
78
|
+
</Card>
|
79
|
+
)}
|
80
|
+
{isOdd && numberOfGames > 1 &&
|
101
81
|
<div
|
102
82
|
className="half_box"
|
103
83
|
style={{ height: `calc(${ratio} * 100% + 4px)` }}
|