Titles for all user-side pages

main
Ashelyn Dawn 4 years ago
parent 31f7f4b088
commit 8b59c2abaf

@ -1,3 +1,4 @@
import Head from 'next/head'
import {DateTime} from 'luxon'
import Link from 'next/link'
import {Button, FormController} from '~/components/form'
@ -24,6 +25,9 @@ export default function ConfirmEmail({links}) {
return (
<>
<Head>
<title>Confirm Email | Society of Socks</title>
</Head>
<h2>Confirm Email Address</h2>
<p>
In order to make use of account related features, we require you to

@ -1,3 +1,4 @@
import Head from 'next/head'
import Link from 'next/link'
import {Button, FormController} from '~/components/form'
import Router from 'next/router'
@ -13,6 +14,9 @@ export default function InvalidEmail() {
return (
<>
<Head>
<title>Invalid Link | Society of Socks</title>
</Head>
<h2>Invalid Confirmation Link</h2>
<p>
Sorry, but the email confirmation link you used was invalid or expired.

@ -1,4 +1,5 @@
import {DateTime} from 'luxon'
import Head from 'next/head'
import Router from 'next/router'
import Table from '~/components/table'
@ -24,6 +25,9 @@ export default function AccountPage({orders}) {
return (
<>
<Head>
<title>Account | Society of Socks</title>
</Head>
<h2>Account</h2>
{/* TODO: Red is kind of intimidating. Should we change this to a yellow or blue info style? */}

@ -1,4 +1,5 @@
import {DateTime} from 'luxon'
import Head from 'next/head'
import redirect from '~/utils/redirectGetInitialProps'
import OrderSummary from '~/components/orderSummary'
@ -23,6 +24,9 @@ export default function OrderDetails({order}) {
return (
<>
<Head>
<title>Order #{order.number} | Society of Socks</title>
</Head>
<h2>Order #{order.number}: Details</h2>
<h3>Purchased {DateTime.fromISO(lastTransaction.completion_time).toFormat('LLLL dd, h:mm a')}</h3>
<OrderSummary order={order} isAdmin={false} />

@ -1,4 +1,5 @@
import React from 'react'
import Head from 'next/head'
import Hero from '~/components/hero'
import Card from '~/components/card'
@ -11,6 +12,9 @@ Index.getInitialProps = async ({ctx})=>{
export default function Index({items}){
return (
<>
<Head>
<title>Society of Socks</title>
</Head>
<Hero/>
<div className="cardContainer">
{items.map(item=>

@ -1,5 +1,6 @@
import React from 'react'
import Link from 'next/link'
import Head from 'next/head'
import Router from 'next/router'
import isEmail from 'validator/lib/isEmail'
@ -17,12 +18,17 @@ export default function Login(){
}
return (
<FormController url="/api/auth" afterSubmit={redirectAfterLogin}>
<h1>Login</h1>
<Input label="Email" type="text" name="email" validate={value=>isEmail(value)} hint="Enter a valid email address" />
<Input label="Password" type="password" name="password" validate={value=>(value.length >= 8)} hint="Password must be at least 8 characters long" />
<Button type="submit">Submit</Button>
<p>Need an account? <Link href="/register"><a>Register here</a></Link>.</p>
</FormController>
<>
<Head>
<title>Login | Society of Socks</title>
</Head>
<FormController url="/api/auth" afterSubmit={redirectAfterLogin}>
<h1>Login</h1>
<Input label="Email" type="text" name="email" validate={value=>isEmail(value)} hint="Enter a valid email address" />
<Input label="Password" type="password" name="password" validate={value=>(value.length >= 8)} hint="Password must be at least 8 characters long" />
<Button type="submit">Submit</Button>
<p>Need an account? <Link href="/register"><a>Register here</a></Link>.</p>
</FormController>
</>
)
}

@ -1,6 +1,7 @@
import React from 'react'
import Link from 'next/link'
import Router from 'next/router'
import Head from 'next/head'
import isEmail from 'validator/lib/isEmail'
import {FormController, Input, Button} from '~/components/form'
@ -10,13 +11,18 @@ export default function Register(){
useAccountRedirect()
return (
<FormController url="/api/users" afterSubmit={()=>Router.push('/account')}>
<h1>Register</h1>
<Input label="Email" type="text" name="email" validate={value=>isEmail(value)} hint="Enter a valid email address" />
<Input label="Password" type="password" name="password" validate={value=>(value.length >= 8)} hint="Password must be at least 8 characters long" />
<Input label="Repeat password" type="password" name="password2" validate={(value, fields)=>(value === fields.password.value)} hint="Passwords must match" />
<Button type="submit">Register</Button>
<p>Already have an account? <Link href="/login"><a>Login here</a></Link>.</p>
</FormController>
<>
<Head>
<title>Register | Society of Socks</title>
</Head>
<FormController url="/api/users" afterSubmit={()=>Router.push('/account')}>
<h1>Register</h1>
<Input label="Email" type="text" name="email" validate={value=>isEmail(value)} hint="Enter a valid email address" />
<Input label="Password" type="password" name="password" validate={value=>(value.length >= 8)} hint="Password must be at least 8 characters long" />
<Input label="Repeat password" type="password" name="password2" validate={(value, fields)=>(value === fields.password.value)} hint="Passwords must match" />
<Button type="submit">Register</Button>
<p>Already have an account? <Link href="/login"><a>Login here</a></Link>.</p>
</FormController>
</>
)
}

@ -30,7 +30,9 @@ export default function Cart(){
return (
<>
<Head><title>Cart</title></Head>
<Head>
<title>Cart | Society of Socks</title>
</Head>
<h2>Cart</h2>
{

@ -12,7 +12,9 @@ export default function Categories({categories: allCategories}) {
const topCategories = allCategories.filter(cat => !cat.parent)
return (
<>
<Head><title>Categories</title></Head>
<Head>
<title>Categories | Society of Socks</title>
</Head>
<h2>Categories</h2>
{topCategories.length > 0 && <div className={styles.childCategories}>
{topCategories.map(category => (

@ -21,7 +21,9 @@ Category.getInitialProps = async function({ctx: {axios, query: {slug}}}){
export default function Category({category: {items, children, parent, ...category}}){
return (
<>
<Head><title>{category.name}</title></Head>
<Head>
<title>{category.name} | Society of Socks</title>
</Head>
<h2>{category.name}</h2>
<div className={styles.pageContainer}>
{parent ? (

@ -1,3 +1,4 @@
import Head from 'next/head'
import {FormController, Input, Button} from '~/components/form'
import Router from 'next/router'
@ -13,6 +14,9 @@ export default function InputAddress({address}){
return (
<>
<Head>
<title>Enter Address | Society of Socks</title>
</Head>
<h2>Enter Address</h2>
<FormController url="/api/orders/current/address" afterSubmit={afterSave}>
<Input initialValue={address?.name} name="name" validate={value=>value.length > 0}/>

@ -1,3 +1,4 @@
import Head from 'next/head'
import {DateTime} from 'luxon'
import Link from 'next/link'
@ -23,6 +24,9 @@ export default function CheckoutComplete({order}){
return (
<>
<Head>
<title>Order Complete | Society of Socks</title>
</Head>
<h2>Order Complete</h2>
<div className={styles.horizContainer}>
<div>

@ -1,5 +1,6 @@
import {useState, useRef} from 'react'
import Link from 'next/link'
import Head from 'next/head'
import Router from 'next/router'
import getConfig from 'next/config'
import styles from './style.module.css'
@ -89,6 +90,9 @@ export default function CheckoutSummary({order: _order, addresses}){
return (
<>
<Head>
<title>Checkout | Society of Socks</title>
</Head>
<h2>Checkout</h2>
<div className={styles.checkoutSection}>
<h3>Address</h3>

@ -1,4 +1,5 @@
import {useState, useEffect} from 'react'
import Head from 'next/head'
import axios from 'axios'
import Router from 'next/router'
@ -25,6 +26,9 @@ export default function CheckoutComplete({session_id}){
if(loading)
return (
<>
<Head>
<title>Verifying Payment | Society of Socks</title>
</Head>
<h2>Checkout</h2>
<p style={{textAlign: 'center'}}>Verifying your payment . . .</p>
</>
@ -32,6 +36,9 @@ export default function CheckoutComplete({session_id}){
return (
<>
<Head>
<title>Checkout Error | Society of Socks</title>
</Head>
<h2>Checkout</h2>
<p style={{textAlign: 'center'}}>There was a problem with your payment.</p>
</>

@ -31,7 +31,9 @@ export default function Item({item}){
return (
<>
<Head><title>{item.name}</title></Head>
<Head>
<title>{item.name} | Society of Socks</title>
</Head>
<div className={styles.pageContainer}>
<div className={'dark ' + styles.itemDetails}>
{item.images && item.images.length > 0 && (

Loading…
Cancel
Save