Skip to content

Commit

Permalink
💡 (#180) Adicionando as rotas
Browse files Browse the repository at this point in the history
  • Loading branch information
julisous committed Nov 1, 2023
1 parent 6b893f4 commit 43b0855
Show file tree
Hide file tree
Showing 9 changed files with 338 additions and 205 deletions.
27 changes: 12 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import React from "react";
import {BrowserRouter, Routes , Route} from "react-router-dom"
import Home from "./pages/Home"
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Home from "./pages/Home";
import CreateUserPage from "./pages/CreateUser";
import Login from "./pages/Login";
import Contact from "./pages/Contact";
import AboutUs from "./pages/AboutUs";
import ChangePassword from "./pages/ChangePassword";



function App(){

function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Home/>}/>
<Route path="/cadastro" element={<CreateUserPage/>}/>
<Route path="/login" element={<Login/>}/>
<Route path="/contato" element={<Contact/>}/>
<Route path="/quemsomos" element={<AboutUs/>}/>
<Route path="/changePassword" element={<ChangePassword/>}/>
</Routes>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/cadastro" element={<CreateUserPage />} />
<Route path="/login" element={<Login />} />
<Route path="/contato" element={<Contact />} />
<Route path="/quemsomos" element={<AboutUs />} />
<Route path="/mudarsenha" element={<ChangePassword />} />
</Routes>
</BrowserRouter>
);
}

