building out more text content, site structure

This commit is contained in:
Mikayla Dobson
2022-10-08 16:03:46 -05:00
parent bbb2973a12
commit ebb1dc842c
6 changed files with 87 additions and 4 deletions

View File

@@ -13,6 +13,8 @@ import UserProfile from './components/User/UserProfile'
import UserSettings from './components/User/UserSettings' import UserSettings from './components/User/UserSettings'
import OrderHistory from './components/Order/OrderHistory' import OrderHistory from './components/Order/OrderHistory'
import OrderRecord from './components/Order/OrderRecord' import OrderRecord from './components/Order/OrderRecord'
import Philosophy from './components/Content/Philosophy'
import Contact from './components/Content/Contact'
// util // util
import { SupabaseProvider, useSupabase } from './supabase/SupabaseContext' import { SupabaseProvider, useSupabase } from './supabase/SupabaseContext'
@@ -51,6 +53,10 @@ export default function App() {
{/* Order data */} {/* Order data */}
<Route path="/orders" element={<OrderHistory />} /> <Route path="/orders" element={<OrderHistory />} />
<Route path="/orders/:orderId" element={<OrderRecord />} /> <Route path="/orders/:orderId" element={<OrderRecord />} />
{/* Misc content pages */}
<Route path="/philosophy" element={<Philosophy />} />
<Route path="/contact" element={<Contact />} />
</Routes> </Routes>
</div> </div>
</BrowserRouter> </BrowserRouter>

View File

@@ -1,6 +1,8 @@
import { useSupabase } from "../../supabase/SupabaseContext";
import { FormInput, getSession, handleLogin, handleRegister } from "../../util/authHelpers"; import { FormInput, getSession, handleLogin, handleRegister } from "../../util/authHelpers";
import { useSupabase } from "../../supabase/SupabaseContext";
import { AuthFormType } from "../../util/types"; import { AuthFormType } from "../../util/types";
import { loginHTML, registerHTML } from "./authExtraText";
import { useState } from "react"; import { useState } from "react";
import Button from "../_ui/Button/Button"; import Button from "../_ui/Button/Button";
import Page from "../_ui/Page/Page"; import Page from "../_ui/Page/Page";
@@ -10,12 +12,14 @@ const AuthForm: AuthFormType = ({ format }) => {
const supabase = useSupabase(); const supabase = useSupabase();
const formText = format == "login" ? "Login" : "Register"; const formText = format == "login" ? "Login" : "Register";
const formFunction = format == "login" ? () => handleLogin(supabase, input) : () => handleRegister(supabase, input); const formFunction = format == "login" ? () => handleLogin(supabase, input) : () => handleRegister(supabase, input);
const formHTML = format == "login" ? loginHTML : registerHTML;
return ( return (
<Page> <Page>
<h1>{formText}</h1> <h1>{formText}</h1>
{formHTML}
<form> <form className="auth-form">
<div className="form-row"> <div className="form-row">
<label htmlFor="auth-form-email">Email:</label> <label htmlFor="auth-form-email">Email:</label>
<input id="auth-form-email" required type="text" onChange={(e) => setInput({...input, email: e.target.value})} /> <input id="auth-form-email" required type="text" onChange={(e) => setInput({...input, email: e.target.value})} />

View File

@@ -0,0 +1,15 @@
export const loginHTML = (
<>
<h2>Welcome back!</h2>
<p>It's great to see you again.</p>
<p>Please enter your credentials below to login:</p>
</>
)
export const registerHTML = (
<>
<h2>Hi there!</h2>
<p>Thank you so much for your interest in the site!</p>
<p>Please use the form below to register.</p>
</>
)

View File

@@ -0,0 +1,26 @@
import Gallery from "../_ui/Gallery/Gallery";
import Page from "../_ui/Page/Page";
export default function Contact() {
return (
<Page>
<h1>Something you wanted to talk to us about?</h1>
<p>We'd love to hear it!</p>
<p>You can reach me at any of these social media outlets:</p>
<Gallery additionalClasses="social-gallery" columns={3}>
<p>Wew</p>
<p>Wew</p>
<p>Wew</p>
</Gallery>
<p>You can also use the following form to reach out:</p>
<form>
<label>Things</label>
<input></input>
</form>
</Page>
)
}

View File

@@ -0,0 +1,12 @@
import Page from "../_ui/Page/Page";
export default function Philosophy() {
return (
<Page>
<h1>The Express Spices Philosophy</h1>
<p>Things and stuff and things and stuff and things and stuff and things and stuff and things and stuff and things.</p>
<p>Furthermore, things and stuff and things and stuff and things and stuff and things and stuff and things and stuff and things.</p>
</Page>
)
}

View File

@@ -2,13 +2,14 @@ import { useEffect, useState } from "react"
import { v4 } from "uuid"; import { v4 } from "uuid";
import { getAllProducts } from "../../util/apiUtils"; import { getAllProducts } from "../../util/apiUtils";
import { ProductModel } from "../../util/types"; import { ProductModel } from "../../util/types";
import Card from "../_ui/Card/Card";
import Gallery from "../_ui/Gallery/Gallery"; import Gallery from "../_ui/Gallery/Gallery";
import Page from "../_ui/Page/Page"; import Page from "../_ui/Page/Page";
import ProductCard from "./ProductCard"; import ProductCard from "./ProductCard";
export default function AllProducts() { export default function AllProducts() {
const [productData, setProductData] = useState<ProductModel[]>(); const [productData, setProductData] = useState<ProductModel[]>();
const [view, setView] = useState<JSX.Element>(<p>Loading...</p>); const [view, setView] = useState<JSX.Element>(<h1>Loading...</h1>);
useEffect(() => { useEffect(() => {
getAllProducts() getAllProducts()
@@ -23,7 +24,26 @@ export default function AllProducts() {
useEffect(() => { useEffect(() => {
setView( setView(
<Page> <Page>
<h1>All Products!</h1> <h1>Product Catalog</h1>
<Card additionalClasses="all-products-filter">
<div>
<p>Filter results by:</p>
<select>
<option>Name (A-Z)</option>
<option>Name (Z-A)</option>
<option>Price (Low to High)</option>
<option>Price (High to Low)</option>
</select>
</div>
<div>
<p>Select by category:</p>
</div>
<div>
<p>Select by region:</p>
</div>
</Card>
<Gallery additionalClasses="product-card-list" columns={3}> <Gallery additionalClasses="product-card-list" columns={3}>
{ {
productData && productData.map((data: ProductModel) => { productData && productData.map((data: ProductModel) => {