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

A way for an new user to understand how the app functions #41

Merged
merged 18 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7755b00
feat: adding sample list route & page
bbland1 Sep 24, 2024
5e48804
mod: change SampleList to about
bbland1 Sep 25, 2024
78c3716
mod: a text version/skeleton of the about page of the application
bbland1 Sep 25, 2024
df82471
feat: added an unauthenticated home context with way to navigate to a…
bbland1 Sep 25, 2024
a6baa08
feat: added unauthenticated nav bar for another option on getting to …
bbland1 Sep 25, 2024
0c86ba2
feat: added links for app creators
bbland1 Sep 25, 2024
d664c2f
fix: fixed a few typos and add name to the place holder
bbland1 Sep 29, 2024
439089b
feat: created Authenticated/Unauthenticated home components
bbland1 Sep 29, 2024
7b5fd84
feat: update vite config to utilize the svgr plugin for the svg logo …
bbland1 Sep 29, 2024
73b1caf
feat: making it so the sign in button can change the value in the lab…
bbland1 Sep 29, 2024
d9bad0e
feat: added links to mentors and added link to the collab lab
bbland1 Sep 29, 2024
6acdbf4
fix: removed bullet point from the create list form label
bbland1 Sep 29, 2024
0406e98
Merge branch 'main' into bb/app-func-new-user
bbland1 Sep 29, 2024
34ca5e1
fix: fixing some buttons and styling issues weird messed up in resolv…
bbland1 Sep 29, 2024
859926a
fix: fixing the new UnauthenticatedNavBar to use the correct bootstra…
bbland1 Sep 29, 2024
810abab
fix: if signing up or out from about page properly redirects to home …
bbland1 Sep 29, 2024
8dd46ea
mod: added name to layout
bbland1 Sep 29, 2024
33ffcf1
fix: scroll bars on bottom of all pages because the page wasn't exten…
bbland1 Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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, About } from "./views";

import { useFindUser, useShoppingListData, useShoppingLists } from "./api";

Expand Down Expand Up @@ -74,6 +74,8 @@ export function App() {
/>
</Route>

<Route path="/about" element={<About />}></Route>

{/* a catch all route for if someone tries to manually navigate to something not created yet */}
<Route path="*" element={<PageNotFound />} />
</Route>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AuthenticatedNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from "./CreateList";
export * from "./ProtectedRoute";
export * from "./AuthenticatedNavBar";
export * from "./forms/ShareListForm";
export * from "./unauthenticated/UnauthenticatedNavBar";
19 changes: 19 additions & 0 deletions src/components/unauthenticated/UnauthenticatedNavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { NavLink } from "react-router-dom";

import "../NavBar.css";

export function UnauthenticatedNavBar() {
return (
<nav className="Nav">
<div className="Nav-container">
<NavLink to="/" className="Nav-link" aria-label="Home">
Home
</NavLink>
<NavLink to="/about" className="Nav-link" aria-label="About">
About
</NavLink>
</div>
</nav>
);
}
45 changes: 24 additions & 21 deletions src/views/Home.tsx
Original file line number Diff line number Diff line change
@@ -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[];
Expand All @@ -10,26 +11,28 @@ interface Props {
}

export function Home({ data, setListPath, user }: Props) {
if (!user) {
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
return <NewUserHomeInfo />;
}

return (
<>
<div className="Home">
<p>
Hello from the home (<code>/</code>) page!
</p>
{user && (
<ul>
{data.map((list, index) => (
<SingleList
key={index}
name={list.name}
path={list.path}
setListPath={setListPath}
/>
))}
<CreateList user={user} setListPath={setListPath} />
</ul>
)}
</div>
</>
<div className="Home">
<p>
Hello from the home (<code>/</code>) page!
</p>
{user && (
<ul>
{data.map((list, index) => (
<SingleList
key={index}
name={list.name}
path={list.path}
setListPath={setListPath}
/>
))}
<CreateList user={user} setListPath={setListPath} />
</ul>
)}
</div>
);
}
18 changes: 13 additions & 5 deletions src/views/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Outlet } from "react-router-dom";
import { SignInButton, User } from "../api";
import { AuthenticatedNavBar } from "../components";
import { Outlet, useNavigate } from "react-router-dom";
import { User } from "../api";
import { AuthenticatedNavBar, UnauthenticatedNavBar } from "../components";

import "./Layout.css";

Expand All @@ -10,17 +10,25 @@ interface Props {
}

export function Layout({ user }: Props) {
const navigate = useNavigate();
return (
<>
<div className="Layout">
<header className="Layout-header">
<h1>Smart shopping list</h1>
</header>
<main className="Layout-main">
{user && (
<button
onClick={() => navigate("/about")}
aria-label="Navigate to the about application page."
>
about
</button>
)}
<Outlet />
{!user && <SignInButton />}
</main>
{user && <AuthenticatedNavBar />}
{user ? <AuthenticatedNavBar /> : <UnauthenticatedNavBar />}
</div>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export * from "./Home";
export * from "./Layout";
export * from "./authenticated/List";
export * from "./unauthenticated/PageNotFound";
export * from "./unauthenticated/About";
export * from "./unauthenticated/NewUserHomeInfo";
59 changes: 59 additions & 0 deletions src/views/unauthenticated/About.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";

export function About() {
return (
<div>
<h1>ABOUT APPLICATION NAME</h1>
<section>
<h2>How works</h2>
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
<ul>
<li>
Create a list for different stores or different grouping of items.
</li>
<li>Select a list that you&apos;d like to add items on.</li>
<li>
Open the list manager, to start adding items and choosing when you
will need to restock next.
</li>
<li>
Now that your new list has items you can start checking off items as
you shop!
<ul>
<li>
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!
</li>
</ul>
</li>
<li>
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!
</li>
</ul>
</section>
<section>
<h2>Creators</h2>
<div>
<p>Maha Ahmed</p>
</div>
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
<div>
<p>Brianna Bland</p>
</div>
<div>
<p>Falak Zahra</p>
</div>
<div>
<p>Ross Clettenberg</p>
</div>
</section>
<section>
<h2>Thank you</h2>
<p>Mentors: Alex, Aditya, Tanner</p>
<p>The entire The Collab Lab.</p>
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
</section>
</div>
);
}
33 changes: 33 additions & 0 deletions src/views/unauthenticated/NewUserHomeInfo.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<h1>Welcome to APPLICATION NAME</h1>
<p>
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
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
</p>

<article>
<p>New to APPLICATION NAME?</p>
<button
onClick={() => navigate("/about")}
aria-label="Navigate to the about application page."
>
Learn More
</button>
</article>

<article>
<p>Welcome Back:</p>
bbland1 marked this conversation as resolved.
Show resolved Hide resolved
<SignInButton />
</article>
</>
);
}