export default App;
export default App;
9 changes: 7 additions & 2 deletions src/components/navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ const Navbar = () => {
<button className="home-navbar">
<a href="http://localhost:3000/">Home</a>
</button>
<button className="aboutUs-navbar">Quem Somos</button>
<button className="contact-navbar">Contato</button>
<button className="aboutUs-navbar">
<a href="http://localhost:3000/quemsomos">Quem Somos</a>
</button>
<button className="contact-navbar">
{" "}
<a href="http://localhost:3000/contato">Contato</a>
</button>
</div>

<div className="dropdown-navbar-users">
Expand Down
31 changes: 31 additions & 0 deletions src/components/navbar/NavbarSimple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";
import "../../style/components/navbarSimple.css";
import logo from "../../assets/logo 3.svg";

const NavbarSimple = () => {
return (
<div className="container-navbar-simple">
<img alt="" src={logo}></img>

<div className="button-navbar-simple">
<button className="home-navbar-simple">
<a href="http://localhost:3000/">Home</a>
</button>
<button className="aboutUs-navbar-simple">
<a href="http://localhost:3000/quemsomos">Quem Somos</a>
</button>
<button className="contact-navbar-simple">
{" "}
<a href="http://localhost:3000/contato">Contato</a>
</button>
</div>

<div className="button-login-navbar-simple">
<button className="login-navbar-simple">
<a href="http://localhost:3000/login">Login</a>
</button>
</div>
</div>
);
};
export default NavbarSimple;
65 changes: 40 additions & 25 deletions src/pages/AboutUs.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
import React from 'react';
import '../style/pages/aboutUs.css';
import PoliciaCivilLogo from '../assets/PoliciaCivilLogo.svg';
import elipse from '../assets/home_elipse.svg';

import React from "react";
import "../style/pages/aboutUs.css";
import PoliciaCivilLogo from "../assets/PoliciaCivilLogo.svg";
import elipse from "../assets/home_elipse.svg";
import NavbarSimple from "../components/navbar/NavbarSimple";

export default function AboutUs() {

return (
<div className="container-about-us">
<div className="texto">
<h2 className='h2-label'>Quem Somos</h2>
<p>
O PrintGO tem a finalidade de corrigir o problema chave que foi definido junto com a visão do produto, que diz: Os servidores da Polícia Civil do Goiás não possuem uma ferramenta de monitoração de impressoras e impressão, mesmo que os servidores precisem monitorar e registrar valores de contadores nas unidades policias nos municípios de Goiás. O PrintGO é uma ferramenta de monitoramento de ativos de impressão que simplifica a tarefa de monitorar e registrar informações relacionadas ao uso e manutenção das impressoras de forma a garantir um acompanhamento preciso e eficaz.
</p>
<p>
A aplicação web foi feita sob encomenda para a Polícia Civil do estado do Goiás pela Universidade de Brasília, UnB, sob supervisão das disciplinas de EPS e MDS juntamente com seus monitores e professor.
</p>
</div>
<div className="logo-about-us">
<img src={PoliciaCivilLogo} alt="PoliciaCivilLogo" className="PoliciaCivilLogo" />
</div>

<div className="ellipse-about">
<img alt="" src={elipse}></img>
<>
<NavbarSimple />
<div className="container-about-us">
<div className="texto">
<h2 className="h2-label">Quem Somos</h2>
<p>
O PrintGO tem a finalidade de corrigir o problema chave que foi
definido junto com a visão do produto, que diz: Os servidores da
Polícia Civil do Goiás não possuem uma ferramenta de monitoração de
impressoras e impressão, mesmo que os servidores precisem monitorar
e registrar valores de contadores nas unidades policias nos
municípios de Goiás. O PrintGO é uma ferramenta de monitoramento de
ativos de impressão que simplifica a tarefa de monitorar e registrar
informações relacionadas ao uso e manutenção das impressoras de
forma a garantir um acompanhamento preciso e eficaz.
</p>
<p>
A aplicação web foi feita sob encomenda para a Polícia Civil do
estado do Goiás pela Universidade de Brasília, UnB, sob supervisão
das disciplinas de EPS e MDS juntamente com seus monitores e
professor.
</p>
</div>
<div className="logo-about-us">
<img
src={PoliciaCivilLogo}
alt="PoliciaCivilLogo"
className="PoliciaCivilLogo"
/>
</div>

<div className="ellipse-about">
<img alt="" src={elipse}></img>
</div>
</div>
</div>
</>
);
}


141 changes: 73 additions & 68 deletions src/pages/ChangePassword.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,83 @@
import React,{ useState } from "react";
import '../style/pages/changePassword.css';
import ChangePasswordPeople from '../assets/change-password-people.svg';
import elipse6 from '../assets/elipse6.svg';
import React, { useState } from "react";
import "../style/pages/changePassword.css";
import ChangePasswordPeople from "../assets/change-password-people.svg";
import elipse6 from "../assets/elipse6.svg";
import { changePassword } from "../api/api";
import Navbar from "../components/navbar/Navbar";

export default function ChangePassword() {
const [password, setPassword] = useState("");
const [passwordConfirmation, setPasswordConfirmation] = useState("");
const [error, setError] = useState(null);
const [success, setSuccess] = useState(false);
const [password, setPassword] = useState("");
const [passwordConfirmation, setPasswordConfirmation] = useState("");
const [error, setError] = useState(null);
const [success, setSuccess] = useState(false);

const handleSubmit = async (e) => {
e.preventDefault();

const handleSubmit = async (e) => {
e.preventDefault();

try {
const response = await changePassword(password, passwordConfirmation);

if(response) {
setSuccess(true)
setPassword('')
setPasswordConfirmation('')
}
} catch (error) {
console.log(error);
setError('Erro ao trocar de senha');
}
}
try {
const response = await changePassword(password, passwordConfirmation);

return (
<div className="change-password-container">
<div className="image-container">
<img src={ChangePasswordPeople} alt="Pessoas"/>
</div>
<div className="form-container">
<form className="form" onSubmit={handleSubmit}>
<div className="input-container">
<div className="form-title">Mudar senha</div>
<div className="form-group">
<div className="input-form-container">
<label className="label-change-password">Nova Senha</label>
<input
type="password"
name="password"
placeholder="*****************"
className="input-field"
value={password}
onChange={e => setPassword(e.target.value)}
/>
</div>
<div className="input-form-container">
<label className="label-change-password">Repita a senha</label>
<input
type="password"
name="passwordConfirmation"
placeholder="*****************"
className="input-field"
value={passwordConfirmation}
onChange={e => setPasswordConfirmation(e.target.value)}
/>
</div>
</div>
<div className="button-container">
<input type="submit" value="Confirmar" className="button"/>
</div>
{error && <h5 style={{color: 'red'}}>{error}</h5>}
{success && <h5 style={{color: 'green'}}>Senha atualizada!</h5>}
</div>
</form>
if (response) {
setSuccess(true);
setPassword("");
setPasswordConfirmation("");
}
} catch (error) {
console.log(error);
setError("Erro ao trocar de senha");
}
};

<div className="elipse-change-pass">
<img src={elipse6} alt="elipse_azul"></img>
return (
<>
<Navbar />
<div className="change-password-container">
<div className="image-container">
<img src={ChangePasswordPeople} alt="Pessoas" />
</div>
<div className="form-container">
<form className="form" onSubmit={handleSubmit}>
<div className="input-container">
<div className="form-title">Mudar senha</div>
<div className="form-group">
<div className="input-form-container">
<label className="label-change-password">Nova Senha</label>
<input
type="password"
name="password"
placeholder="*****************"
className="input-field"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
<div className="input-form-container">
<label className="label-change-password">
Repita a senha
</label>
<input
type="password"
name="passwordConfirmation"
placeholder="*****************"
className="input-field"
value={passwordConfirmation}
onChange={(e) => setPasswordConfirmation(e.target.value)}
/>
</div>
</div>
<div className="button-container">
<input type="submit" value="Confirmar" className="button" />
</div>
{error && <h5 style={{ color: "red" }}>{error}</h5>}
{success && <h5 style={{ color: "green" }}>Senha atualizada!</h5>}
</div>
</form>

<div className="elipse-change-pass">
<img src={elipse6} alt="elipse_azul"></img>
</div>
</div>
)
}
</div>
</>
);
}
Loading

0 comments on commit 43b0855

Please sign in to comment.