Skip to content

Commit

Permalink
[#1584] Update conditional layout by adding array of string: newLayou…
Browse files Browse the repository at this point in the history
…tRoutes
  • Loading branch information
ifirmawan committed Sep 4, 2023
1 parent 5dddc97 commit c8088db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ UIStore.update((s) => {

function MyApp({ Component, pageProps }) {
const router = useRouter()
if (router.pathname !== '/landing') {
const newLayoutRoutes = ['/landing', '/onboarding']
if (!newLayoutRoutes.includes(router.pathname)) {
import('../main.scss')
import('../buttons.scss')
} else {
Expand Down Expand Up @@ -225,7 +226,7 @@ function MyApp({ Component, pageProps }) {
typeof window !== 'undefined' ? window.location.origin : ''
}
>
{router.pathname !== '/landing' && (
{!newLayoutRoutes.includes(router.pathname) && (
<Layout
{...pageProps}
{...{
Expand All @@ -235,7 +236,7 @@ function MyApp({ Component, pageProps }) {
}}
/>
)}
{router.pathname === '/landing' && (
{newLayoutRoutes.includes(router.pathname) && (
<NewLayout
{...pageProps}
{...{
Expand Down

0 comments on commit c8088db

Please sign in to comment.