Skip to content

Commit

Permalink
Merged in fix/login-fix (pull request #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Miklaszewski committed Apr 27, 2023
2 parents 9687b43 + b6bc4f6 commit cdaadbe
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions apps/next-app/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ReactElement, ReactNode, useState } from 'react';
import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs';
import { NextPage } from 'next';
import { Layout } from 'shared/components/Layout';
import { ROUTES } from 'constants/ROUTES';

const nunito = Nunito({ subsets: ['latin'], weight: ['300', '500', '700'] });

Expand All @@ -18,7 +19,11 @@ type CustomAppProps = AppProps & {
initialSession: Session;
};

export default function App({ Component, pageProps }: CustomAppProps) {
export default function App({
Component,
pageProps,
...appProps
}: CustomAppProps) {
const [supabaseClient] = useState(() => createBrowserSupabaseClient());

return (
Expand All @@ -28,9 +33,13 @@ export default function App({ Component, pageProps }: CustomAppProps) {
>
<AppProviders>
<main className={nunito.className}>
<Layout>
<Component {...pageProps} />)
</Layout>
{appProps.router.pathname === ROUTES.PROVIDER ? (
<Component {...pageProps} />
) : (
<Layout>
<Component {...pageProps} />
</Layout>
)}
</main>
</AppProviders>
</SessionContextProvider>
Expand Down

0 comments on commit cdaadbe

Please sign in to comment.