Skip to content

Commit

Permalink
add sign up page
Browse files Browse the repository at this point in the history
  • Loading branch information
arthursvpb committed Sep 3, 2022
1 parent 83a4e59 commit 3a19d95
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 5 deletions.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"antd": "^4.22.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
93 changes: 89 additions & 4 deletions web/src/components/FormRegisterAuth/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,94 @@
import { Form, Input } from 'antd';
import './styles.scss';

import { Button, Checkbox, Form, Input } from 'antd';
import { LoginOutlined } from '@ant-design/icons';

export const FormRegisterAuth = () => {
return (
<Form.Item>
<Input placeholder="Full Name" />
</Form.Item>
<div className="authContainer">
<LoginOutlined className="loginOutlinedSVG" style={{ color: 'var(--green-500)' }} />
<h1>Psychologist Center</h1>
<p>Create your account</p>
<Form.Item
name="name"
rules={[
{
required: true,
message: 'Please input your name.',
},
]}
>
<Input placeholder="Name" />
</Form.Item>
<Form.Item
name="email"
rules={[
{
type: 'email',
message: 'The input is not valid e-mail.',
},
{
required: true,
message: 'Please input your e-mail.',
},
]}
>
<Input placeholder="E-mail" />
</Form.Item>
<Form.Item
name="password"
rules={[
{
required: true,
message: 'Please input your password!',
},
]}
hasFeedback
>
<Input.Password placeholder="Password" />
</Form.Item>
<Form.Item
name="confirm"
dependencies={['password']}
hasFeedback
rules={[
{
required: true,
message: 'Please confirm your password.',
},
({ getFieldValue }) => ({
validator(_, value) {
if (!value || getFieldValue('password') === value) {
return Promise.resolve();
}

return Promise.reject(new Error('The two passwords that you entered do not match.'));
},
}),
]}
>
<Input.Password placeholder="Confirm your password" />
</Form.Item>

<Form.Item
name="agreement"
valuePropName="checked"
rules={[
{
validator: (_, value) =>
value ? Promise.resolve() : Promise.reject(new Error('Should accept agreement')),
},
]}
>
<Checkbox>
I have read the <a href="">agreement</a>
</Checkbox>
</Form.Item>
<Form.Item>
<Button type="secondary" htmlType="submit">
Sign up
</Button>
</Form.Item>
</div>
);
};
37 changes: 37 additions & 0 deletions web/src/components/FormRegisterAuth/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.authContainer {
.loginOutlinedSVG {
display: block;
text-align: center;
font-size: 50px;
margin-top: 15px;
margin-bottom: 15px;
}

h1 {
text-align: center;
font-size: 30px;
color: var(--blue-400);
margin: 0;
}

p {
text-align: center;
color: var(--blue-400);
margin-bottom: 20px;
}

button {
float: right;
background-color: var(--green-500);
color: white;
}

border: 1px solid var(--gray-300);
padding: 20px;
max-width: 600px;
margin: auto;

background: #ffffff;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
2 changes: 1 addition & 1 deletion web/src/components/Page/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function Page({ children, user }) {
className="site-layout-background"
style={{
padding: 24,
minHeight: 360,
minHeight: '90vh',
}}
>
{children}
Expand Down

0 comments on commit 3a19d95

Please sign in to comment.