-
-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login Page (Design/Route) #8
Conversation
src/pages/_app.tsx
Outdated
); | ||
const { Component, pageProps, router } = this.props; | ||
if (router.asPath == '/login') { | ||
return <LoginPage {...pageProps} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return <LoginPage {...pageProps} />; | |
return <Component {...pageProps} />; |
Let's still use Component
here so that we when we have the handle the Search component when we have it in a single if statement. (ex if (router.asPath === '/login' || router.asPath === '/setup')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Makes sense.
src/pages/_app.tsx
Outdated
</Layout> | ||
); | ||
const { Component, pageProps, router } = this.props; | ||
if (router.asPath == '/login') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (router.asPath == '/login') { | |
if (router.asPath === '/login') { |
Strict comparison!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added! Got to used to Java.. Thanks for pointing it out.
src/components/Login/index.tsx
Outdated
<p className="text-center text-gray-500 text-xs"> | ||
©2020 Overseerr. All rights reserved. | ||
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this footer/copyright for now. We can design a better one later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
src/pages/_app.tsx
Outdated
if (router.asPath === '/login') { | ||
return <Component {...pageProps} />; | ||
} else { | ||
return ( | ||
<Layout> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (router.asPath === '/login') { | |
return <Component {...pageProps} />; | |
} else { | |
return ( | |
<Layout> | |
<Component {...pageProps} /> | |
</Layout> | |
); | |
} | |
if (router.asPath === '/login') { | |
return <Component {...pageProps} />; | |
} | |
return ( | |
<Layout> | |
<Component {...pageProps} /> | |
</Layout> | |
); |
This is a nitpick but in this case you don't actually need an else statement. You are returning inside the if block, so if the condition doesn't match, it will just skip the block and return the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just left one more nitpick comment.
Story details: https://app.clubhouse.io/sct-dev/story/41