feat: adicionando o react router dom

This commit is contained in:
Adilson Fernando Neves Ornellas 2023-01-07 16:30:29 -03:00
parent f96a6e9310
commit bae6cd4fb8
11 changed files with 159 additions and 50 deletions

View File

@ -1,46 +1,27 @@
# Getting Started with Create React App
# PROJETO DESAFIO 5 - ADILSON FERNANDO NEVES ORNELLAS - TYPESCRIPT E REACT
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
PROJETO REALIZADO ENTRE OS DIAS 27/12/2022 E 15/01/2023
# LEYOUT DO PROJETO
## Available Scripts
https://www.figma.com/file/wy2rXH3gsH20KgfUpHh4oz/Desafio-Institucional-React.js?node-id=0%3A1
In the project directory, you can run:
# RODANDO O PROJETO
1 - Entrar na pasta "adilson-fernando"
2 - abrir o terminal dentro a pasta
3 - digitar " npm i " e enter
4 - digitar " npm start "
### `npm start`
E o propjeto já irá ser abertro em seu navegador no http://localhost:3000/
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
# FERRAMENTAS USADAS NO PROJETO
- CREATE REACT-APP TYPESCRIPT
- HTML
- CSS SCSS
- SCSS MODULES
- TYPESCRIPT E REACT
- REACT ROUTER DOM
- MENU MODEL
- ACCORDION
- FORMIK
- YUP

View File

@ -0,0 +1,12 @@
import React from "react";
const Entrega = () =>{
return (
<>
</>
);
}
export default Entrega ;

View File

@ -0,0 +1,11 @@
import React from "react";
const FormaDePagamento = () =>{
return (
<>
</>
);
}
export default FormaDePagamento ;

View File

@ -3,6 +3,7 @@ import React from "react";
import "../../styles/Global.scss";
import "../../styles/Variaveis.scss";
import Newsletter from "./Newsletter";
import Router from "./Router";
import styles from "../../styles/Main.module.scss";
@ -10,14 +11,14 @@ import casinhaInstitucional from "../../assets/images/casinhaInstitucional.png";
const Main = () => {
return (
<main className={styles["main"]}>
<a className={styles["link-casinha"]} href="/">
<img className={styles["img-casinha"]} src={casinhaInstitucional} alt="Icone Casinha + Institucional" />
</a>
<h1 className={styles["main-titulo"]}>INSTITUCIONAL</h1>
<Newsletter/>
</main>
<main className={styles["main"]}>
<a className={styles["link-casinha"]} href="/">
<img className={styles["img-casinha"]} src={casinhaInstitucional} alt="Icone Casinha + Institucional" />
</a>
<h1 className={styles["main-titulo"]}>INSTITUCIONAL</h1>
<Router />
<Newsletter />
</main>
);
};

View File

@ -0,0 +1,53 @@
import React from "react";
import { Route, NavLink, Routes } from "react-router-dom";
import "../../styles/Global.scss";
import "../../styles/Variaveis.scss";
import styles from "../../styles/Router.module.scss";
import Sobre from "./Sobre";
import FormaDePagamento from "./FormaDePagamento";
import Entrega from "./Entrega";
import Troca from "./Troca";
import Segurança from "./Segurança";
import Contato from "./contato";
const Router = () => {
return (
<>
<nav>
<ul>
<li>
<NavLink to="/">Sobre</NavLink>
</li>
<li>
<NavLink to="/formadepagamento">Forma De Pagamento</NavLink>
</li>
<li>
<NavLink to="/entrega">Entrega</NavLink>
</li>
<li>
<NavLink to="/troca">Troca</NavLink>
</li>
<li>
<NavLink to="/segurança">Segurança</NavLink>
</li>
<li>
<NavLink to="/contato">Sobre</NavLink>
</li>
</ul>
</nav>
<Routes>
<Route element={<Sobre />} path="/" />
<Route element={<FormaDePagamento />} path="/formadepagamento" />
<Route element={<Entrega />} path="/entrega" />
<Route element={<Troca />} path="/troca" />
<Route element={<Segurança />} path="/segurança" />
<Route element={<Contato />} path="/contato" />
</Routes>
</>
);
};
export default Router;

View File

@ -0,0 +1,12 @@
import React from "react";
const Segurança = () =>{
return (
<>
</>
);
}
export default Segurança ;

View File

@ -0,0 +1,12 @@
import React from "react";
const Sobre = () =>{
return (
<>
<h1>hello</h1>
</>
);
}
export default Sobre ;

View File

@ -0,0 +1,12 @@
import React from "react";
const Troca = () =>{
return (
<>
</>
);
}
export default Troca ;

View File

@ -0,0 +1,12 @@
import React from "react";
const Contato = () =>{
return (
<>
</>
);
}
export default Contato ;

View File

@ -1,6 +1,7 @@
// Esssencias
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter} from "react-router-dom";
// Projeto Adilson
import Home from "./pages/Home";
@ -12,6 +13,8 @@ const root = ReactDOM.createRoot(
root.render(
<React.StrictMode>
<Home/>
<BrowserRouter>
<Home/>
</BrowserRouter>
</React.StrictMode>
);