Skip to content

Commit 6bc4491

Browse files
Merge branch 'develop' into feature/implementing-use-context
2 parents 3115097 + c483381 commit 6bc4491

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed

src/components/Select/Select.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React, { SelectHTMLAttributes } from 'react';
2+
import { StyledSelect } from './styles';
3+
4+
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
5+
title: string;
6+
color?: string;
7+
Size?: string;
8+
styleWidth?: string;
9+
}
10+
11+
const Select: React.FC<SelectProps> = ({
12+
title,
13+
id,
14+
color,
15+
Size,
16+
styleWidth,
17+
...rest
18+
}: SelectProps) => {
19+
return (
20+
<StyledSelect
21+
SelectWidth={styleWidth || '23.75rem'}
22+
Color={color || 'var(--black)'}
23+
Size={Size || '1.5rem'}
24+
>
25+
<h3>{title}</h3>
26+
27+
<select name={title} id={id} {...rest} />
28+
29+
</StyledSelect>
30+
);
31+
};
32+
33+
Select.defaultProps = {
34+
Size: '',
35+
styleWidth: '23.75rem',
36+
color: '',
37+
};
38+
39+
export default Select;

src/components/Select/styles.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import styled from 'styled-components';
2+
3+
interface Props {
4+
SelectWidth: string;
5+
Color: string;
6+
Size: string;
7+
}
8+
9+
export const StyledSelect = styled.div<Props>`
10+
display: flex;
11+
flex-direction: column;
12+
13+
width: ${props => props.SelectWidth || '23.75rem'};
14+
15+
margin: 0;
16+
17+
select {
18+
display: flex;
19+
align-items: center;
20+
padding-left: 0.625rem;
21+
height: 4.063rem;
22+
background-color: var(--soft-gray);
23+
24+
font-family: Roboto;
25+
font-size: 1.3rem;
26+
font-style: normal;
27+
font-weight: bold;
28+
29+
outline: none;
30+
border: 0;
31+
border-radius: 1.25rem;
32+
33+
width: ${props => props.SelectWidth || '23.75rem'}
34+
}
35+
36+
`;

src/pages/InviteUsers/index.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react';
2+
3+
import Input from 'components/Input/Input';
4+
import Button from 'components/Button/Button';
5+
import Select from 'components/Select/Select';
6+
7+
import StyleInviteUsers from './styles';
8+
9+
function index() {
10+
return (
11+
<StyleInviteUsers>
12+
<h1>Convidar Participante</h1>
13+
14+
<div className="EmailAndPermission">
15+
<Input
16+
title="E-mail"
17+
color="black"
18+
Size="large"
19+
styleWidth="41.875rem"
20+
/>
21+
22+
<Select
23+
title="Nível de permissão"
24+
color="black"
25+
styleWidth="41.875rem"
26+
>
27+
<option value="Admin">Administrador</option>
28+
<option value="Manager">Gerente</option>
29+
<option value="Normal">Comum</option>
30+
31+
</Select>
32+
33+
<Button
34+
color="var(--black)"
35+
colorText="white"
36+
size="23.75rem"
37+
>
38+
Convidar
39+
40+
</Button>
41+
42+
</div>
43+
</StyleInviteUsers>
44+
);
45+
}
46+
47+
export default index;

src/pages/InviteUsers/styles.tsx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import styled from 'styled-components';
2+
3+
export const StyleInviteUsers = styled.div`
4+
display: flex;
5+
flex-direction: column;
6+
align-items: center;
7+
justify-content: center;
8+
9+
margin-top: 4.375rem;
10+
11+
h1 {
12+
font-family: Roboto;
13+
font-style: normal;
14+
font-weight: 900;
15+
font-size: 3.125rem;
16+
color: #CECFD0;
17+
}
18+
19+
20+
.EmailAndPermission {
21+
display: flex;
22+
align-items: center;
23+
justify-content: center;
24+
flex-direction: column;
25+
26+
margin-top: 13.25rem;
27+
28+
align-items: flex-end;
29+
30+
31+
Input {
32+
margin-bottom: 2rem;
33+
}
34+
35+
Button {
36+
margin-top: 4rem;
37+
width: 14.063rem;
38+
}
39+
}
40+
41+
42+
`;
43+
44+
export default StyleInviteUsers;

src/routes.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Switch, Route, BrowserRouter } from 'react-router-dom';
55
import NewPassword from 'pages/NewPassword';
66
import Main from './pages/Main';
77
import Login from './pages/Login';
8+
import InviteUsers from './pages/InviteUsers';
89

910
export default function Routes() {
1011
return (
@@ -14,6 +15,7 @@ export default function Routes() {
1415
<Route path="/recovery-password" exact component={RecoveryPassword} />
1516
<Route path="/new-password" exact component={NewPassword} />
1617
<Route path="/login" exact component={Login} />
18+
<Route path="/invite-users" exact component={InviteUsers} />
1719
</Switch>
1820
</BrowserRouter>
1921
);

0 commit comments

Comments
 (0)