Skip to content

Commit

Permalink
fix: fix header display
Browse files Browse the repository at this point in the history
  • Loading branch information
Melichka committed Sep 2, 2024
1 parent 8b8527f commit 7d084f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions application/frontend/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { I18nextProvider } from "react-i18next"
import { Outlet } from "react-router-dom"
import { Outlet, useLocation } from "react-router-dom"

import { Header } from "src/components/Header"
import { Theme } from "src/components/Theme"
Expand All @@ -8,13 +8,17 @@ import i18nInstance from "src/locales/service"
import Markup from "./Layout.styled"

export const Layout = () => {
const location = useLocation()

const shouldShowHeader = location.pathname !== "/"

return (
<Markup.Container>
<Theme>
<Markup.GlobalStyle />

<I18nextProvider i18n={i18nInstance}>
<Header />
{shouldShowHeader && <Header />}
<Outlet />
</I18nextProvider>
</Theme>
Expand Down

0 comments on commit 7d084f4

Please sign in to comment.