Skip to content

Commit

Permalink
update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnhan90 committed Jan 6, 2024
1 parent c0d7cf6 commit e34671b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
12 changes: 10 additions & 2 deletions src/layouts/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Head from "next/head";
import Header from "@components/header"
import { useTranslation } from 'next-i18next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { usePathname } from 'next/navigation'
import { useState } from 'react';

type LayoutType = {
title?: string;
Expand All @@ -10,6 +12,12 @@ type LayoutType = {


export default ({ children, title = "2ALL" }: LayoutType) => {
const pathname = usePathname()
const [onTop, setOnTop] = useState(false);

if(pathname === "/landingpage") {
}

return (
<div className="app-main">
<Head>
Expand All @@ -33,8 +41,8 @@ export default ({ children, title = "2ALL" }: LayoutType) => {
href="https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap"
/>
</Head>

<main className="landing-page-option-3 d-flex flex-column">
{/* landing-page-option-3 */}
<main className=" d-flex flex-column">
<Header />
{children}
</main>
Expand Down
35 changes: 17 additions & 18 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ import '@assets/css/bootstrap.min.css';
import '@assets/css/global.css';
import '@assets/css/fonts.css';
import '@assets/css/login.css';
import '@assets/css/old_style.css';
//import '@assets/css/old_style.css';
import '@assets/css/style.css';

type ExtendedAppProps = AppProps & {
Component: NextPage;
// emotionCache?: EmotionCache;
Component: NextPage;
};

const MyApp = ({
Expand All @@ -34,21 +33,21 @@ const MyApp = ({
const [interval, setInterval] = useState(0);

return(
<Fragment>
<ToastContainer
position="top-right"
autoClose={8000}
hideProgressBar={false}
newestOnTop={false}
draggable={false}
closeOnClick
pauseOnHover
/>
<SessionProvider session={session} refetchInterval={interval}>
<Component {...pageProps} />
<RefreshTokenHandler setInterval={setInterval} />
</SessionProvider>
</Fragment>
<Fragment>
<ToastContainer
position="top-right"
autoClose={8000}
hideProgressBar={false}
newestOnTop={false}
draggable={false}
closeOnClick
pauseOnHover
/>
<SessionProvider session={session} refetchInterval={interval}>
<Component {...pageProps} />
<RefreshTokenHandler setInterval={setInterval} />
</SessionProvider>
</Fragment>
)
};

Expand Down

0 comments on commit e34671b

Please sign in to comment.