Skip to content
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

Create page: Sign Up #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/app/auth/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { FunctionComponent } from 'react';
import SignInForm from '@/components/SignInForm';
import GoogleSignInButton from '@/components/GoogleSignInButton';
import CreateAccountLink from '@/components/CreateAccountLink';

const LoginPage: FunctionComponent = () => {
return (
<div className="bg-gray-900 text-white h-screen flex justify-center items-center">
<div className="w-full max-w-xs mx-auto">
<SignInForm />
<CreateAccountLink />
<GoogleSignInButton />
</div>
</div>
);
};

export default LoginPage;
14 changes: 14 additions & 0 deletions src/components/CreateAccountLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { FunctionComponent } from 'react';
import Link from 'next/link';

const CreateAccountLink: FunctionComponent = () => {
return (
<Link href="/auth/register">
<a className="inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800">
Create an account
</a>
</Link>
);
};

export default CreateAccountLink;
15 changes: 15 additions & 0 deletions src/components/GoogleSignInButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FunctionComponent } from 'react';
import '@/styles/GoogleSignInButton.css';

const GoogleSignInButton: FunctionComponent = () => {
return (
<button className="google-btn hover:bg-blue-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full flex justify-center items-center">
<div className="google-icon-wrapper">
<img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" alt="Google logo" className="google-icon" />
</div>
Sign in with Google
</button>
);
};

export default GoogleSignInButton;
24 changes: 24 additions & 0 deletions src/components/SignInForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { FunctionComponent } from 'react';
import Label from '@/components/ui/label';
import Input from '@/components/ui/input';
import Button from '@/components/ui/button';

const SignInForm: FunctionComponent = () => {
return (
<form className="bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div className="mb-4">
<Label htmlFor="username" value="Username" />
<Input id="username" type="text" placeholder="username@edu" />
</div>
<div className="mb-6">
<Label htmlFor="password" value="Password" />
<Input id="password" type="password" placeholder="******************" />
</div>
<div className="flex items-center justify-between">
<Button type="submit" color="blue" text="Sign in" />
</div>
</form>
);
};

export default SignInForm;