generated from UoaWDCC/ssr-template
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Karmveer/feature/27/auth pages #87
Merged
Merged
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f17cea0
Changed colours for signup and login. and modofied app.tsx so outlet …
Karmveer27 0dd1f0b
Fixed gradiant for auth pages
Karmveer27 3fa44bd
Fixed auth page layout and also edited header so if logged in it show…
Karmveer27 d8b64c2
Started working on form for user info
Karmveer27 64df3cc
Merge branch 'main' into Karmveer/feature/27/auth-pages
Karmveer27 f522f8d
Using Main App.tsx
Karmveer27 b2655c2
Merge branch 'main' into Karmveer/feature/27/auth-pages
gmat224 e75b610
feat: updated sign-up styling
gmat224 715d92d
feat: added correct image
gmat224 74dd75b
fix: unused dependencies
gmat224 94f0847
fix: header
gmat224 0673261
chore: tests added
gmat224 70e8101
fix: fixed naming
gmat224 7ae5f79
fix: tests
gmat224 f265627
fix: deployment
gmat224 8d76175
fix: linting
gmat224 c572b00
fix: linting
gmat224 43186f8
fix: undo build yaml file
gmat224 360098a
fix: linting
gmat224 4fee5b0
fix: line
gmat224 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,52 @@ | ||
|
||
interface FormInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | ||
label?: string; | ||
placeholder?: string; | ||
type?: string; | ||
id?: string; | ||
className?: string; | ||
name?: string; | ||
options?: string[]; | ||
errorMessage?: string | ||
} | ||
|
||
const FormInput: React.FC<FormInputProps> = ({ | ||
label, | ||
placeholder, | ||
type = "text", id, | ||
className = "mt-2 w-full px-3 py-2 border border-black rounded-lg focus:outline-none focus:border-black focus:ring-black", | ||
options = [""], | ||
...props | ||
}) => { | ||
if(type==="radio" && options.length > 0){ | ||
return ( | ||
<div className="mb-4 mt-4"> | ||
<div className="mt-2"> | ||
{options.map((option,index) => ( | ||
<label key={option} className={`inline-flex items-center ${index !== 0 ? 'ml-6' : ''}`}> | ||
<input type="radio" name={props.name} value={option} /> | ||
<span className="ml-2">{option}</span> | ||
</label> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
}else{ | ||
return ( | ||
<div className="form-input"> | ||
{label && <label htmlFor={id} className="">{label}</label>} | ||
<input | ||
placeholder={placeholder} | ||
type={type} | ||
id={id} | ||
className={` ${className}`} | ||
{...props} | ||
/> | ||
{props.errorMessage && <span className="text-red-500">{props.errorMessage}</span>} | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
|
||
export default FormInput; |
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,57 @@ | ||
import FormInput from "@components/FormInput.tsx"; | ||
import {useState} from "react"; | ||
|
||
|
||
function UserInformationForm() { | ||
const [values, setValues] = useState({ | ||
firstName: "", | ||
lastName: "", | ||
university: "", | ||
graudationYear: "", | ||
UPI: "", | ||
studentID: "", | ||
studyOption: "" | ||
}); | ||
|
||
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
// Need to do validation here | ||
setValues({ ...values, [e.target.name]: e.target.value }); | ||
console.log(values) | ||
}; | ||
|
||
const residencyOptions = ["International", "Domestic"]; | ||
const paymentOptions = ["One Semester ($8)", "Two Semesters ($15)"]; | ||
|
||
function handleSubmit(e: React.FormEvent<HTMLFormElement>){ | ||
e.preventDefault(); | ||
console.log("submitted"); | ||
} | ||
return ( | ||
<div className="flex items-center justify-center "> | ||
<div className="bg-white p-8 rounded-lg shadow-lg max-w-lg w-full"> | ||
<h2 className="text-2xl font-semibold mb-6 text-center">We need some more information for your membership</h2> | ||
|
||
<form onSubmit={handleSubmit} > | ||
<FormInput placeholder={"First Name"} id="firstName" errorMessage="First Name is Required" onChange={onChange} /> | ||
<FormInput placeholder={"Last Name"} id="lastName" errorMessage="Last Name is Required" onChange={onChange}/> | ||
<FormInput placeholder={"University (or alumni)"} id="university" errorMessage="Your Univeristiy is Required" onChange={onChange}/> | ||
<FormInput placeholder={"What year are you in (or alumni)"} id="year" errorMessage="Your Graduation Year is Required" onChange={onChange}/> | ||
<FormInput placeholder={"UPI (if you have one)"} id="upi" onChange={onChange}/> | ||
<FormInput placeholder={"Student ID (if you have one)"} id="studentId" onChange={onChange}/> | ||
<FormInput placeholder={"What are you studying)"} id="study" onChange={onChange}/> | ||
|
||
<FormInput type="radio" name="residency" options={residencyOptions}/> | ||
<FormInput type="radio" name="duration" options={paymentOptions}/> | ||
|
||
<button className="w-full bg-black text-white py-2 rounded-lg hover:bg-gray-800" > | ||
Purchase membership | ||
</button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
); | ||
} | ||
|
||
export default UserInformationForm; |
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,11 @@ | ||
import UserInformationForm from "@components/UserInformationForm.tsx"; | ||
|
||
function InformationScreen() { | ||
return ( | ||
<div className="flex-grow flex flex-col justify-center bg-gradient-to-t from-blue-500 via-blue-400 to-blue-300"> | ||
<UserInformationForm /> | ||
</div> | ||
); | ||
} | ||
|
||
export default InformationScreen; |
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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
import { SignIn } from "@clerk/clerk-react"; | ||
|
||
function LoginScreen() { | ||
return ( | ||
<div> | ||
<h2> Login Screen</h2> | ||
</div> | ||
); | ||
return ( | ||
<div className="flex-grow flex flex-col h-full"> | ||
<div className="flex flex-grow justify-center"> | ||
<div className="flex flex-1 items-center justify-center"> | ||
<SignIn /> | ||
</div> | ||
<div className="flex flex-col flex-1 items-center justify-top text-center pt-20 " | ||
style={{ | ||
background: 'linear-gradient(to top, #ccf2ff 50%, #ffffff 100%)', | ||
}} | ||
> | ||
<div className="mb-5"> | ||
<img src="/src/assets/peacock.png" alt="Descriptive Text" className="max-w-[300px] max-h-[300px] " /> | ||
</div> | ||
<div> | ||
<img src="/src/assets/AUIS_black_3.png" alt="Descriptive Text" className="max-w-xs max-h-xs" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default LoginScreen; |
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 |
---|---|---|
@@ -1,31 +1,28 @@ | ||
import {SignUp} from "@clerk/clerk-react"; | ||
import { SignUp } from "@clerk/clerk-react"; | ||
|
||
function SignUpScreen() { | ||
return ( | ||
<div className="flex-grow bg-white flex flex-col"> | ||
<div className="flex justify-center my-5"> | ||
<h1 className="text-black font-bold">Join Our Vibrant Community Today </h1> | ||
</div> | ||
<div className="flex flex-row justify-center mt-5"> | ||
<div className="flex flex-col flex-1 items-center justify-center text-center p-4"> | ||
<div className="flex-grow flex flex-col h-full "> | ||
<div className="flex flex-grow justify-center "> | ||
|
||
<div className="flex flex-col flex-1 items-center justify-top text-center pt-20 " | ||
style={{ | ||
background: 'linear-gradient(to top, #fda642 50%, #ffffff 100%)', | ||
}} | ||
> | ||
<div className="mb-5"> | ||
<img src="/src/assets/react.svg" alt="Descriptive Text" className="min-w-1000 min-h-1000"/> | ||
<img src="/src/assets/peacock.png" alt="Descriptive Text" className="max-w-[300px] max-h-[300px] " /> | ||
</div> | ||
<div> | ||
<h1>Ready to Join Us? Let's get started and set up your account.</h1> | ||
<h2>If you already have one, sign in here to access your profile.</h2> | ||
<img src="/src/assets/AUIS_black_3.png" alt="Descriptive Text" className="max-w-xs max-h-xs" /> | ||
</div> | ||
</div> | ||
|
||
<div className="w-px bg-gray-300 mt-15">a</div> | ||
|
||
<div className="flex flex-1 items-center justify-center mt-15"> | ||
<SignUp/> | ||
<div className="flex flex-1 items-center justify-center "> | ||
<SignUp afterSignUpUrl="/user-info"/> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
) | ||
); | ||
} | ||
|
||
export default SignUpScreen | ||
export default SignUpScreen; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use main code for this page. The styling added is out of date