Skip to content
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

Merged
merged 19 commits into from
Jun 16, 2021
Merged

Conversation

chris-alexiuk
Copy link
Contributor

What this PR does (required):

Adds styling for the Login/Signup pages as per the 'Sign up' mockup we received.

Screenshots / Videos (required):

image
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!

image
Signup page

loginsignup

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

image

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

@chris-alexiuk chris-alexiuk linked an issue Jun 15, 2021 that may be closed by this pull request
Comment on lines 42 to 48
/*
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:

'''
Copy link

@moffatethan moffatethan Jun 15, 2021

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.

Copy link
Contributor Author

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!

Comment on lines 45 to 46
{/* --Commented out until thew new authHeader is completed
<AuthHeader linkTo="/signup" asideText="Don't have an account?" btnText="Create account" />*/}

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.

Comment on lines 46 to 47
{/* --Commented out until thew new authHeader is completed
<AuthHeader linkTo="/signup" asideText="Don't have an account?" btnText="Create account" />*/}

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

Copy link
Contributor Author

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!

Copy link

@moffatethan moffatethan left a 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.

</Typography>
</Grid>
</Grid>
<LoginForm handleSubmit={handleSubmit} />
</Box>
<Box p={1} alignSelf="center" />
<Box p={1} alignSelf="center" padding="0" />
Copy link
Contributor

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

Copy link
Contributor Author

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',
Copy link
Contributor

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',
Copy link
Contributor

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?

Copy link
Contributor Author

@chris-alexiuk chris-alexiuk Jun 15, 2021

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:

image

@chris-alexiuk
Copy link
Contributor Author

I believe I have made the requested changes, let me know if anything else needs to be done - or if I missed anything!

@chris-alexiuk
Copy link
Contributor Author

chris-alexiuk commented Jun 16, 2021

I have now completed most of the landing page, I believe.

frontpage-test.mp4

Please let me know what I can/should improve!

added development folder to .gitignore to store pictures/videos related to development
@chris-alexiuk chris-alexiuk linked an issue Jun 16, 2021 that may be closed by this pull request
@chris-alexiuk
Copy link
Contributor Author

Realized I should've made the landing page bar a component, and switching it to that!

Comment on lines +17 to +18
/development

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this directory?

Copy link
Contributor Author

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!

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 👍🏻

Comment on lines 2 to 6
import { theme } from '../../themes/theme';

const useStyles = makeStyles(() => ({
sitterLoginSignup: {
position: 'fixed',

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) => ({ . . .}));

Comment on lines 2 to 5
import { theme } from '../../themes/theme';

const useStyles = makeStyles(() => ({
logoBox: {

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.

Comment on lines 10 to 13
<Box className={classes.logoBox}>
<PetsIcon className={classes.logoIcon} />
<Typography className={classes.logoText}>LovingSitter.</Typography>
</Box>

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

Copy link
Contributor Author

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

@@ -36,25 +42,45 @@ export default function Login(): JSX.Element {
});
};

//---CODE FOR ADDING A BUTTON FOR A DEMO USER: DEVELOPMENT ONLY

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.

Copy link
Contributor Author

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!

<Box alignSelf="center">
<Typography variant="button">
Not a member yet?
<span> </span>

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?

Copy link
Contributor Author

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';

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

@@ -37,25 +42,45 @@ export default function Register(): JSX.Element {
});
};

//---CODE FOR ADDING A BUTTON FOR A DEMO USER: DEVELOPMENT ONLY

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.

Comment on lines 4 to 5
const useStyles = makeStyles(() => ({
root: {

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

Copy link

@moffatethan moffatethan left a 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!

@chris-alexiuk chris-alexiuk merged commit 1cfc4b9 into main Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FE: Signup / Login Pages FE: Demo User
3 participants