Skip to content

Commit

Permalink
[feat](#80) Add Cadastrar Imovel Page
Browse files Browse the repository at this point in the history
Co-authored-by: MarianaPRio <[email protected]>
  • Loading branch information
Rocsantos and MarianaPRio authored Jan 29, 2023
1 parent 0eac2e9 commit 003ef5d
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
55 changes: 55 additions & 0 deletions app/frontend/src/Pages/CreateBuilding/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { Page, Container, Title, Form, ButtonDiv, SmallInput } from './style';
import { Input } from "../../Components/Input";
import { CustomButton } from "../../Components/CustomButton";

const CreateBuilding = () => {
const navigate = useNavigate();

const [cpfProprietario, setCpfProprietario] = useState('');
const [informacao, setInformacao] = useState('');

return (
<Page>
<Container>
<Title>Adicionar Imóvel ao Condomínio</Title>
<Form>
<SmallInput>
<Input label = "CPF do Proprietário"
type = "text"
setText = {setCpfProprietario}
value = {cpfProprietario}
size = "100%"
/>
</SmallInput>
<SmallInput>
<Input label = "Informação Complementar"
type = "text"
setText = {setInformacao}
value = {informacao}
size="100%"
/>
</SmallInput>
</Form>
<ButtonDiv>
<CustomButton
label="Voltar"
color="inherit"
onClick={() => navigate('/')}
/>
<CustomButton
label="Cadastrar"
color="primary"
onClick={() => {
alert('Cadastrou');
navigate('/cadastrar-imovel')
}}
/>
</ButtonDiv>
</Container>
</Page>
);
}

export { CreateBuilding };
51 changes: 51 additions & 0 deletions app/frontend/src/Pages/CreateBuilding/style.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import styled from "styled-components";

const Page = styled.div`
display: flex;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
background: white;
`;

const Container = styled.div`
background-color: white;
display: flex;
width: 40%;
height: 40%;
justify-content: flex-start;
align-items: center;
flex-direction: column;
padding: 1rem;
`;

const Form = styled.div`
display: flex;
flex-direction: column;
width: 100%;
gap: 1rem;
margin-top: 2rem;
box-sizing: border-box;
`;

const Title = styled.h1`
margin: 0;
`;

const SmallInput = styled.div`
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
`;

const ButtonDiv = styled.div`
margin-top: 1rem;
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
`;

export { Page, Container, Form, Title, SmallInput, ButtonDiv };
2 changes: 2 additions & 0 deletions app/frontend/src/Routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Login } from "../Pages/Login";
import { Signup } from "../Pages/Signup";
import { FirstAccess } from "../Pages/FirstAccess";
import { JoinCode } from "../Pages/JoinCode";
import { CreateBuilding } from "../Pages/CreateBuilding";

const Routes = () => {
return (
Expand All @@ -17,6 +18,7 @@ const Routes = () => {
<Route path="/criar-conta" element={<Signup />} />
<Route path="/primeiro-acesso" element={<FirstAccess />} />
<Route path="/codigo-acesso" element={<JoinCode />} />
<Route path="/cadastrar-imovel" element={<CreateBuilding />}/>
{/* </Route> */}

{/* <Route path="/denied" element={<PermissionDenied />} /> */}
Expand Down

0 comments on commit 003ef5d

Please sign in to comment.