Skip to content

Commit

Permalink
finished /profile/create page
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroji-fusky committed Sep 10, 2023
1 parent 1b6bb03 commit 5bc0bd5
Show file tree
Hide file tree
Showing 11 changed files with 319 additions and 52 deletions.
4 changes: 2 additions & 2 deletions apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export default function RootLayout({
<Navbar />
<Sidebar />
</header>
<main id="skip-navigation" className="min-h-[calc(100dvh-6rem)]">
<div id="skip-navigation" className="min-h-[calc(100dvh-6rem)]">
{children}
</main>
</div>
<Footer />
</div>
</Providers>
Expand Down
1 change: 1 addition & 0 deletions apps/website/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function Home() {
data-custom-img-renderer=""
className="relative h-[27.5rem] before:absolute before:-inset-4 before:z-[2]"
style={{ aspectRatio: "9/15" } as React.CSSProperties}
draggable="false"
>
<Image
className="select-none"
Expand Down
211 changes: 211 additions & 0 deletions apps/website/src/app/profile/create/CreateProfileForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
"use client"

import { useState } from "react"

import { Fieldset, Separator } from "@/components/ui"
import { Button } from "@/components/ui/Buttons"
import { FormWithProgress } from "@/components/ui/Forms"
import { CreditCardIcon, InfoIcon, LockIcon } from "lucide-react"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import type { IconName } from "@fortawesome/fontawesome-svg-core"
import Link from "next/link"

export default function CreateProfileForm() {
const [displayName, setDisplayName] = useState("")
// TODO: Check if the user has created an account, if so... redirect them to their profile
const username = "FluffyJane"

const [isProfileComplete, setProfileComplete] = useState(true)
const [isConnectionsComplete, setConnectionsComplete] = useState(false)
const [isAuthComplete, setAuthComplete] = useState(true)
const [isPaymentComplete, setPaymentComplete] = useState(false)

const progress = [
{
item: "Profile information",
isComplete: isProfileComplete
},
{
item: "Connections",
isComplete: isConnectionsComplete
},
{
item: "Authentication",
isComplete: isAuthComplete
},
{
item: "Payment methods",
isComplete: isPaymentComplete
}
]

// TODO export these lil shits into their own component like lucide icons
const socialIcons: IconName[] = [
"facebook",
"x-twitter",
"instagram",
"youtube",
"twitch",
"tiktok",
"github",
"telegram",
"discord",
"tumblr",
"threads",
"bilibili",
"deviantart",
"artstation",
"soundcloud",
"spotify",
"itunes-note",
"patreon",
"bandcamp",
"xbox",
"steam",
"battle-net",
"dribbble"
]

return (
<>
<section
className="max-w-screen-xl mt-20 mb-12 mx-auto px-9 text-center"
data-new-user-onboarding=""
>
<h1 className="!leading-[4.25rem] text-4xl xl:text-5xl bg-gradient-to-tl from-blue-700 via-purple-700 to-pink-500 text-transparent bg-clip-text">
Welcome to MyFursona
</h1>
<p className="xl:text-xl xl:!leading-8 text-lg">
{`Hello, ${username}—we're so glad to have you on board! You're almost there,
all we need is to get some of the nitty-gritty stuff done first.
Don't worry, you can change these anytime!`}
</p>
</section>
<FormWithProgress progress={progress}>
<div className="w-full flex flex-col gap-y-5">
{/* Profile field */}
<Fieldset heading="Profile information">
<input
type="display"
className="w-full px-4 py-2 my-1 border rounded-md border-color-3"
placeholder=""
value={displayName}
onChange={(e) => setDisplayName(e.target.value)}
/>
<input
type="user"
className="w-full px-4 py-2 my-1 border rounded-md border-color-3"
placeholder="@ozzythdev"
value={username}
onChange={(e) => setDisplayName(e.target.value)}
/>
</Fieldset>
{/* Connections field */}
<Fieldset
heading="Connections"
description={
<div className="flex flex-col gap-y-2">
<span>
Optional, you can skip this and add them from Account Settings
at anytime. Add connections such as social media and donations
associated to your account that will be displayed on your
profile.
</span>
<span>
Note that there are some connections that might display
additional metadata, you can change their visibility later.
</span>
</div>
}
>
<div className="bg-100 p-3.5 border border-300 rounded-lg">
<div className="flex flex-wrap gap-2">
{socialIcons.map((icon, i) => (
<Button
key={i}
iconOnly
prefixIcon={
<FontAwesomeIcon
icon={["fab", icon]}
fixedWidth
size="2x"
/>
}
></Button>
))}
</div>
<Separator dir="horizontal" padding="0.75rem" />
<div className="inline-flex items-center gap-x-2">
<InfoIcon size={18} />
<span>
{"Any platforms missing or have a suggestions to add? "}
<Link href="/profile/create#" className="text-info underline">
Let us know!
</Link>
</span>
</div>
</div>
</Fieldset>
{/* Payment field */}
<Fieldset
heading="Payment methods"
description="Optional, you can skip this and add them from Account Settings at anytime. Add your preferred payment method(s) when commissioning an artist or purchasing a physical goodies on MyFursona."
>
<div className="bg-100 p-3.5 border border-300 rounded-lg">
<div className="flex gap-x-2 flex-wrap">
<Button prefixIcon={<CreditCardIcon size={21} />}>
Credit/Debit card
</Button>
<Button
prefixIcon={
<FontAwesomeIcon
icon={["fab", "paypal"]}
fixedWidth
size="lg"
/>
}
>
PayPal
</Button>
<Button
prefixIcon={
<FontAwesomeIcon
icon={["fab", "stripe-s"]}
fixedWidth
size="lg"
/>
}
>
Stripe
</Button>
<Button prefixIcon={<CreditCardIcon size={21} />}>
Square
</Button>
<Button prefixIcon={<CreditCardIcon size={21} />}>
Klarna
</Button>
</div>
</div>
</Fieldset>
{/* Auth field */}
<Fieldset
heading="Authentication"
description={
<>
Optional but <em>highly recommended</em>. You can skip this and
add them from Account Settings at anytime. Protect your account
with an additional layer of security with two-factor
authentication.
</>
}
>
<Button prefixIcon={<LockIcon size={21} />}>Setup 2FA</Button>
</Fieldset>
<div className="flex justify-end">
<Button>Okay, I'm all set!</Button>
</div>
</div>
</FormWithProgress>
</>
)
}
49 changes: 6 additions & 43 deletions apps/website/src/app/profile/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,10 @@
"use client"
import { Metadata } from "next"
import CreateProfileForm from "./CreateProfileForm"

import { useState } from "react"
export const metadata: Metadata = {
title: "Create profile"
}

export default function Page() {
const [displayName, setDisplayName] = useState("")
// TODO: Check if the user has created an account, if so... redirect them to their profile
const username = "FluffyJane"

return (
<div className="flex flex-row py-16 justify-center items-center">
<div className="w-1/3">
{/* TODO: Progress Line */}
<p>p</p>
</div>
<div className="w-1/2 text-center">
<h1 className="text-4xl bg-gradient-to-tl from-blue-700 via-purple-700 to-pink-500 text-transparent bg-clip-text">
Welcome to MyFursona
</h1>
<p>
Hello, {username}, we’re so glad to have you on board! Let’s get some
of the nitty-gritty stuff done first. Don’t worry, you can change
these anytime!
</p>
<section className="p-6">
<h2>Profile Information</h2>
<div>
<input
type="display"
className="w-full px-4 py-2 my-1 border rounded-md border-color-3"
placeholder=""
value={displayName}
onChange={(e) => setDisplayName(e.target.value)}
/>
<input
type="user"
className="w-full px-4 py-2 my-1 border rounded-md border-color-3"
placeholder="@ozzythdev"
value={username}
onChange={(e) => setDisplayName(e.target.value)}
/>
</div>
</section>
</div>
</div>
)
return <CreateProfileForm />
}
6 changes: 3 additions & 3 deletions apps/website/src/app/signin/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function SignInForm() {
onChange={(e) => setEmail(e.target.value)}
/>
<Button
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
onClick={validateEmail}
>
Next
Expand All @@ -113,13 +113,13 @@ export default function SignInForm() {
onChange={(e) => setPassword(e.target.value)}
/>
<Button
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
type="submit"
>
Login
</Button>
<Button
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
className="flex items-center gap-x-1.5 rounded-md transition-[border,background-color] border-[2px] px-4 py-2 border-transparent bg-300 hover:bg-400 focus:bg-400 w-full my-2"
onClick={() => setEmailEntered(false)}
>
Previous
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/base/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function Footer() {
</section>
<section id="copyright" className="px-12 py-4 text-center">
The MyFursona Project is under the Apache-2.0 license. &copy;
2022-2023 MyFursona/Fusky Labs Software Ltd.
2022-2023 Fusky Labs Software Ltd.
</section>
</footer>
<svg className="absolute top-0 -z-[1] w-full h-full" aria-hidden></svg>
Expand Down
6 changes: 4 additions & 2 deletions apps/website/src/components/ui/Buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function Button({
| "style"
>) {
const sizes: ButtonSizesRecord = {
small: !iconOnly ? "py-1.5 py-2 " : "p-1.5",
small: !iconOnly ? "px-1.5 py-1" : "p-1.5",
big: !iconOnly ? "px-4 py-2" : "p-2"
}

Expand Down Expand Up @@ -94,7 +94,9 @@ export default function Button({
className={
className
? className
: [baseStyles, sizeDynamic, variantsDynamic, positions].join(" ")
: [baseStyles, sizeDynamic, variantsDynamic, positionDynamic].join(
" "
)
}
{...attributes}
>
Expand Down
19 changes: 19 additions & 0 deletions apps/website/src/components/ui/Fieldset.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default function Fieldset({
children,
heading,
description
}: {
children?: React.ReactNode
heading?: string
description?: NonNullable<React.ReactElement> | string
}) {
return (
<section data-bui-fieldset="" className="p-6 rounded-lg border border-300 bg-200">
<div>
{heading ? <h2 className="mb-2 text-2xl">{heading}</h2> : null}
{description ? <span>{description}</span> : null}
</div>
<div className="pt-2">{children}</div>
</section>
)
}
Loading

0 comments on commit 5bc0bd5

Please sign in to comment.