Skip to content

Commit

Permalink
fix(Announcements): Avoid overlapping dialog only show at root
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Sep 25, 2024
1 parent e028bdc commit 2b5b6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Outlet } from 'react-router-dom'
import { Outlet, useLocation } from 'react-router-dom'

import flag from 'cozy-flags'
import CozyDevTools from 'cozy-client/dist/devtools'
Expand All @@ -11,12 +11,16 @@ import ScrollToTopOnMount from 'components/ScrollToTopOnMount'
import Services from 'components/Services'
import Shortcuts from 'components/Shortcuts'
import GroupedServices from 'components/GroupedServices'
import { Announcements } from 'components/Announcements/Announcements'

const Home = ({ setAppsReady, wrapper }) => {
const { pathname } = useLocation()

return (
<CozyConfirmDialogProvider>
<Main className="u-flex-grow-1">
<ScrollToTopOnMount target={wrapper} />
{pathname === '/connected' && <Announcements />}
<Content className="u-flex u-flex-column u-ph-1">
{flag('debug') && <CozyDevTools />}
<Applications onAppsFetched={setAppsReady} />
Expand Down
2 changes: 0 additions & 2 deletions src/containers/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import {
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import SectionDialog from 'components/Sections/SectionDialog'
import { SentryRoutes } from 'lib/sentry'
import { Announcements } from 'components/Announcements/Announcements'

window.flag = window.flag || flag
window.minilog = minilog
Expand Down Expand Up @@ -135,7 +134,6 @@ const App = ({ accounts, konnectors, triggers }) => {
<ReloadFocus />
<MainView>
<BackupNotification />
<Announcements />
<Corner />
<div
className="u-flex u-flex-column u-flex-content-start u-flex-content-stretch u-w-100 u-m-auto u-pos-relative"
Expand Down

0 comments on commit 2b5b6eb

Please sign in to comment.