From 6e47be2fa865bcd51582ce30ebee6fd820c5f9dd Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Wed, 19 Aug 2020 22:38:43 -0400 Subject: [PATCH 1/6] feat(login component/route): add: Login Component and Route --- src/components/Login/index.tsx | 29 +++++++++++++++++++++++++++++ src/pages/login.tsx | 13 +++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/components/Login/index.tsx create mode 100644 src/pages/login.tsx diff --git a/src/components/Login/index.tsx b/src/components/Login/index.tsx new file mode 100644 index 000000000..e369f7c2d --- /dev/null +++ b/src/components/Login/index.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import PlexLoginButton from '../PlexLoginButton'; + +const Login: React.FC = () => { + return ( +
+
+
+ Overseerr +
+
+ would like to sign in to your Plex account +
+
+ + console.log(`auth token is: ${authToken}`) + } + /> +
+
+

+ ©2020 Overseerr. All rights reserved. +

+
+ ); +}; + +export default Login; diff --git a/src/pages/login.tsx b/src/pages/login.tsx new file mode 100644 index 000000000..5b390e2d6 --- /dev/null +++ b/src/pages/login.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { NextPage } from 'next'; +import Login from '../components/Login'; + +const LoginPage: NextPage = () => { + return ( +
+ +
+ ); +}; + +export default LoginPage; From 7d179ae3b42d8ffae5e1b6e266038793260f1bbe Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Wed, 19 Aug 2020 23:00:23 -0400 Subject: [PATCH 2/6] feat(login route conditional): on login route, do not display layout --- src/components/Login/index.tsx | 2 +- src/pages/_app.tsx | 17 +++++++++++------ src/pages/login.tsx | 6 +----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Login/index.tsx b/src/components/Login/index.tsx index e369f7c2d..c152e0753 100644 --- a/src/components/Login/index.tsx +++ b/src/components/Login/index.tsx @@ -3,7 +3,7 @@ import PlexLoginButton from '../PlexLoginButton'; const Login: React.FC = () => { return ( -
+
Overseerr diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 63eaedead..1f02ea2f9 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -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 ( - - - - ); + const { Component, pageProps, router } = this.props; + if (router.asPath == '/login') { + return ; + } else { + return ( + + + + ); + } } } diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 5b390e2d6..cb975e43e 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -3,11 +3,7 @@ import { NextPage } from 'next'; import Login from '../components/Login'; const LoginPage: NextPage = () => { - return ( -
- -
- ); + return ; }; export default LoginPage; From 159718891fb363001c650ac8b7e1446a1520ce4a Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Thu, 20 Aug 2020 21:16:44 -0400 Subject: [PATCH 3/6] feat(pass pageprops to loginpage): pass page props to loginPage --- src/pages/_app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 1f02ea2f9..756d65295 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,7 +8,7 @@ class CoreApp extends App { public render(): JSX.Element { const { Component, pageProps, router } = this.props; if (router.asPath == '/login') { - return ; + return ; } else { return ( From 0151134949d112f5f8a18c98c3ff6e3418221041 Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Sat, 22 Aug 2020 19:55:00 -0400 Subject: [PATCH 4/6] refactor(use component on login path conditional): use component on login path conditional --- src/pages/_app.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 756d65295..1763e056f 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -2,13 +2,12 @@ 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, router } = this.props; - if (router.asPath == '/login') { - return ; + if (router.asPath === '/login') { + return ; } else { return ( From f9b174c31148baba2df82573d8a9c7ef7c4448c7 Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Sat, 22 Aug 2020 19:57:08 -0400 Subject: [PATCH 5/6] refactor(login component): remove copyright - to design later --- src/components/Login/index.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/Login/index.tsx b/src/components/Login/index.tsx index c152e0753..22a7a886a 100644 --- a/src/components/Login/index.tsx +++ b/src/components/Login/index.tsx @@ -19,9 +19,6 @@ const Login: React.FC = () => { />
-

- ©2020 Overseerr. All rights reserved. -

); }; From e61d9a767f0fa5ec1e8bda0dc72fba14d1a26964 Mon Sep 17 00:00:00 2001 From: Alexander Zoitos Date: Sat, 22 Aug 2020 21:20:47 -0400 Subject: [PATCH 6/6] refactor(app conditional cleanup): remove unnecessary else statement --- src/pages/_app.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 1763e056f..1c5e578a9 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,13 +8,12 @@ class CoreApp extends App { const { Component, pageProps, router } = this.props; if (router.asPath === '/login') { return ; - } else { - return ( - - - - ); } + return ( + + + + ); } }