Skip to content

Commit

Permalink
removing unneeded next-auth stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroji-fusky committed Sep 9, 2023
1 parent 63a9566 commit a7e9dd0
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 104 deletions.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"recommendations": [
"prisma.prisma",
"bradlc.vscode-tailwindcss",
"heybourn.headwind",
"unifiedjs.vscode-mdx"
Expand Down
55 changes: 0 additions & 55 deletions apps/website/prisma/schema.prisma

This file was deleted.

10 changes: 0 additions & 10 deletions apps/website/src/app/_mixins.scss

This file was deleted.

11 changes: 10 additions & 1 deletion apps/website/src/app/globals.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
@use "_mixins" as *;
@mixin theme-variable-sets($theme) {
.theme-#{$theme} {
@content;
}
.theme-system {
@media (prefers-color-scheme: $theme) {
@content;
}
}
}

@tailwind base;
@tailwind components;
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const metadata: Metadata = {
type: "website",
siteName: "MyFursona"
},
robots: "noai, noimageai"
robots: "noai, noimageai, noindex, nofollow"
}

export default function RootLayout({
Expand Down
22 changes: 11 additions & 11 deletions apps/website/src/app/profile/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use client'
"use client"

import {Input} from "postcss";
import {useState} from "react";
import { useState } from "react"

export default function Page({}) {
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"
Expand All @@ -15,16 +14,17 @@ export default function Page({}) {
<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>
<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"
Expand Down
40 changes: 18 additions & 22 deletions apps/website/src/app/signin/SignInForm.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
"use client"

import { FormEvent, useEffect, useState } from "react"
import { useRouter } from "next/navigation"

// import { signIn, useSession } from "next-auth/react"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"

import { emailRegex } from "@/constants"
import { Button } from "@/components/ui/Buttons"
import Separator from "@/components/ui/Separator"

export default function SignInForm() {
// !!!!! code duplication detected !!!!!
// TODO: 1. use the useReducer() hook to combine all of these useStates
// TODO: 2. recommended to create a useClientAuth() custom hook to resolve code dup
// TODO: and also sharable for signup form too
// !!!!! code duplication detected !!!!!
// const { status, data } = useSession()
// const router = useRouter()
const [emailEntered, setEmailEntered] = useState(false)
const [errors, setErrors] = useState<string[]>([])
const [email, setEmail] = useState("")
const [password, setPassword] = useState("")
// useEffect(() => {
// console.log("USE EFFECT ")
// if (status === "authenticated" && data) {
// console.log("LOGGED")
// router.push("/")
// }
// console.log("NOT LOGGED")
// }, [status, data, router])

// TODO export this function as a custom hook as `useValidateEmail()` so it can be used to the signup page as well
const validateEmail = () => {
Expand All @@ -45,8 +28,6 @@ export default function SignInForm() {

const submitLogin = (e: FormEvent<HTMLFormElement>) => {
e.preventDefault()
// signIn("credentials", { email, password, redirect: false })
// router.push("/")
}

return (
Expand Down Expand Up @@ -111,7 +92,12 @@ export default function SignInForm() {
value={email}
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" onClick={validateEmail}>Next</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"
onClick={validateEmail}
>
Next
</Button>
<Button href="/auth/signup">Sign Up</Button>
</div>
<div
Expand All @@ -126,8 +112,18 @@ export default function SignInForm() {
value={password}
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" 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" onClick={() => setEmailEntered(false)}>Previous</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"
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"
onClick={() => setEmailEntered(false)}
>
Previous
</Button>
</div>
</form>
</div>
Expand Down
3 changes: 0 additions & 3 deletions apps/website/src/context/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client"

// import { SessionProvider } from "next-auth/react"
import { SidebarProvider } from "./NavbarProvider"
import { ThemeProvider } from "./ThemeProvider"

Expand All @@ -10,10 +9,8 @@ export default function Providers({
children?: React.ReactNode
}) {
return (
// <SessionProvider>
<ThemeProvider>
<SidebarProvider>{children}</SidebarProvider>
</ThemeProvider>
// </SessionProvider>
)
}

0 comments on commit a7e9dd0

Please sign in to comment.