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

Carol/login image formatting #483

Open
wants to merge 2 commits 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
128 changes: 65 additions & 63 deletions components/signIn.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { signIn } from 'next-auth/react';
import { GoogleOutlined, GithubOutlined, MailOutlined } from '@ant-design/icons';
import { Button, Space, Card, Image, Typography, Form, Input } from 'antd';
import { Button, Space, Image, Form, Input } from 'antd';
import styles from '../styles/Signin.module.css';

const { Item } = Form;
Expand All @@ -11,70 +11,72 @@ const DEV_DEPLOY =
export default function SignIn() {
return (
<div className={styles.SignIn}>
<Card bordered={false} className={styles.Card} style={{ height: DEV_DEPLOY ? '80%' : '70%' }}>
{/* <button onClick={() => signIn()}>Sign in</button> */}
<Space
direction="vertical"
size="small"
style={{
alignItems: 'center',
}}>
<Image className={styles.Logo} src="/vh-logo.png" alt="VandyHacks Logo" preview={false} />
<br />
<div className={styles.Title} style={{ color: 'white' }}>
VandyHacks X
</div>
<Button
size="large"
type="primary"
icon={<GoogleOutlined />}
className={styles.ButtonStyle}
onClick={() => signIn('google')}>
Sign in with Google
</Button>
<Button
size="large"
type="primary"
icon={<GithubOutlined />}
className={styles.ButtonStyle}
onClick={() => signIn('github')}>
Sign in with GitHub
</Button>
{DEV_DEPLOY && ( // email sign in only in dev
<Form
name="basic"
// labelCol={{ span: 8 }}
// wrapperCol={{ span: 16 }}
layout="vertical"
onFinish={values => signIn('credentials', { ...values })}
// onFinishFailed={onFinishFailed}
autoComplete="off">
<Item
label={<label style={{ color: 'white' }}>Email</label>}
name="email"
rules={[{ required: true, message: 'Please input your email!' }]}>
<Input />
</Item>
<div className={styles.Card}>
<div className={styles.Logo}>
<Image src="/vh-logo.png" alt="VandyHacks Logo" preview={false} />
</div>

<Item
label={<label style={{ color: 'white' }}>Password</label>}
name="password"
rules={[{ required: true, message: 'Please input your password!' }]}>
<Input.Password />
</Item>
<br />

<Button
size="large"
type="primary"
icon={<MailOutlined />}
className={styles.ButtonStyle}
htmlType="submit">
Sign in with Email
</Button>
</Form>
)}
</Space>
</Card>
<div className={styles.Title}>VandyHacks X</div>

<div className={styles.SignInOptions}>
<Space direction="vertical" size="small" align="center">
{DEV_DEPLOY && ( // email sign in only in dev
<>
<Form
name="basic"
layout="vertical"
onFinish={values => signIn('credentials', { ...values })}
autoComplete="off"
style={{ display: 'flex', flexDirection: 'column' }}>
<Item
name="email"
rules={[{ required: true, message: 'Please input your email!' }]}>
<Input placeholder="Email" />
</Item>

<Item
name="password"
rules={[{ required: true, message: 'Please input your password!' }]}>
<Input.Password placeholder="Password" />
</Item>

<Button
size="large"
type="primary"
icon={<MailOutlined />}
className={styles.ButtonStyle}
htmlType="submit"
style={{ alignSelf: 'center' }}>
Sign in with Email
</Button>
</Form>

<div className={styles.Divider} />
</>
)}

<Button
size="large"
type="primary"
icon={<GoogleOutlined />}
className={styles.ButtonStyle}
onClick={() => signIn('google')}>
Sign in with Google
</Button>

<Button
size="large"
type="primary"
icon={<GithubOutlined />}
className={styles.ButtonStyle}
onClick={() => signIn('github')}>
Sign in with GitHub
</Button>
</Space>
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default async function auth(req: any, res: any) {

theme: {
colorScheme: 'dark',
logo: '/vhlogo-white.svg',
logo: '/vh-logo.png',
},
});
}
16 changes: 16 additions & 0 deletions styles/Signin.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
justify-content: center;
align-items: center;
background-color: #00000099;
flex-direction: column;
max-height: 90%;
gap: 1rem;
}

.Logo {
Expand All @@ -28,6 +31,7 @@
font-size: 2.5rem;
font-weight: 550;
margin-bottom: 1rem;
color: white;
}

.ButtonStyle {
Expand All @@ -41,6 +45,18 @@
border-color: gray;
}

.SignInOptions {
overflow-y: auto;
padding: 1rem;
}

.Divider {
height: 1px;
width: 50px;
background: white;
margin: 25px 0;
}

/* add media query for mobile screen */
@media (max-width: 768px) {
.Logo {
Expand Down
Loading