From 7755b004298689c74d077363eb2d569de112e20d Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:49:14 -0400 Subject: [PATCH 01/17] feat: adding sample list route & page --- src/App.tsx | 11 ++++++++++- src/views/index.ts | 1 + src/views/unauthenticated/SampleList.tsx | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/views/unauthenticated/SampleList.tsx diff --git a/src/App.tsx b/src/App.tsx index 2b4f35f..c603a6d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,14 @@ import React from "react"; import { Routes, Route } from "react-router-dom"; -import { Home, Layout, List, ManageList, PageNotFound } from "./views"; +import { + Home, + Layout, + List, + ManageList, + PageNotFound, + SampleList, +} from "./views"; import { useFindUser, useShoppingListData, useShoppingLists } from "./api"; @@ -74,6 +81,8 @@ export function App() { /> + }> + {/* a catch all route for if someone tries to manually navigate to something not created yet */} } /> diff --git a/src/views/index.ts b/src/views/index.ts index 26ee7f1..d71c05e 100644 --- a/src/views/index.ts +++ b/src/views/index.ts @@ -3,3 +3,4 @@ export * from "./Home"; export * from "./Layout"; export * from "./authenticated/List"; export * from "./unauthenticated/PageNotFound"; +export * from "./unauthenticated/SampleList"; diff --git a/src/views/unauthenticated/SampleList.tsx b/src/views/unauthenticated/SampleList.tsx new file mode 100644 index 0000000..75107ed --- /dev/null +++ b/src/views/unauthenticated/SampleList.tsx @@ -0,0 +1,9 @@ +import React from "react"; + +export function SampleList() { + return ( +
+

A Sample List

+
+ ); +} From 5e4880436b541fe7a4ec61d49b4a4f6710847cb0 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:16:03 -0400 Subject: [PATCH 02/17] mod: change SampleList to about --- src/App.tsx | 11 ++--------- src/views/index.ts | 2 +- src/views/unauthenticated/About.tsx | 22 ++++++++++++++++++++++ src/views/unauthenticated/SampleList.tsx | 9 --------- 4 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 src/views/unauthenticated/About.tsx delete mode 100644 src/views/unauthenticated/SampleList.tsx diff --git a/src/App.tsx b/src/App.tsx index c603a6d..26110de 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,14 +2,7 @@ import React from "react"; import { Routes, Route } from "react-router-dom"; -import { - Home, - Layout, - List, - ManageList, - PageNotFound, - SampleList, -} from "./views"; +import { Home, Layout, List, ManageList, PageNotFound, About } from "./views"; import { useFindUser, useShoppingListData, useShoppingLists } from "./api"; @@ -81,7 +74,7 @@ export function App() { /> - }> + }> {/* a catch all route for if someone tries to manually navigate to something not created yet */} } /> diff --git a/src/views/index.ts b/src/views/index.ts index d71c05e..742b5a2 100644 --- a/src/views/index.ts +++ b/src/views/index.ts @@ -3,4 +3,4 @@ export * from "./Home"; export * from "./Layout"; export * from "./authenticated/List"; export * from "./unauthenticated/PageNotFound"; -export * from "./unauthenticated/SampleList"; +export * from "./unauthenticated/About"; diff --git a/src/views/unauthenticated/About.tsx b/src/views/unauthenticated/About.tsx new file mode 100644 index 0000000..f401dac --- /dev/null +++ b/src/views/unauthenticated/About.tsx @@ -0,0 +1,22 @@ +import React from "react"; + +export function About() { + return ( +
+
+

How it all works

+
+
+

Creators

+
+

+
+
+
+

Thank you to

+

Mentors: Alex, Aditya, Tanner

+

The entire The Collab Lab.

+
+
+ ); +} diff --git a/src/views/unauthenticated/SampleList.tsx b/src/views/unauthenticated/SampleList.tsx deleted file mode 100644 index 75107ed..0000000 --- a/src/views/unauthenticated/SampleList.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; - -export function SampleList() { - return ( -
-

A Sample List

-
- ); -} From 78c37163f04eb4a0e86deb7b31abd81bd72fb038 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:55:40 -0400 Subject: [PATCH 03/17] mod: a text version/skeleton of the about page of the application --- src/views/unauthenticated/About.tsx | 43 +++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/src/views/unauthenticated/About.tsx b/src/views/unauthenticated/About.tsx index f401dac..478fa37 100644 --- a/src/views/unauthenticated/About.tsx +++ b/src/views/unauthenticated/About.tsx @@ -3,17 +3,54 @@ import React from "react"; export function About() { return (
+

ABOUT APPLICATION NAME

-

How it all works

+

How works

+
    +
  • + Create a list for different stores or different grouping of items. +
  • +
  • Select a list that you'd like to add items on.
  • +
  • + Open the list manager, to start adding items and choosing when you + will need to restock next. +
  • +
  • + Now that your new list has items you can start checking off items as + you shop! +
      +
    • + Each time an item is marked purchase the application evaluates + your shopping habits! Supporting you by adjusting your next + purchase predictions base on when your previous shopping + history! +
    • +
    +
  • +
  • + If someone else needs to be let into to the shopping time you can + easily share specific lists with with in the list manager so they + can see and mark items as purchased too! +
  • +

Creators

-

+

Maha Ahmed

+
+
+

Brianna Bland

+
+
+

Falak Zahra

+
+
+

Ross Clettenberg

-

Thank you to

+

Thank you

Mentors: Alex, Aditya, Tanner

The entire The Collab Lab.

From df82471cc3e3b5d823791955fca8c7ae0963c9b2 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Wed, 25 Sep 2024 01:00:16 -0400 Subject: [PATCH 04/17] feat: added an unauthenticated home context with way to navigate to about page with button --- src/views/Home.tsx | 45 ++++++++++--------- src/views/Layout.tsx | 14 ++++-- src/views/index.ts | 1 + src/views/unauthenticated/NewUserHomeInfo.tsx | 33 ++++++++++++++ 4 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 src/views/unauthenticated/NewUserHomeInfo.tsx diff --git a/src/views/Home.tsx b/src/views/Home.tsx index 4c46603..64de0fa 100644 --- a/src/views/Home.tsx +++ b/src/views/Home.tsx @@ -1,7 +1,8 @@ import React from "react"; import "./Home.css"; import { SingleList, CreateList } from "../components"; -import { List, User } from "../api/firebase"; +import { List, User } from "../api"; +import { NewUserHomeInfo } from "../views"; interface Props { data: List[]; @@ -10,26 +11,28 @@ interface Props { } export function Home({ data, setListPath, user }: Props) { + if (!user) { + return ; + } + return ( - <> -
-

- Hello from the home (/) page! -

- {user && ( -
    - {data.map((list, index) => ( - - ))} - -
- )} -
- +
+

+ Hello from the home (/) page! +

+ {user && ( +
    + {data.map((list, index) => ( + + ))} + +
+ )} +
); } diff --git a/src/views/Layout.tsx b/src/views/Layout.tsx index 0a65806..fbb37fa 100644 --- a/src/views/Layout.tsx +++ b/src/views/Layout.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { Outlet } from "react-router-dom"; -import { SignInButton, User } from "../api"; +import { Outlet, useNavigate } from "react-router-dom"; +import { User } from "../api"; import { AuthenticatedNavBar } from "../components"; import "./Layout.css"; @@ -10,6 +10,7 @@ interface Props { } export function Layout({ user }: Props) { + const navigate = useNavigate(); return ( <>
@@ -17,8 +18,15 @@ export function Layout({ user }: Props) {

Smart shopping list

+ {user && ( + + )} - {!user && }
{user && }
diff --git a/src/views/index.ts b/src/views/index.ts index 742b5a2..c25508b 100644 --- a/src/views/index.ts +++ b/src/views/index.ts @@ -4,3 +4,4 @@ export * from "./Layout"; export * from "./authenticated/List"; export * from "./unauthenticated/PageNotFound"; export * from "./unauthenticated/About"; +export * from "./unauthenticated/NewUserHomeInfo"; diff --git a/src/views/unauthenticated/NewUserHomeInfo.tsx b/src/views/unauthenticated/NewUserHomeInfo.tsx new file mode 100644 index 0000000..02640ed --- /dev/null +++ b/src/views/unauthenticated/NewUserHomeInfo.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { useNavigate } from "react-router-dom"; +import { SignInButton } from "../../api"; + +export function NewUserHomeInfo() { + const navigate = useNavigate(); + + return ( + <> +

Welcome to APPLICATION NAME

+

+ The next best thing to having someone else do the shopping for you! + Create and manage smart lists learn your habits to let you know exactly + when you will need t +

+ +
+

New to APPLICATION NAME?

+ +
+ +
+

Welcome Back:

+ +
+ + ); +} From a6baa085d6b1314d73a6faac8bc33d3b121757e4 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Wed, 25 Sep 2024 01:31:32 -0400 Subject: [PATCH 05/17] feat: added unauthenticated nav bar for another option on getting to about page --- src/components/AuthenticatedNavBar.tsx | 2 +- .../{AuthenticatedNavBar.css => NavBar.css} | 0 src/components/index.ts | 1 + .../unauthenticated/UnauthenticatedNavBar.tsx | 19 +++++++++++++++++++ src/views/Layout.tsx | 4 ++-- 5 files changed, 23 insertions(+), 3 deletions(-) rename src/components/{AuthenticatedNavBar.css => NavBar.css} (100%) create mode 100644 src/components/unauthenticated/UnauthenticatedNavBar.tsx diff --git a/src/components/AuthenticatedNavBar.tsx b/src/components/AuthenticatedNavBar.tsx index 6441ee5..4ddb657 100644 --- a/src/components/AuthenticatedNavBar.tsx +++ b/src/components/AuthenticatedNavBar.tsx @@ -2,7 +2,7 @@ import React from "react"; import { NavLink } from "react-router-dom"; import { SignOutButton } from "../api"; -import "./AuthenticatedNavBar.css"; +import "./NavBar.css"; export function AuthenticatedNavBar() { return ( diff --git a/src/components/AuthenticatedNavBar.css b/src/components/NavBar.css similarity index 100% rename from src/components/AuthenticatedNavBar.css rename to src/components/NavBar.css diff --git a/src/components/index.ts b/src/components/index.ts index 50121f3..5c38caf 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -4,3 +4,4 @@ export * from "./CreateList"; export * from "./ProtectedRoute"; export * from "./AuthenticatedNavBar"; export * from "./forms/ShareListForm"; +export * from "./unauthenticated/UnauthenticatedNavBar"; diff --git a/src/components/unauthenticated/UnauthenticatedNavBar.tsx b/src/components/unauthenticated/UnauthenticatedNavBar.tsx new file mode 100644 index 0000000..a7dcdad --- /dev/null +++ b/src/components/unauthenticated/UnauthenticatedNavBar.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { NavLink } from "react-router-dom"; + +import "../NavBar.css"; + +export function UnauthenticatedNavBar() { + return ( + + ); +} diff --git a/src/views/Layout.tsx b/src/views/Layout.tsx index fbb37fa..63bc91d 100644 --- a/src/views/Layout.tsx +++ b/src/views/Layout.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Outlet, useNavigate } from "react-router-dom"; import { User } from "../api"; -import { AuthenticatedNavBar } from "../components"; +import { AuthenticatedNavBar, UnauthenticatedNavBar } from "../components"; import "./Layout.css"; @@ -28,7 +28,7 @@ export function Layout({ user }: Props) { )} - {user && } + {user ? : }
); From 0c86ba2781803a003ce41ca30c4a2cc6506db2a6 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:26:46 -0400 Subject: [PATCH 06/17] feat: added links for app creators --- src/views/unauthenticated/About.tsx | 102 +++++++++++++++++- src/views/unauthenticated/NewUserHomeInfo.tsx | 4 +- 2 files changed, 103 insertions(+), 3 deletions(-) diff --git a/src/views/unauthenticated/About.tsx b/src/views/unauthenticated/About.tsx index 478fa37..d2a8d54 100644 --- a/src/views/unauthenticated/About.tsx +++ b/src/views/unauthenticated/About.tsx @@ -1,9 +1,10 @@ import React from "react"; +import { Link } from "react-router-dom"; export function About() { return (
-

ABOUT APPLICATION NAME

+

ABOUT Smart shopping list

How works

    @@ -38,15 +39,114 @@ export function About() {

    Creators

    Maha Ahmed

    + + + + + + + + + +

    Brianna Bland

    + + + + + + + + + +

    Falak Zahra

    + + + + + + + + + +

    Ross Clettenberg

    + + + + + + + + + +
diff --git a/src/views/unauthenticated/NewUserHomeInfo.tsx b/src/views/unauthenticated/NewUserHomeInfo.tsx index 02640ed..bcaae36 100644 --- a/src/views/unauthenticated/NewUserHomeInfo.tsx +++ b/src/views/unauthenticated/NewUserHomeInfo.tsx @@ -7,7 +7,7 @@ export function NewUserHomeInfo() { return ( <> -

Welcome to APPLICATION NAME

+

Welcome to Smart shopping list

The next best thing to having someone else do the shopping for you! Create and manage smart lists learn your habits to let you know exactly @@ -15,7 +15,7 @@ export function NewUserHomeInfo() {

-

New to APPLICATION NAME?

+

New to Smart shopping list?

Thank you

-

Mentors: Alex, Aditya, Tanner

+

Mentors:

+

Alex

+

Aditya

+

Tanner

The entire The Collab Lab.

diff --git a/vite.config.js b/vite.config.js index fe66119..cffdeab 100644 --- a/vite.config.js +++ b/vite.config.js @@ -59,7 +59,10 @@ export default defineConfig(({ mode }) => ({ plugins: [ mode === "development" && eslint(), react(), - svgr({ exportAsDefault: true }), + svgr({ + exportAsDefault: true, + dimensions: false, + }), VitePWA(PWAConfig), ], server: { open: true, port: 3000 }, From 73b1caf54b6fa85bbe90164d5aba887b570a5311 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:39:53 -0400 Subject: [PATCH 10/17] feat: making it so the sign in button can change the value in the label based on if needs to sign up or in --- src/api/useAuth.tsx | 23 ++++++++++++------- src/views/unauthenticated/About.tsx | 2 ++ .../unauthenticated/UnauthenticatedHome.tsx | 3 ++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/api/useAuth.tsx b/src/api/useAuth.tsx index c15426e..ca58087 100644 --- a/src/api/useAuth.tsx +++ b/src/api/useAuth.tsx @@ -9,14 +9,21 @@ import toast from "react-hot-toast"; * the button redirects the user to the Google OAuth sign-in page. * After the user signs in, they are redirected back to the app. */ -export const SignInButton = () => ( - -); + +type SignInButtonProps = { + isSignIn?: boolean; +}; + +export const SignInButton = ({ isSignIn = true }: SignInButtonProps) => { + return ( + + ); +}; /** * A button that signs the user out of the app using Firebase Auth. diff --git a/src/views/unauthenticated/About.tsx b/src/views/unauthenticated/About.tsx index a7e789e..8279ec4 100644 --- a/src/views/unauthenticated/About.tsx +++ b/src/views/unauthenticated/About.tsx @@ -2,12 +2,14 @@ import React from "react"; import { Link } from "react-router-dom"; import LinkedInLogo from "../../icons/LinkedInLogo.svg?react"; import GithubLogo from "../../icons/GithubLogo.svg?react"; +import { SignInButton } from "../../api"; export function About() { return (

How it works

+
  • Create a list for different stores or different grouping of items. diff --git a/src/views/unauthenticated/UnauthenticatedHome.tsx b/src/views/unauthenticated/UnauthenticatedHome.tsx index 3f220e4..8b1d973 100644 --- a/src/views/unauthenticated/UnauthenticatedHome.tsx +++ b/src/views/unauthenticated/UnauthenticatedHome.tsx @@ -16,13 +16,14 @@ export function UnauthenticatedHome() {

    -

    New to Smart shopping list?

    +

    New to GrocerEase:

    +
    From d9bad0e63c176727bd1842261f919390c3847b50 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:55:14 -0400 Subject: [PATCH 11/17] feat: added links to mentors and added link to the collab lab --- src/views/unauthenticated/About.tsx | 62 +++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/src/views/unauthenticated/About.tsx b/src/views/unauthenticated/About.tsx index 8279ec4..8e6e442 100644 --- a/src/views/unauthenticated/About.tsx +++ b/src/views/unauthenticated/About.tsx @@ -41,52 +41,82 @@ export function About() {

    Creators

    -

    Maha Ahmed

    + Maha Ahmed - + - +
    -

    Brianna Bland

    + Brianna Bland - + - +
    -

    Falak Zahra

    + Falak Zahra - + - +
    -

    Ross Clettenberg

    + Ross Clettenberg - + - +

    Thank you

    Mentors:

    -

    Alex

    -

    Aditya

    -

    Tanner

    -

    The entire The Collab Lab.

    +
    + Alex D. + + + + + + +
    +
    + Aditya Dalal + + + + + + +
    +
    + Tanner Gill + + + + + + +
    +

    + The entire{" "} + + The Collab Lab + + . +

); From 6acdbf43ee867606b6d13e17ff9c6856d506ff2c Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:23:25 -0400 Subject: [PATCH 12/17] fix: removed bullet point from the create list form label --- src/components/CreateList.tsx | 34 +++++++++---------- src/views/authenticated/AuthenticatedHome.tsx | 22 ++++++------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/CreateList.tsx b/src/components/CreateList.tsx index 6ff970e..07c5f9e 100644 --- a/src/components/CreateList.tsx +++ b/src/components/CreateList.tsx @@ -43,24 +43,22 @@ export function CreateList({ user, setListPath }: Props) { return ( <> -
  • -
    -

    Create New Shopping List

    - -
    - -
    - -
    -
  • +
    +

    Create New Shopping List

    + +
    + +
    + +
    ); } diff --git a/src/views/authenticated/AuthenticatedHome.tsx b/src/views/authenticated/AuthenticatedHome.tsx index da3991e..767abad 100644 --- a/src/views/authenticated/AuthenticatedHome.tsx +++ b/src/views/authenticated/AuthenticatedHome.tsx @@ -15,17 +15,19 @@ export function AuthenticatedHome({ data, setListPath, user }: Props) { Hello from the home (/) page!

    {user && ( - + )} ); From 34ca5e1cee0337e98c170d49961dc822c1526699 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:42:27 -0400 Subject: [PATCH 13/17] fix: fixing some buttons and styling issues weird messed up in resolving merge conflicts --- src/api/useAuth.tsx | 2 ++ src/components/CreateList.tsx | 16 ++++++++-------- src/views/Layout.tsx | 5 +++-- .../unauthenticated/UnauthenticatedHome.tsx | 6 ++++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/api/useAuth.tsx b/src/api/useAuth.tsx index 961c4cc..75332f9 100644 --- a/src/api/useAuth.tsx +++ b/src/api/useAuth.tsx @@ -20,6 +20,7 @@ export const SignInButton = ({ isSignIn = true }: SignInButtonProps) => { @@ -39,6 +40,7 @@ export const SignOutButton = () => { toast.error("An error occurred while signing out. Please try again."); }); }} + className="m-2" > Sign Out diff --git a/src/components/CreateList.tsx b/src/components/CreateList.tsx index ae08f7e..27d641b 100644 --- a/src/components/CreateList.tsx +++ b/src/components/CreateList.tsx @@ -46,12 +46,12 @@ export function CreateList({ user, setListPath }: Props) { return ( <> -
  • -
    -

    Create New Shopping List

    - + +

    Create New Shopping List

    + Name Your List +
    -
    - - -
  • + + + ); } diff --git a/src/views/Layout.tsx b/src/views/Layout.tsx index b873753..30b647d 100644 --- a/src/views/Layout.tsx +++ b/src/views/Layout.tsx @@ -2,6 +2,7 @@ import React from "react"; import { Outlet, useNavigate } from "react-router-dom"; import { User } from "../api"; import { AuthenticatedNavBar, UnauthenticatedNavBar } from "../components"; +import Button from "react-bootstrap/Button"; import "./Layout.css"; @@ -19,12 +20,12 @@ export function Layout({ user }: Props) {
    {user && ( - + )}
    diff --git a/src/views/unauthenticated/UnauthenticatedHome.tsx b/src/views/unauthenticated/UnauthenticatedHome.tsx index 8b1d973..b23874c 100644 --- a/src/views/unauthenticated/UnauthenticatedHome.tsx +++ b/src/views/unauthenticated/UnauthenticatedHome.tsx @@ -1,6 +1,7 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import { SignInButton } from "../../api"; +import Button from "react-bootstrap/Button"; export function UnauthenticatedHome() { const navigate = useNavigate(); @@ -17,12 +18,13 @@ export function UnauthenticatedHome() {

    New to GrocerEase:

    - +
    From 859926a6262ea0bb30900ba4aed0ecde2f97370d Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:48:02 -0400 Subject: [PATCH 14/17] fix: fixing the new UnauthenticatedNavBar to use the correct bootstrap comp since didn't get them in conflict resolve --- .../unauthenticated/UnauthenticatedNavBar.tsx | 24 ++++++++++++------- src/views/Layout.tsx | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/unauthenticated/UnauthenticatedNavBar.tsx b/src/components/unauthenticated/UnauthenticatedNavBar.tsx index a7dcdad..056ea79 100644 --- a/src/components/unauthenticated/UnauthenticatedNavBar.tsx +++ b/src/components/unauthenticated/UnauthenticatedNavBar.tsx @@ -1,19 +1,27 @@ import React from "react"; import { NavLink } from "react-router-dom"; +import Navbar from "react-bootstrap/Navbar"; +import Container from "react-bootstrap/Container"; +import Nav from "react-bootstrap/Nav"; import "../NavBar.css"; export function UnauthenticatedNavBar() { return ( - + + + ); } diff --git a/src/views/Layout.tsx b/src/views/Layout.tsx index 30b647d..d90f136 100644 --- a/src/views/Layout.tsx +++ b/src/views/Layout.tsx @@ -14,7 +14,7 @@ export function Layout({ user }: Props) { const navigate = useNavigate(); return ( <> -
    +

    Smart shopping list

    @@ -23,6 +23,7 @@ export function Layout({ user }: Props) { From 810abab14f507c9fd5254d9eee0d51b32b794271 Mon Sep 17 00:00:00 2001 From: bbland1 <104288486+bbland1@users.noreply.github.com> Date: Sun, 29 Sep 2024 03:31:03 -0400 Subject: [PATCH 15/17] fix: if signing up or out from about page properly redirects to home page since it is not a protected route it was just staying on about --- src/api/useAuth.tsx | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/api/useAuth.tsx b/src/api/useAuth.tsx index 75332f9..172b4bb 100644 --- a/src/api/useAuth.tsx +++ b/src/api/useAuth.tsx @@ -4,6 +4,7 @@ import { GoogleAuthProvider, signInWithPopup } from "firebase/auth"; import { addUserToDatabase, User } from "./firebase"; import toast from "react-hot-toast"; import Button from "react-bootstrap/Button"; +import { useLocation, useNavigate } from "react-router-dom"; /** * A button that signs the user in using Google OAuth. When clicked, @@ -16,10 +17,26 @@ type SignInButtonProps = { }; export const SignInButton = ({ isSignIn = true }: SignInButtonProps) => { + const location = useLocation(); + const navigate = useNavigate(); + return (