Newer
Older
import Navbar from 'components/Navbar/Navbar'
import AppRoutes from 'components/Routes/Routes'
import SplashRoot from 'components/Splash/SplashRoot'
import WelcomeModal from 'components/WelcomeModal/WelcomeModal'
import { useWebviewIntent } from 'cozy-intent'
import { Layout } from 'cozy-ui/transpiled/react/Layout'
import React, { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { AppStore } from 'store'
import MatomoTracker from 'utils/matomoTracker'
export const App = ({ tracker }: AppProps) => {
const {
global: { termsStatus },
profile: { onboarding },
} = useSelector((state: AppStore) => state.ecolyo)
tracker?.track(location)
}, [tracker, location])

Guilhem CARRON
committed
useEffect(() => {
webviewIntent?.call('setFlagshipUI', {
bottomBackground: '#32343d',
bottomTheme: 'dark',
topBackground: '#1b1c22',
topTheme: 'dark',
})
}, [webviewIntent])
<Layout>
<SplashRoot>
{termsStatus.accepted && (
<>
<WelcomeModal open={!onboarding.isWelcomeSeen} />
<Navbar />
</>
)}
<main className="app-content">
<AppRoutes termsStatus={termsStatus} />
</main>
</SplashRoot>
</Layout>
)
}
export default App