-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature signup login frontend #42
Conversation
/* | ||
This code will automatically cause a redirect to the login page if | ||
I attempt to navigate to the "/signup" route | ||
|
||
Commenting out this functionality until it is implemented: | ||
|
||
''' |
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.
Pushing up commented code to main is not a good practice. This sign up functionality actually still works, the issue lies with the <Link />
tag. We are using Material-UIs link tag, this is good for anchor tags however, anchor tags refresh the page which triggers the auth context to redo it's logic causing the issue.
To fix this, on the login page where it says "Register" make sure you utilize react-router-dom's Link component.
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.
Thank you!
I have switched to the 'react-router-dom' Link and it works like a charm. That information is invaluable - thank you!
client/src/pages/Login/Login.tsx
Outdated
{/* --Commented out until thew new authHeader is completed | ||
<AuthHeader linkTo="/signup" asideText="Don't have an account?" btnText="Create account" />*/} |
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 this is related to the routing issue, same applies here. Just make sure the AuthHeader
is using the react-router-dom Link component.
client/src/pages/SignUp/SignUp.tsx
Outdated
{/* --Commented out until thew new authHeader is completed | ||
<AuthHeader linkTo="/signup" asideText="Don't have an account?" btnText="Create account" />*/} |
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.
Same here with regards to react-router-dom Link
component
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.
I have un-commented all code, as requested!
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.
Hey Chris! This is looking good. Left you some comments to address as for the layout, it's coming together.
client/src/pages/Login/Login.tsx
Outdated
</Typography> | ||
</Grid> | ||
</Grid> | ||
<LoginForm handleSubmit={handleSubmit} /> | ||
</Box> | ||
<Box p={1} alignSelf="center" /> | ||
<Box p={1} alignSelf="center" padding="0" /> |
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.
what is this Box doing, is it just for added space? if so - i'd remove this and utilizing styling from sibling components to create this space
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.
Hello!
The box was there from the original code, I have removed it from Login.tsx, as well as Signup.tsx!
padding: 10, | ||
width: 160, | ||
height: 56, | ||
borderRadius: theme.shape.borderRadius, | ||
marginTop: 49, | ||
fontSize: 16, | ||
backgroundColor: '#3a8dff', | ||
backgroundColor: '#primary', |
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.
what is #primary color here? is this a valid color? did you mean to use the theme's primary colour?
width: 160, | ||
height: 56, | ||
borderRadius: theme.shape.borderRadius, | ||
marginTop: 49, | ||
fontSize: 16, | ||
backgroundColor: '#3a8dff', | ||
backgroundColor: 'primary', |
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.
is this actually changing to the string primary? what is primary colour?
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.
As with :
"what is #primary color here? is this a valid color? did you mean to use the theme's primary colour?
Originally posted by @bonnieli in #42 (comment)"
I have fixed both of the references to our primary colour:
I believe I have made the requested changes, let me know if anything else needs to be done - or if I missed anything! |
I have now completed most of the landing page, I believe. frontpage-test.mp4Please let me know what I can/should improve! |
added development folder to .gitignore to store pictures/videos related to development
Realized I should've made the landing page bar a component, and switching it to that! |
/development | ||
|
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.
What's this directory?
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.
This is just where I'm placing things like screenshots/screencaps to post here to git, I can make it public if you want!
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.
No need, just was curious what the folder was. Fine with me 👍🏻
import { theme } from '../../themes/theme'; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
sitterLoginSignup: { | ||
position: 'fixed', |
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.
MUI will actually pass the theme
as an argument, I would utilize it there as opposed to importing the theme.
Example: makeStyles((theme: Theme) => ({ . . .}));
import { theme } from '../../themes/theme'; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
logoBox: { |
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.
As mentioned above, MUI will pass the theme as an argument.
client/src/components/Logo/Logo.tsx
Outdated
<Box className={classes.logoBox}> | ||
<PetsIcon className={classes.logoIcon} /> | ||
<Typography className={classes.logoText}>LovingSitter.</Typography> | ||
</Box> |
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.
We might not even need to do a Box and styles here. Refer to Grid
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.
I have swapped this to Grid, and refactored some of the other styling to make it fit
client/src/pages/Login/Login.tsx
Outdated
@@ -36,25 +42,45 @@ export default function Login(): JSX.Element { | |||
}); | |||
}; | |||
|
|||
//---CODE FOR ADDING A BUTTON FOR A DEMO USER: DEVELOPMENT ONLY |
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.
This comment isn't really necessary, if the code explains itself in this case it does. It's pretty clear to another developer what "handleDemoUser" means. For future, only add comments where further explanation and context is needed.
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.
I have removed the comment!
client/src/pages/Login/Login.tsx
Outdated
<Box alignSelf="center"> | ||
<Typography variant="button"> | ||
Not a member yet? | ||
<span> </span> |
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.
Is this here to separate the text and the link? Could this be refactor to be a bit more cleaner?
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.
I've modified this to use inline CSS to add a margin to the text
@@ -1,33 +1,34 @@ | |||
import { makeStyles } from '@material-ui/core/styles'; | |||
import { SignalWifi1BarLockSharp } from '@material-ui/icons'; |
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.
This isn't being used here
client/src/pages/SignUp/SignUp.tsx
Outdated
@@ -37,25 +42,45 @@ export default function Register(): JSX.Element { | |||
}); | |||
}; | |||
|
|||
//---CODE FOR ADDING A BUTTON FOR A DEMO USER: DEVELOPMENT ONLY |
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.
As mentioned before, this comment isn't necessary.
client/src/pages/SignUp/useStyles.ts
Outdated
const useStyles = makeStyles(() => ({ | ||
root: { |
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.
Theme is passed as argument here as well
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.
I'm going to approve this and left you some cleanup comments to address. After that this should be good to go. Good work on this!
What this PR does (required):
Adds styling for the Login/Signup pages as per the 'Sign up' mockup we received.
Screenshots / Videos (required):
Login page, I've cropped the remaining right hand side of the screen, as it is currently empty - the same is true of the screenshot of the Signup page. Let me know if I should've instead included the entire webpage!
Signup page
Any information needed to test this feature (required):
N/A
Any issues with the current functionality (optional):
Not exactly a problem, but: The mockup indicated that the login/signup page should be in a card centered in the middle of the screen. However, our login/signup pages will eventually be cast into the left container on the homepage
So, I've let the card fill the entire left-side container and style relative to the card (I believe I did that, anyway)
I also did change /client/themes/theme.ts, which may impact others' styling if they were referencing the 'primary' variable at all. However, it was discussed in Slack - and I believe this is better suited to our primary colour since it's the primary colour in the mockups!
Thanks for bearing with me, this is my first 'official' PR on git! :D