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

Protect routes and create welcome page #39

Merged
merged 4 commits into from
Oct 6, 2024

Conversation

joriordan332
Copy link
Collaborator

Description

A welcome/login page has been created which is the only page the user will be able to access on the app until they log in. Once they log in they are automatically navigated to the home page and if they log out they are navigated to the login page again.

Related Issue

Closes #35

Acceptance Criteria

  • Protect the home and list routes by show a welcoming page with the sign in button if the user isn't signed in.
  • Create the welcoming page following the figma design.

Type of Changes

Enhancement

Updates

After

image

Testing Steps / QA Criteria

  • Do a git pull and git checkout jo-home-page
  • If you are signed in then sign out and you will automatically navigate to the login page
  • In the url once signed out try putting a /list at the end of the localhost to try and see it will allow you to access this page or any of the other two

Copy link

github-actions bot commented Oct 4, 2024

Visit the preview URL for this PR (updated for commit 60ffafc):

https://tcl-79-smart-shopping-list--pr39-jo-home-page-fmbjs5iu.web.app

(expires Sun, 13 Oct 2024 11:59:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: d91d9ddbda780208241c52942f544acf8e81407a

Copy link
Collaborator

@marshjaja marshjaja left a comment

Choose a reason for hiding this comment

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

Hey well done! 🚀 I have just added some change it think would make the design pop more.
I have include the two logo's we set on, as we'll have a light and dark theme(there might be some slight changes to the Tailwind classes to accompany that later). But we can see how that works when all our code is merged.

A side note I had yesterday is that I am using icons for the Sign in and Sign out so that means on the login screen it will display an icon instead of the text Sign In we should add a check if the <SignInButton isLoginScreen={true} /> then display text and otherwise it will be the icon, that might be another small issue.

public/grocerease.png Outdated Show resolved Hide resolved
src/views/Login.jsx Show resolved Hide resolved
Copy link
Collaborator

@Hudamabkhoot Hudamabkhoot left a comment

Choose a reason for hiding this comment

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

Great work on this! 👏 Just a small thing currently when i refresh the page the login page flashes for a bit before it redirects me to home page because the user is null before it gets the data from fireabse saving the user in local storage in useAuth when getting the user then clearing local storage when the user logs out would fix that

src/utils/ProtectedRoutes.jsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@marshjaja marshjaja left a comment

Choose a reason for hiding this comment

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

Thank you looks great! nice job!

Copy link
Collaborator

@Hudamabkhoot Hudamabkhoot left a comment

Choose a reason for hiding this comment

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

Well done! 👏

@marshjaja marshjaja merged commit 90db9c3 into feat/setup-tailwind-shadcn Oct 6, 2024
2 checks passed
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.

3 participants