Skip to content

Commit

Permalink
feat(login route conditional): on login route, do not display layout
Browse files Browse the repository at this point in the history
  • Loading branch information
azoitos committed Aug 20, 2020
1 parent 6e47be2 commit 7d179ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PlexLoginButton from '../PlexLoginButton';

const Login: React.FC = () => {
return (
<div className="w-full">
<div className="w-full pt-10">
<form className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div className="flex justify-center text-gray-900 font-bold text-xl mb-2">
Overseerr
Expand Down
17 changes: 11 additions & 6 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ import React from 'react';
import '../styles/globals.css';
import App from 'next/app';
import Layout from '../components/Layout';
import LoginPage from './login';

class CoreApp extends App {
public render(): JSX.Element {
const { Component, pageProps } = this.props;
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
const { Component, pageProps, router } = this.props;
if (router.asPath == '/login') {
return <LoginPage />;
} else {
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
}
}
}

Expand Down
6 changes: 1 addition & 5 deletions src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { NextPage } from 'next';
import Login from '../components/Login';

const LoginPage: NextPage = () => {
return (
<div className="w-full">
<Login />
</div>
);
return <Login />;
};

export default LoginPage;

0 comments on commit 7d179ae

Please sign in to comment.