Skip to content

Commit

Permalink
Merge pull request #76 from Taks07/main
Browse files Browse the repository at this point in the history
Auth forms now use more of the tailwind config styles
  • Loading branch information
clen678 authored Aug 12, 2024
2 parents b8476a6 + beb789c commit 2ec367e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/AuthForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from "axios";
// This component is a reusable form that can be used for both the login and signup pages. This was done to reduce code duplication.
export default function AuthForm({endpoint, title, buttonText, redirectTitleText, redirectLink, redirectText}) {
const labelStyle = "text-2xl";
const inputStyle = "border-2 w-64 h-8 p-2 rounded-lg mb-4 mt-2 border-black focus:border-blue-800 focus:outline-none";
const inputStyle = "border-2 w-64 h-8 p-2 rounded-lg mb-4 mt-2 border-primary focus:border-primary-highlight focus:outline-none";

const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
Expand All @@ -29,7 +29,7 @@ export default function AuthForm({endpoint, title, buttonText, redirectTitleText
}

return (
<form className="flex flex-col border-2 items-center border-blue-800 w-80 p-4 rounded-xl bg-blue-100">
<form className="flex flex-col border-2 items-center border-primary-dark w-80 p-4 rounded-xl bg-blue-100">
<h2 className="text-4xl font-bold text-center mb-4">{title}</h2>
<div className="flex flex-col">
<label className={labelStyle} htmlFor="email">Email</label>
Expand All @@ -39,9 +39,9 @@ export default function AuthForm({endpoint, title, buttonText, redirectTitleText
<label className={labelStyle} htmlFor="password">Password</label>
<input className={inputStyle} required type="password" onChange={(e) => {setPassword(e.target.value)}} value={password} />
</div>
<button className="w-60 bg-blue-600 text-white text-2xl p-2 rounded-lg mt-4" onClick={(e) => handleSubmit(e)}>{buttonText}</button>
<button className="w-60 bg-primary text-white text-button p-2 rounded-lg mt-4" onClick={(e) => handleSubmit(e)}>{buttonText}</button>
<p className="text-xl mt-4">{redirectTitleText}</p>
<Link to={redirectLink} className="text-blue-800 text-xl">{redirectText}</Link>
<Link to={redirectLink} className="text-primary-highlight text-xl">{redirectText}</Link>
</form>
);
}
Expand Down

0 comments on commit 2ec367e

Please sign in to comment.