11import { Announced , getTheme , ITheme , styled } from '@fluentui/react' ;
2+ import { FluentProvider , teamsHighContrastTheme , Theme , webDarkTheme , webLightTheme } from '@fluentui/react-components' ;
23import { bindActionCreators , Dispatch } from '@reduxjs/toolkit' ;
34import { Resizable } from 're-resizable' ;
45import { Component } from 'react' ;
@@ -31,6 +32,7 @@ import { StatusMessages, TermsOfUseMessage } from './app-sections';
3132import { headerMessaging } from './app-sections/HeaderMessaging' ;
3233import { appStyles } from './App.styles' ;
3334import { classNames } from './classnames' ;
35+ import Notification from './common/banners/Notification' ;
3436import { KeyboardCopyEvent } from './common/copy-button/KeyboardCopyEvent' ;
3537import PopupsWrapper from './common/popups/PopupsWrapper' ;
3638import { createShareLink } from './common/share' ;
@@ -43,6 +45,7 @@ export interface IAppProps {
4345 theme ?: ITheme ;
4446 styles ?: object ;
4547 profile : object ;
48+ appTheme : string ;
4649 graphExplorerMode : Mode ;
4750 sidebarProperties : ISidebarProps ;
4851 sampleQuery : IQuery ;
@@ -404,99 +407,113 @@ class App extends Component<IAppProps, IAppState> {
404407 this . removeFlexBasisProperty ( ) ;
405408 this . removeSidebarHeightProperty ( ) ;
406409
410+ const fluentV9Themes : Record < string , Theme > = {
411+ 'light' : webLightTheme ,
412+ 'dark' : webDarkTheme ,
413+ 'high-contrast' : teamsHighContrastTheme
414+ }
407415 return (
408416 // @ts -ignore
409- < ThemeContext . Provider value = { this . props . appTheme } >
410- < PopupsProvider >
411- < div className = { `ms-Grid ${ classes . app } ` } style = { { paddingLeft : mobileScreen && '15px' } } >
412- < MainHeader
413- toggleSidebar = { this . toggleSidebar }
414- />
415- < Announced
416- message = {
417- ! showSidebar
418- ? translateMessage ( 'Sidebar minimized' )
419- : translateMessage ( 'Sidebar maximized' )
420- }
421- />
422- < div className = { `ms-Grid-row ${ classes . appRow } ` } style = { {
423- flexWrap : mobileScreen && 'wrap' ,
424- marginRight : showSidebar || ( graphExplorerMode === Mode . TryIt ) && '-20px' ,
425- flexDirection : ( graphExplorerMode === Mode . TryIt ) ? 'column' : 'row'
426- } } >
427- { graphExplorerMode === Mode . Complete && (
428- < Resizable
429- onResize = { ( e : any , direction : any , ref : any ) => {
430- if ( ref ?. style ?. width ) {
431- this . resizeSideBar ( ref . style . width ) ;
432- }
433- } }
434- className = { `ms-Grid-col ms-sm12 ms-md4 ms-lg4 ${ sidebarWidth } resizable-sidebar` }
435- minWidth = { '71' }
436- maxWidth = { maxWidth }
437- enable = { {
438- right : true
439- } }
440- handleClasses = { {
441- right : classes . vResizeHandle
442- } }
443- bounds = { 'parent' }
444- size = { {
445- width : sideWidth ,
446- height : ''
447- } }
448- >
449- < Sidebar currentTab = { this . state . sidebarTabSelection }
450- setSidebarTabSelection = { this . setSidebarTabSelection } showSidebar = { showSidebar }
451- toggleSidebar = { this . toggleSidebar }
452- mobileScreen = { mobileScreen } />
453- </ Resizable >
454- ) }
455- { graphExplorerMode === Mode . TryIt &&
417+ < FluentProvider theme = { fluentV9Themes [ this . props . appTheme ] } >
418+ < ThemeContext . Provider value = { this . props . appTheme } >
419+ < PopupsProvider >
420+ < div className = { `ms-Grid ${ classes . app } ` } style = { { paddingLeft : mobileScreen && '15px' } } >
421+ < MainHeader
422+ toggleSidebar = { this . toggleSidebar }
423+ />
424+ < Announced
425+ message = {
426+ ! showSidebar
427+ ? translateMessage ( 'Sidebar minimized' )
428+ : translateMessage ( 'Sidebar maximized' )
429+ }
430+ />
431+ < div className = { `ms-Grid-row ${ classes . appRow } ` } style = { {
432+ flexWrap : mobileScreen && 'wrap' ,
433+ marginRight : showSidebar || ( graphExplorerMode === Mode . TryIt ) && '-20px' ,
434+ flexDirection : ( graphExplorerMode === Mode . TryIt ) ? 'column' : 'row'
435+ } } >
436+ { graphExplorerMode === Mode . Complete && (
437+ < Resizable
438+ onResize = { ( e : any , direction : any , ref : any ) => {
439+ if ( ref ?. style ?. width ) {
440+ this . resizeSideBar ( ref . style . width ) ;
441+ }
442+ } }
443+ className = { `ms-Grid-col ms-sm12 ms-md4 ms-lg4 ${ sidebarWidth } resizable-sidebar` }
444+ minWidth = { '71' }
445+ maxWidth = { maxWidth }
446+ enable = { {
447+ right : true
448+ } }
449+ handleClasses = { {
450+ right : classes . vResizeHandle
451+ } }
452+ bounds = { 'parent' }
453+ size = { {
454+ width : sideWidth ,
455+ height : ''
456+ } }
457+ >
458+ < Sidebar currentTab = { this . state . sidebarTabSelection }
459+ setSidebarTabSelection = { this . setSidebarTabSelection } showSidebar = { showSidebar }
460+ toggleSidebar = { this . toggleSidebar }
461+ mobileScreen = { mobileScreen } />
462+ </ Resizable >
463+ ) }
464+ { graphExplorerMode === Mode . TryIt &&
456465 headerMessaging ( query ) }
457466
458- { displayContent && (
459- < Resizable
460- bounds = { 'window' }
461- className = { `ms-Grid-col ms-sm12 ms-md4 ms-lg4 ${ layout } ` }
462- enable = { {
463- right : false
464- } }
465- size = { {
466- width : graphExplorerMode === Mode . TryIt ? '100%' : contentWidth ,
467- height : ''
468- } }
469- style = { ! sidebarProperties . showSidebar && ! mobileScreen ? {
470- marginLeft : '8px' , display : 'flex' , flexDirection : 'column' , alignItems : 'stretch' , flex : 1
471- } : {
472- display : 'flex' , flexDirection : 'column' , alignItems : 'stretch' , flex : 1
473- } }
474- >
475- < ValidationProvider >
476- < div style = { { marginBottom : 2 } } >
477- < QueryRunner onSelectVerb = { this . handleSelectVerb } />
478- </ div >
479- < div style = { {
467+ { displayContent && (
468+ < Resizable
469+ bounds = { 'window' }
470+ className = { `ms-Grid-col ms-sm12 ms-md4 ms-lg4 ${ layout } ` }
471+ enable = { {
472+ right : false
473+ } }
474+ size = { {
475+ width : graphExplorerMode === Mode . TryIt ? '100%' : contentWidth ,
476+ height : ''
477+ } }
478+ style = { ! sidebarProperties . showSidebar && ! mobileScreen ? {
479+ marginLeft : '8px' , display : 'flex' , flexDirection : 'column' , alignItems : 'stretch' , flex : 1
480+ } : {
480481 display : 'flex' , flexDirection : 'column' , alignItems : 'stretch' , flex : 1
481- } } >
482- < div style = { mobileScreen ? this . statusAreaMobileStyle : this . statusAreaFullScreenStyle } >
483- < StatusMessages />
484- </ div >
485- < QueryResponse />
482+ } }
483+ >
484+ < div className = 'ms-Grid-row' >
485+ < Notification
486+ header = { translateMessage ( 'Banner notification 1 header' ) }
487+ content = { translateMessage ( 'Banner notification 1 content' ) }
488+ link = { translateMessage ( 'Banner notification 1 link' ) }
489+ linkText = { translateMessage ( 'Banner notification 1 link text' ) } />
486490 </ div >
487- </ ValidationProvider >
488- </ Resizable >
489- ) }
490- </ div >
491- < div style = { mobileScreen ? this . statusAreaMobileStyle : this . statusAreaFullScreenStyle } >
492- < TermsOfUseMessage />
491+ < ValidationProvider >
492+ < div style = { { marginBottom : 2 } } >
493+ < QueryRunner onSelectVerb = { this . handleSelectVerb } />
494+ </ div >
495+ < div style = { {
496+ display : 'flex' , flexDirection : 'column' , alignItems : 'stretch' , flex : 1
497+ } } >
498+ < div style = { mobileScreen ? this . statusAreaMobileStyle : this . statusAreaFullScreenStyle } >
499+ < StatusMessages />
500+ </ div >
501+ < QueryResponse />
502+ </ div >
503+ </ ValidationProvider >
504+ </ Resizable >
505+ ) }
506+ </ div >
507+ < div style = { mobileScreen ? this . statusAreaMobileStyle : this . statusAreaFullScreenStyle } >
508+ < TermsOfUseMessage />
509+ </ div >
493510 </ div >
494- </ div >
495- < CollectionPermissionsProvider >
496- < PopupsWrapper / >
497- </ CollectionPermissionsProvider >
498- </ PopupsProvider >
499- </ ThemeContext . Provider >
511+ < CollectionPermissionsProvider >
512+ < PopupsWrapper / >
513+ </ CollectionPermissionsProvider >
514+ </ PopupsProvider >
515+ </ ThemeContext . Provider >
516+ </ FluentProvider >
500517 ) ;
501518 }
502519}
0 commit comments