@@ -46,8 +46,10 @@ import { Tray } from '@instructure/ui-tray'
46
46
import { Img } from '@instructure/ui-img'
47
47
import { View } from '@instructure/ui-view'
48
48
import { SideNavBar } from '@instructure/ui-side-nav-bar'
49
+ import { TopNavBar } from '@instructure/ui-top-nav-bar'
49
50
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
50
51
import Link from '../Link'
52
+ import { Drilldown } from '@instructure/ui-drilldown'
51
53
52
54
type AppProps = {
53
55
navigate : ( path : string , options ?: { replace : boolean } ) => void
@@ -239,6 +241,121 @@ class App extends Component<AppProps, AppState> {
239
241
}
240
242
]
241
243
244
+ const drillDown = (
245
+ < Drilldown
246
+ rootPageId = { 'default' } //renderBackButtonLabel={item?.backButtonLabel}
247
+ >
248
+ < Drilldown . Page id = { 'default' } >
249
+ < Drilldown . Group key = { 'default' } id = { 'default' } >
250
+ < Drilldown . Option
251
+ id = { 'account' }
252
+ subPageId = { 'account' }
253
+ afterLabelContentVAlign = { 'center' }
254
+ >
255
+ < div >
256
+ < IconUserLine /> Account
257
+ </ div >
258
+ </ Drilldown . Option >
259
+ < Drilldown . Option
260
+ id = { 'courses' }
261
+ subPageId = { 'courses' }
262
+ afterLabelContentVAlign = { 'center' }
263
+ >
264
+ < div >
265
+ < IconCoursesLine /> Courses
266
+ </ div >
267
+ </ Drilldown . Option >
268
+ < Drilldown . Option
269
+ id = { 'dashboard' }
270
+ afterLabelContentVAlign = { 'center' }
271
+ onOptionClick = { ( ) => {
272
+ this . props . navigate ( '/dashboard' , { replace : true } )
273
+ this . setState ( { openMobile : false } )
274
+ } }
275
+ >
276
+ < div >
277
+ < IconDashboardLine /> Dashboard
278
+ </ div >
279
+ </ Drilldown . Option >
280
+ < Drilldown . Option
281
+ id = { 'help' }
282
+ afterLabelContentVAlign = { 'center' }
283
+ onOptionClick = { ( ) => alert ( 'Help clicked' ) }
284
+ >
285
+ < div >
286
+ < IconQuestionLine /> Help
287
+ </ div >
288
+ </ Drilldown . Option >
289
+ </ Drilldown . Group >
290
+ </ Drilldown . Page >
291
+ < Drilldown . Page
292
+ id = { 'account' }
293
+ renderBackButtonLabel = { 'Account' }
294
+ renderAfterChildren = {
295
+ < p >
296
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
297
+ aliquet erat in orci semper fringilla. Nullam suscipit mollis mi,
298
+ at vehicula magna vulputate eu. Cras mattis felis id quam vehicula
299
+ euismod. Nulla dolor enim, ornare in odio a, molestie dictum
300
+ ligula. Nullam maximus et dolor eget porttitor. Vestibulum
301
+ faucibus viverra pellentesque. Duis lorem lectus, porta vitae
302
+ aliquam vitae, vehicula sagittis nulla. Aenean sagittis congue
303
+ rhoncus. Cras laoreet eu nulla eu dignissim. Maecenas sed massa
304
+ nisi. Suspendisse pellentesque, metus sed ultricies porta, justo
305
+ tellus pulvinar diam, ac ornare massa nibh quis purus. Duis erat
306
+ ipsum, pellentesque in diam non, luctus accumsan metus. In ipsum
307
+ tellus, ullamcorper a faucibus a, venenatis ut urna. Sed at rutrum
308
+ turpis.
309
+ </ p >
310
+ }
311
+ renderBeforeChildren = {
312
+ < div style = { { display : 'flex' , justifyContent : 'center' } } >
313
+ < Img src = "https://sbcf.fr/wp-content/uploads/2018/03/sbcf-default-avatar.png" />
314
+ </ div >
315
+ }
316
+ >
317
+ < Drilldown . Group key = { 'account' } id = { 'account' } >
318
+ < Drilldown . Option
319
+ id = { 'accountinfo1' }
320
+ afterLabelContentVAlign = { 'center' }
321
+ >
322
+ < div > Account info 1</ div >
323
+ </ Drilldown . Option >
324
+ < Drilldown . Option
325
+ id = { 'accountinfo2' }
326
+ afterLabelContentVAlign = { 'center' }
327
+ >
328
+ < div > Account info 2</ div >
329
+ </ Drilldown . Option >
330
+ </ Drilldown . Group >
331
+ </ Drilldown . Page >
332
+ < Drilldown . Page id = { 'courses' } renderBackButtonLabel = { 'Courses' } >
333
+ < Drilldown . Group key = { 'courses' } id = { 'courses' } >
334
+ < Drilldown . Option
335
+ id = { 'courses1' }
336
+ afterLabelContentVAlign = { 'center' }
337
+ onOptionClick = { ( ) => {
338
+ this . props . navigate ( '/course1' , { replace : true } )
339
+ this . setState ( { openMobile : false } )
340
+ } }
341
+ >
342
+ < div > Courses1</ div >
343
+ </ Drilldown . Option >
344
+ < Drilldown . Option
345
+ id = { 'courses2' }
346
+ afterLabelContentVAlign = { 'center' }
347
+ onOptionClick = { ( ) => {
348
+ this . props . navigate ( '/course2' , { replace : true } )
349
+ this . setState ( { openMobile : false } )
350
+ } }
351
+ >
352
+ < div > Courses2</ div >
353
+ </ Drilldown . Option >
354
+ </ Drilldown . Group >
355
+ </ Drilldown . Page >
356
+ </ Drilldown >
357
+ )
358
+
242
359
return (
243
360
< div style = { { display : 'flex' , flexDirection : 'row' } } >
244
361
< InstUISettingsProvider >
@@ -346,49 +463,41 @@ class App extends Component<AppProps, AppState> {
346
463
onClick : ( ) => alert ( 'Alerts clicked' )
347
464
}
348
465
] }
349
- mobileMenu = { menuArray }
466
+ mobileMenu = { drillDown }
350
467
open = { this . state . openMobile } // jobb nev, pl mobileMenuOpen
351
468
onOpenChange = { ( open : boolean ) => {
352
469
// szinten
353
470
this . setState ( { openMobile : open } )
354
471
} }
355
472
ltiIcon = { < IconArcLine /> }
356
- ltiMenuItems = { [
357
- { id : 'library' , title : 'My Library' } ,
358
- { id : 'share' , title : 'Share with me' } ,
359
- { id : 'settings' , title : 'Settings' } ,
360
- {
361
- id : 'submenu' ,
362
- title : 'SubMenu' ,
363
- options : [
364
- {
365
- id : 'account' ,
366
- label : 'Account' ,
367
- renderBeforeTitle : < IconUserLine /> ,
368
- subPageId : 'accountPage' ,
369
- subOptions : [
370
- {
371
- id : 'profile' ,
372
- label : 'Profile Settings' ,
373
- href : '/profile'
374
- } ,
375
- {
376
- id : 'privacy' ,
377
- label : 'Privacy' ,
378
- href : '/privacy'
379
- }
380
- ]
381
- } ,
382
- {
383
- id : 'courses' ,
384
- label : 'Courses' ,
385
- renderBeforeTitle : < IconCoursesLine /> ,
386
- href : '/courses'
387
- }
388
- ]
389
- }
390
- ] }
391
- currentPageId = "share" // ltiCurrentPageID
473
+ ltiMenuItems = {
474
+ < TopNavBar . MenuItems
475
+ listLabel = "Page navigation"
476
+ currentPageId = "OverviewPage"
477
+ renderHiddenItemsMenuTriggerLabel = { ( hiddenChildrenCount ) =>
478
+ `${ hiddenChildrenCount } More`
479
+ }
480
+ >
481
+ < TopNavBar . Item id = "OverviewPage" href = "/#TopNavBar" >
482
+ Overview
483
+ </ TopNavBar . Item >
484
+ < TopNavBar . Item id = "AdminPage" href = "/#TopNavBar" >
485
+ Admin
486
+ </ TopNavBar . Item >
487
+ < TopNavBar . Item id = "SettingsPage" href = "/#TopNavBar" >
488
+ Settings
489
+ </ TopNavBar . Item >
490
+ < TopNavBar . Item id = "MapsPage" href = "/#TopNavBar" >
491
+ Maps
492
+ </ TopNavBar . Item >
493
+ < TopNavBar . Item id = "AssessmentsPage" href = "/#TopNavBar" >
494
+ Assessments
495
+ </ TopNavBar . Item >
496
+ < TopNavBar . Item id = "CommunityPage" href = "/#TopNavBar" >
497
+ Community
498
+ </ TopNavBar . Item >
499
+ </ TopNavBar . MenuItems >
500
+ }
392
501
/>
393
502
< Tray
394
503
label = "Courses"
0 commit comments