Skip to content
Snippets Groups Projects
Commit 0df6448b authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

fix(app): cozy bar clickable

parent 2336169c
Branches
Tags
No related merge requests found
import { useClient } from 'cozy-client' import { useClient } from 'cozy-client'
import { useWebviewIntent } from 'cozy-intent'
import { useI18n } from 'cozy-ui/transpiled/react/I18n' import { useI18n } from 'cozy-ui/transpiled/react/I18n'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
...@@ -18,9 +19,19 @@ export const App = ({ ...@@ -18,9 +19,19 @@ export const App = ({
const { t } = useI18n() const { t } = useI18n()
const client = useClient() const client = useClient()
const location = useLocation() const location = useLocation()
const webviewIntent = useWebviewIntent()
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(true)
useEffect(() => {
webviewIntent?.call('setFlagshipUI', {
bottomBackground: '#E8F0FF',
bottomTheme: 'light',
topBackground: '#ffffff',
topTheme: 'light'
})
}, [webviewIntent])
useEffect(() => { useEffect(() => {
let subscribed = true let subscribed = true
async function getActions() { async function getActions() {
......
import 'cozy-ui/transpiled/react/stylesheet.css'
import 'cozy-ui/dist/cozy-ui.utils.min.css' import 'cozy-ui/dist/cozy-ui.utils.min.css'
import 'cozy-ui/transpiled/react/stylesheet.css'
import 'src/styles/index.styl' import 'src/styles/index.styl'
import React from 'react' import { CozyProvider } from 'cozy-client'
import { createRoot } from 'react-dom/client' import { I18n } from 'cozy-ui/transpiled/react/I18n'
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
import { import {
StylesProvider, StylesProvider,
createGenerateClassName createGenerateClassName
} from 'cozy-ui/transpiled/react/styles' } from 'cozy-ui/transpiled/react/styles'
import { I18n } from 'cozy-ui/transpiled/react/I18n' import React from 'react'
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme' import { createRoot } from 'react-dom/client'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
import { CozyProvider } from 'cozy-client'
import setupApp from 'src/targets/browser/setupApp'
import { HashRouter } from 'react-router-dom'
import AppLayout from 'components/AppLayout'
import { App } from 'components/App' import { App } from 'components/App'
import { AppRoutes } from 'components/Routes' import { AppRoutes } from 'components/Routes'
import MatomoTracker from 'utils/matomoTracker' import { WebviewIntentProvider } from 'cozy-intent'
import { createHashHistory } from 'history' import { createHashHistory } from 'history'
import { HashRouter } from 'react-router-dom'
import setupApp from 'src/targets/browser/setupApp'
import MatomoTracker from 'utils/matomoTracker'
declare let __PIWIK_TRACKER_URL__: string declare let __PIWIK_TRACKER_URL__: string
declare let __PIWIK_SITEID__: number declare let __PIWIK_SITEID__: number
...@@ -59,21 +59,23 @@ const init = () => { ...@@ -59,21 +59,23 @@ const init = () => {
} }
root.render( root.render(
<StylesProvider generateClassName={generateClassName}> <WebviewIntentProvider>
<CozyProvider client={client}> <StylesProvider generateClassName={generateClassName}>
<I18n lang={lang} polyglot={polyglot}> <CozyProvider client={client}>
<HashRouter> <I18n lang={lang} polyglot={polyglot}>
<MuiCozyTheme> <HashRouter>
<BreakpointsProvider> <MuiCozyTheme>
<App tracker={tracker}> <BreakpointsProvider>
<AppRoutes /> <App tracker={tracker}>
</App> <AppRoutes />
</BreakpointsProvider> </App>
</MuiCozyTheme> </BreakpointsProvider>
</HashRouter> </MuiCozyTheme>
</I18n> </HashRouter>
</CozyProvider> </I18n>
</StylesProvider> </CozyProvider>
</StylesProvider>
</WebviewIntentProvider>
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment