import { BrowserRouter as Router } from 'react-router-dom' ; import { noop } from '@proton/shared/lib/helpers/function' ; import { ApiProvider , ConfigProvider , CreateNotificationOptions , ThemeProvider , Icons , ModalsChildren , ModalsProvider , PreventLeaveProvider , RightToLeftProvider , } from '@proton/components' ; import * as config from './config' ; import Verify from './Verify' ; import NotificationsHijack from './NotificationsHijack' ; import broadcast , { MessageType } from './broadcast' ; import './app.scss' ; const enhancedConfig = { APP_VERSION_DISPLAY : '4.0.0' , ... config , } ; const App = ( ) => { const handleNotificationCreate = ( options ) => { const { type = 'success' , text } = options ; if ( typeof text === 'string' ) { broadcast ( { type : MessageType . NOTIFICATION , payload : { type , text } , } ) ; } } ; return ( < ConfigProvider config = { enhancedConfig } > < Router > < RightToLeftProvider > < Icons /> < ThemeProvider > < PreventLeaveProvider > < NotificationsHijack onCreate = { handleNotificationCreate } > < ModalsProvider > < ApiProvider config = { config } onLogout = { noop } > < Verify /> < ModalsChildren / > < /ApiProvider> < /ModalsProvider> < /NotificationsHijack> < /PreventLeaveProvider> < /ThemeProvider> < /RightToLeftProvider> < /Router> < /ConfigProvider>); } ; export default App ;