-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changed the document.tsx to add font awesome pro and changed wording for anniversary * all capitalized text * solve cross origin * added v0 * removed code * login page is there * added the spinner
- Loading branch information
1 parent
d0dcff3
commit 1925fdc
Showing
11 changed files
with
329 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": false, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/styles/globals.css", | ||
"baseColor": "gray", | ||
"cssVariables": false | ||
}, | ||
"aliases": { | ||
"utils": "@assets/lib/utils", | ||
"components": "@assets/components" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type ClassValue, clsx } from "clsx" | ||
import { twMerge } from "tailwind-merge" | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
import { useState } from "react"; | ||
import { useRouter } from "next/router"; | ||
import { useForm, SubmitHandler } from "react-hook-form"; | ||
import Input from "@ui/form-elements/input"; | ||
import Checkbox from "@ui/form-elements/checkbox"; | ||
import FeedbackText from "@ui/form-elements/feedback"; | ||
import Button from "@ui/button"; | ||
import { hasKey } from "@utils/methods"; | ||
import { useUser } from "@contexts/user-context"; | ||
|
||
interface IFormValues { | ||
username: string; | ||
password: string; | ||
} | ||
|
||
const LoginForm = () => { | ||
const router = useRouter(); | ||
const [serverState, setServerState] = useState(""); | ||
const { setLogin } = useUser(); | ||
const { | ||
register, | ||
handleSubmit, | ||
formState: { errors }, | ||
} = useForm<IFormValues>({ | ||
defaultValues: { | ||
username: "Admin", | ||
password: "Admin", | ||
}, | ||
}); | ||
|
||
const onSubmit: SubmitHandler<IFormValues> = (data) => { | ||
if (data.username === "Admin" && data.password === "Admin") { | ||
setLogin(); | ||
setServerState(""); | ||
if (window?.history?.length > 2) { | ||
router.back(); | ||
} | ||
} else { | ||
setServerState("Username or password is incorrect"); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="tw-bg-white tw-shadow-2xs tw-shadow-heading/10 tw-max-w-[470px] tw-pt-7.5 tw-pb-[50px] tw-px-[50px]"> | ||
<h3 className="tw-text-h2 tw-mb-5">Login</h3> | ||
<form onSubmit={handleSubmit(onSubmit)} noValidate> | ||
<div className="tw-mb-7.5"> | ||
<label | ||
htmlFor="username" | ||
className="tw-text-heading tw-text-md" | ||
> | ||
Username * | ||
</label> | ||
<Input | ||
id="username" | ||
placeholder="Username" | ||
bg="light" | ||
feedbackText={errors?.username?.message} | ||
state={hasKey(errors, "username") ? "error" : "success"} | ||
showState={!!hasKey(errors, "username")} | ||
{...register("username", { | ||
required: "Username is required", | ||
})} | ||
/> | ||
<small>Default Username: Admin</small> | ||
</div> | ||
<div className="tw-mb-7.5"> | ||
<label | ||
htmlFor="password" | ||
className="tw-text-heading tw-text-md" | ||
> | ||
Password * | ||
</label> | ||
<Input | ||
id="password" | ||
type="password" | ||
placeholder="Password" | ||
bg="light" | ||
autoComplete="true" | ||
feedbackText={errors?.password?.message} | ||
state={hasKey(errors, "password") ? "error" : "success"} | ||
showState={!!hasKey(errors, "password")} | ||
{...register("password", { | ||
required: "Password is required", | ||
})} | ||
/> | ||
<small>Default Password: Admin</small> | ||
</div> | ||
<Checkbox name="remember" id="remember" label="Remember me" /> | ||
<Button type="submit" fullwidth className="tw-mt-7.5"> | ||
Log In | ||
</Button> | ||
{serverState && <FeedbackText>{serverState}</FeedbackText>} | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoginForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,5 +306,7 @@ module.exports = { | |
}, | ||
}); | ||
}, | ||
require("tailwindcss-animate"), | ||
require("tailwindcss-animate") | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -889,10 +889,10 @@ | |
"core-js-pure" "^3.25.1" | ||
"regenerator-runtime" "^0.13.11" | ||
|
||
"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.13.10", "@babel/runtime@^7.16.3", "@babel/runtime@^7.8.4": | ||
"integrity" "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==" | ||
"resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz" | ||
"version" "7.22.10" | ||
"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.13.10", "@babel/runtime@^7.16.3", "@babel/runtime@^7.24.1", "@babel/runtime@^7.8.4": | ||
"integrity" "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==" | ||
"resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz" | ||
"version" "7.24.5" | ||
dependencies: | ||
"regenerator-runtime" "^0.14.0" | ||
|
||
|
@@ -1417,6 +1417,11 @@ | |
"@radix-ui/react-primitive" "1.0.3" | ||
"@radix-ui/react-use-controllable-state" "1.0.1" | ||
|
||
"@radix-ui/react-icons@^1.3.0": | ||
"integrity" "sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==" | ||
"resolved" "https://registry.npmjs.org/@radix-ui/react-icons/-/react-icons-1.3.0.tgz" | ||
"version" "1.3.0" | ||
|
||
"@radix-ui/[email protected]": | ||
"integrity" "sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==" | ||
"resolved" "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz" | ||
|
@@ -2967,6 +2972,13 @@ | |
"resolved" "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz" | ||
"version" "1.0.3" | ||
|
||
"class-variance-authority@^0.7.0": | ||
"integrity" "sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==" | ||
"resolved" "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz" | ||
"version" "0.7.0" | ||
dependencies: | ||
"clsx" "2.0.0" | ||
|
||
"classnames@^2.3.2": | ||
"integrity" "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" | ||
"resolved" "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz" | ||
|
@@ -3012,6 +3024,11 @@ | |
"resolved" "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz" | ||
"version" "1.2.1" | ||
|
||
"[email protected]": | ||
"integrity" "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==" | ||
"resolved" "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz" | ||
"version" "2.0.0" | ||
|
||
"code-red@^1.0.3": | ||
"integrity" "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==" | ||
"resolved" "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz" | ||
|
@@ -5089,6 +5106,11 @@ | |
dependencies: | ||
"yallist" "^4.0.0" | ||
|
||
"lucide-react@^0.378.0": | ||
"integrity" "sha512-u6EPU8juLUk9ytRcyapkWI18epAv3RU+6+TC23ivjR0e+glWKBobFeSgRwOIJihzktILQuy6E0E80P2jVTDR5g==" | ||
"resolved" "https://registry.npmjs.org/lucide-react/-/lucide-react-0.378.0.tgz" | ||
"version" "0.378.0" | ||
|
||
"magic-string@^0.25.0": | ||
"integrity" "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==" | ||
"resolved" "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz" | ||
|
@@ -5894,7 +5916,7 @@ | |
"invariant" "^2.2.4" | ||
"tslib" "^2.0.0" | ||
|
||
"react@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^15.6.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.11.0 || ^17.0.0 || ^18.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17 || ^18", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.2 || ^18.0.0-0", "react@^18.2.0", "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", "react@>=16.0.0", "react@>=16.8 || ^17.0.0 || ^18.0.0", "react@>=16.8.0", "[email protected]": | ||
"react@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^15.6.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.11.0 || ^17.0.0 || ^18.0.0", "react@^16.5.1 || ^17.0.0 || ^18.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17 || ^18", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.x || ^17.x || ^18.x", "react@^17.0.2 || ^18.0.0-0", "react@^18.2.0", "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", "react@>=16.0.0", "react@>=16.8 || ^17.0.0 || ^18.0.0", "react@>=16.8.0", "[email protected]": | ||
"integrity" "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==" | ||
"resolved" "https://registry.npmjs.org/react/-/react-18.2.0.tgz" | ||
"version" "18.2.0" | ||
|
@@ -6629,7 +6651,19 @@ | |
"resolved" "https://registry.npmjs.org/swrv/-/swrv-1.0.4.tgz" | ||
"version" "1.0.4" | ||
|
||
"tailwindcss@^3.0.23", "tailwindcss@>=3.0.0 || >= 3.0.0-alpha.1 || insiders": | ||
"tailwind-merge@^2.3.0": | ||
"integrity" "sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==" | ||
"resolved" "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.3.0.tgz" | ||
"version" "2.3.0" | ||
dependencies: | ||
"@babel/runtime" "^7.24.1" | ||
|
||
"tailwindcss-animate@^1.0.7": | ||
"integrity" "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==" | ||
"resolved" "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz" | ||
"version" "1.0.7" | ||
|
||
"tailwindcss@^3.0.23", "tailwindcss@>=3.0.0 || >= 3.0.0-alpha.1 || insiders", "tailwindcss@>=3.0.0 || insiders": | ||
"integrity" "sha512-+OZOV9ubyQ6oI2BXEhzw4HrqvgcARY38xv3zKcjnWtMIZstEsXdI9xftd1iB7+RbOnj2HOEzkA0OyB5BaSxPQA==" | ||
"resolved" "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.23.tgz" | ||
"version" "3.0.23" | ||
|