├── .gitignore ├── src ├── assets │ ├── css │ │ ├── post.css │ │ ├── 404.css │ │ ├── blog.css │ │ ├── componentes │ │ │ ├── button.css │ │ │ ├── table.css │ │ │ ├── card.css │ │ │ ├── inputs.css │ │ │ └── header.css │ │ └── base │ │ │ ├── _variables.css │ │ │ ├── base.css │ │ │ └── _reset.css │ └── img │ │ ├── checkmark.svg │ │ ├── menu.svg │ │ ├── doguito.svg │ │ ├── doguito404.svg │ │ └── doguitoadm.svg ├── setupTests.js ├── index.css ├── reportWebVitals.js ├── App.jsx ├── index.js ├── pages │ ├── Sobre.jsx │ └── Home.jsx └── App.css ├── public ├── robots.txt ├── favicon.ico ├── logo192.png ├── logo512.png ├── manifest.json └── index.html ├── package.json ├── README.md ├── db.json └── .eslintcache /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /src/assets/css/post.css: -------------------------------------------------------------------------------- 1 | .post { 2 | margin-top: 1.25rem; 3 | } -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-es-cursos/1845-react-router/projecto_inicial/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-es-cursos/1845-react-router/projecto_inicial/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-es-cursos/1845-react-router/projecto_inicial/public/logo512.png -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /src/assets/css/404.css: -------------------------------------------------------------------------------- 1 | .dog-image { 2 | width: 100%; 3 | max-width: 25rem; 4 | margin-top: 1.25rem; 5 | margin-bottom: 2rem; 6 | } 7 | 8 | .notfound-text { 9 | font-size: var(--font-size-not-found); 10 | margin-bottom: 1rem; 11 | } 12 | 13 | .notfound-link { 14 | color: var(--primary-color); 15 | } 16 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = (onPerfEntry) => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry) 5 | getFID(onPerfEntry) 6 | getFCP(onPerfEntry) 7 | getLCP(onPerfEntry) 8 | getTTFB(onPerfEntry) 9 | }) 10 | } 11 | } 12 | 13 | export default reportWebVitals 14 | -------------------------------------------------------------------------------- /src/assets/img/checkmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import './assets/css/base/base.css' 3 | import Home from "./pages/Home" 4 | import Sobre from "./pages/Sobre" 5 | 6 | import { 7 | BrowserRouter as Router, 8 | Switch, 9 | Route, 10 | Link 11 | } from "react-router-dom"; 12 | 13 | function App() { 14 | 15 | return ( 16 | <> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ) 27 | } 28 | 29 | export default App 30 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import './index.css' 4 | import App from './App' 5 | import reportWebVitals from './reportWebVitals' 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root'), 12 | ) 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals() 18 | -------------------------------------------------------------------------------- /src/pages/Sobre.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | 4 | import '../assets/css/componentes/card.css' 5 | 6 | const Sobre = () => { 7 | 8 | return ( 9 |
10 |
11 |

Sobre Doguito

12 |
13 |
14 |
15 | El blog de PetShop fue creado para ayudarte con las preguntas más comunes sobre tu mascota. 16 |
17 | 18 |
19 |
20 | ) 21 | } 22 | 23 | export default Sobre 24 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/assets/img/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/assets/css/blog.css: -------------------------------------------------------------------------------- 1 | .category-list { 2 | width: 100%; 3 | box-sizing: border-box; 4 | justify-content: space-evenly; 5 | margin-bottom: 2rem; 6 | } 7 | 8 | .category-list__category { 9 | font-weight: var(--font-size-categories); 10 | background-color: var(--contrast-light-color); 11 | border-radius: 3rem; 12 | padding: 1rem; 13 | } 14 | 15 | .category-list__category--bienestar { 16 | color: var(--contrast-light-color); 17 | background-color: var(--cor-categoria-bienestar); 18 | } 19 | 20 | .category-list__category--comportamiento { 21 | color: var(--contrast-light-color); 22 | background-color: var(--cor-categoria-comportamiento); 23 | } 24 | -------------------------------------------------------------------------------- /src/assets/css/componentes/button.css: -------------------------------------------------------------------------------- 1 | .button { 2 | display: block; 3 | background-color: var(--primary-color); 4 | border-radius: 7px; 5 | width: 100%; 6 | margin-top: 1rem; 7 | max-width: 20rem; 8 | padding: 1.125rem; 9 | box-sizing: border-box; 10 | color: var(--contrast-light-color); 11 | font-size: var(--font-size-button); 12 | align-self: center; 13 | text-align: center; 14 | } 15 | 16 | .simple-button { 17 | border: none; 18 | background-color: unset; 19 | } 20 | 21 | .button--add { 22 | color: var(--primary-color); 23 | } 24 | 25 | .button--delete { 26 | color: var(--danger-color); 27 | } 28 | 29 | .button--edit { 30 | color: var(--success-color); 31 | } 32 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/pages/Home.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Home = () => { 4 | 5 | return ( 6 |
7 |
8 |

Pet noticias

9 |
10 |
11 |
12 |

Baño en perros

13 |

La mayoría de los perros prefieren saltarse la hora del baño, pero el baño juega un papel importante en la salud del pelaje y la piel de su perro, ya que ayuda a mantenerla limpia y libre de suciedad y parásitos. Tener los productos adecuados puede ayudarlo a sentirse más cómodo.

14 |
15 |
16 |
17 | ) 18 | } 19 | 20 | export default Home 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-router", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.4", 7 | "@testing-library/react": "^11.1.0", 8 | "@testing-library/user-event": "^12.1.10", 9 | "axios": "^0.21.0", 10 | "json-server": "^0.16.3", 11 | "react": "^17.0.1", 12 | "react-dom": "^17.0.1", 13 | "react-router-dom": "^5.2.0", 14 | "react-scripts": "4.0.1", 15 | "web-vitals": "^0.2.4" 16 | }, 17 | "scripts": { 18 | "start": "react-scripts start", 19 | "build": "react-scripts build", 20 | "test": "react-scripts test", 21 | "eject": "react-scripts eject" 22 | }, 23 | "eslintConfig": { 24 | "extends": [ 25 | "react-app", 26 | "react-app/jest" 27 | ] 28 | }, 29 | "browserslist": { 30 | "production": [ 31 | ">0.2%", 32 | "not dead", 33 | "not op_mini all" 34 | ], 35 | "development": [ 36 | "last 1 chrome version", 37 | "last 1 firefox version", 38 | "last 1 safari version" 39 | ] 40 | }, 41 | "devDependencies": { 42 | "prettier": "2.2.1" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/assets/css/base/_variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --font-family-body: "Montserrat", sans-serif; 3 | --font-family-logo: "Pacifico", cursive; 4 | --font-family-title-page: "Pacifico", cursive; 5 | 6 | --font-input: 300; 7 | --font-card: 500; 8 | --font-size-categories: 500; 9 | --font-size-menu-header-item: 500; 10 | 11 | --font-logo: 1.75rem; 12 | --font-size-card-title: 1.75rem; 13 | 14 | --font-size-card-post-title: 1.375rem; 15 | --font-size-input-label: 1.25rem; 16 | 17 | --font-size-button: 1.375rem; 18 | --font-size-form-fieldset: 1.375rem; 19 | 20 | --font-table-header: 1.375rem; 21 | --font-size-title-page: 1.75rem; 22 | --font-size-menu-header-item: 1.2rem; 23 | 24 | --font-size-not-found: 1.25rem; 25 | 26 | --primary-color: #0071ea; 27 | --secundary-color: #d6eaff; 28 | --contrast-dark-color: #4d4d4d; 29 | --contrast-light-color: #fff; 30 | --cor-divisao: #dadada; 31 | --danger-color: #df2525; 32 | --success-color: #46bb42; 33 | 34 | --cor-categoria-bienestar: #ff4949; 35 | --cor-categoria-comportamiento: #368dff; 36 | 37 | --shadow: 0 5px 10px #55a6ff38; 38 | } 39 | 40 | @media (min-width: 800px) { 41 | :root { 42 | --font-logo: 2.5rem; 43 | --font-size-menu-header-item: 1rem; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/assets/css/base/base.css: -------------------------------------------------------------------------------- 1 | @import url(_reset.css); 2 | @import url(_variables.css); 3 | @import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&family=Pacifico&display=swap"); 4 | 5 | body { 6 | background-color: var(--secundary-color); 7 | color: var(--contrast-dark-color); 8 | font-family: var(--font-family-body); 9 | } 10 | 11 | .container { 12 | padding-right: 1rem; 13 | padding-left: 1rem; 14 | } 15 | 16 | .flex { 17 | display: flex; 18 | } 19 | 20 | .flex--center { 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | 25 | .flex--column { 26 | flex-direction: column; 27 | } 28 | 29 | .title-page { 30 | display: flex; 31 | align-items: center; 32 | font-family: var(--font-family-title-page); 33 | font-size: var(--font-size-title-page); 34 | background-color: var(--contrast-light-color); 35 | border-radius: 10px; 36 | box-shadow: var(--shadow); 37 | height: 4.75rem; 38 | margin-top: 1.25rem; 39 | margin-bottom: 2rem; 40 | padding-left: 2rem; 41 | } 42 | 43 | @media (min-width: 800px) { 44 | .container { 45 | padding-right: 2.5rem; 46 | padding-left: 2.5rem; 47 | } 48 | } 49 | 50 | @media (min-width: 1200px) { 51 | .container { 52 | padding-left: calc((100vw - 900px) / 2); 53 | padding-right: calc((100vw - 900px) / 2); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/assets/css/componentes/table.css: -------------------------------------------------------------------------------- 1 | .table { 2 | margin-top: 2.25rem; 3 | width: 100%; 4 | background-color: var(--contrast-light-color); 5 | border-radius: 10px; 6 | box-shadow: var(--shadow); 7 | border-collapse: initial; 8 | text-align: left; 9 | } 10 | 11 | .table td:first-of-type, 12 | .table th:first-of-type { 13 | padding-left: 1.75rem; 14 | } 15 | 16 | .table td:last-of-type, 17 | .table th:last-of-type { 18 | padding-right: 1.75rem; 19 | } 20 | 21 | .table thead { 22 | font-size: var(--font-table-header); 23 | } 24 | 25 | .table th { 26 | padding-top: 1.75rem; 27 | padding-bottom: 1.75rem; 28 | border-bottom: 1px solid var(--secundary-color); 29 | } 30 | 31 | .table td { 32 | padding-top: 1rem; 33 | padding-bottom: 1rem; 34 | } 35 | 36 | .table__align--right { 37 | text-align: right; 38 | } 39 | 40 | .table__column--p { 41 | width: 20%; 42 | } 43 | 44 | .table__column--m { 45 | width: 25%; 46 | } 47 | 48 | .table__column--g { 49 | width: 50%; 50 | } 51 | 52 | .table tr:last-of-type td { 53 | padding-bottom: 1.75rem; 54 | } 55 | 56 | .table__botons-control { 57 | display: flex; 58 | align-items: center; 59 | justify-content: flex-end; 60 | } 61 | 62 | .table__botons-control li:first-of-type { 63 | margin-right: 2.25rem; 64 | } 65 | -------------------------------------------------------------------------------- /src/assets/css/componentes/card.css: -------------------------------------------------------------------------------- 1 | .card { 2 | background-color: var(--contrast-light-color); 3 | border-radius: 10px; 4 | box-shadow: var(--shadow); 5 | width: 100%; 6 | max-width: 45rem; 7 | padding: 1.75rem; 8 | box-sizing: border-box; 9 | margin-bottom: 1rem; 10 | } 11 | 12 | .title__card { 13 | font-size: var(--font-size-card-title); 14 | margin-bottom: 1rem; 15 | } 16 | 17 | .text__card { 18 | line-height: 1.2rem; 19 | } 20 | 21 | .post__card { 22 | background-color: var(--contrast-light-color); 23 | border-radius: 10px; 24 | box-shadow: var(--shadow); 25 | width: 100%; 26 | max-width: 25rem; 27 | padding: 1rem 2rem 2rem; 28 | box-sizing: border-box; 29 | margin-bottom: 2.25rem; 30 | border-top: 1rem solid; 31 | } 32 | 33 | .post-card__title { 34 | font-size: var(--font-size-card-post-title); 35 | font-weight: var(--font-card); 36 | margin-bottom: 1rem; 37 | } 38 | 39 | .post-card__meta { 40 | line-height: 1.3rem; 41 | } 42 | 43 | .post-card--bienestar { 44 | border-color: var(--cor-categoria-bienestar); 45 | } 46 | 47 | .post-card--comportamiento { 48 | border-color: var(--cor-categoria-comportamiento); 49 | } 50 | 51 | .posts { 52 | display: flex; 53 | flex-direction: column; 54 | align-items: center; 55 | } 56 | 57 | .post { 58 | margin-top: 25px; 59 | } 60 | 61 | @media (min-width: 900px) { 62 | .posts { 63 | align-items: stretch; 64 | flex-direction: row; 65 | flex-wrap: wrap; 66 | justify-content: space-evenly; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/assets/css/base/_reset.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font: inherit; 19 | vertical-align: baseline; 20 | } 21 | 22 | article, aside, details, figcaption, figure, 23 | footer, header, hgroup, menu, nav, section { 24 | display: block; 25 | } 26 | body { 27 | line-height: 1; 28 | } 29 | ol, ul { 30 | list-style: none; 31 | } 32 | blockquote, q { 33 | quotes: none; 34 | } 35 | blockquote:before, blockquote:after, 36 | q:before, q:after { 37 | content: ''; 38 | content: none; 39 | } 40 | table { 41 | border-collapse: collapse; 42 | border-spacing: 0; 43 | } 44 | 45 | a { 46 | color: inherit; 47 | text-decoration: none; 48 | } 49 | 50 | img { 51 | width: inherit; 52 | } 53 | 54 | button { 55 | font-family: inherit; 56 | font-size: inherit; 57 | color: inherit; 58 | font-weight: inherit; 59 | padding: 0; 60 | border: none; 61 | background-color: unset; 62 | } 63 | 64 | input { 65 | border: none; 66 | color: inherit; 67 | font-size: inherit; 68 | font-weight: inherit; 69 | font-family: inherit; 70 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Petshop 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/assets/css/componentes/inputs.css: -------------------------------------------------------------------------------- 1 | .form { 2 | margin-top: 2rem; 3 | } 4 | 5 | .form__label { 6 | font-size: var(--font-size-form-fieldset); 7 | 8 | margin-bottom: 1rem; 9 | } 10 | 11 | .input-container { 12 | font-weight: var(--font-input); 13 | position: relative; 14 | margin-bottom: 1rem; 15 | display: flex; 16 | flex-direction: column; 17 | justify-content: flex-end; 18 | box-sizing: border-box; 19 | } 20 | 21 | .input { 22 | box-sizing: border-box; 23 | border-bottom: 1px solid var(--secundary-color); 24 | padding: 1.375rem 0.5rem 0.5rem; 25 | height: 3.25rem; 26 | width: 100%; 27 | } 28 | 29 | .input::placeholder { 30 | visibility: hidden; 31 | color: #00000000; 32 | } 33 | 34 | .input:focus { 35 | outline: none; 36 | } 37 | 38 | .input-label { 39 | position: absolute; 40 | top: 1.375rem; 41 | left: 0.5rem; 42 | font-size: var(--font-size-input-label); 43 | 44 | transition: all 0.25s; 45 | } 46 | 47 | .input:not(:placeholder-shown) + .input-label, 48 | .input:focus + .input-label { 49 | font-size: 0.875rem; 50 | top: 0.25rem; 51 | transition: all 0.25s; 52 | } 53 | 54 | .input-container--invalid { 55 | margin-bottom: 0.5rem; 56 | } 57 | 58 | .input-container--invalid .input { 59 | border: 1px solid var(--danger-color); 60 | border-radius: 7px; 61 | } 62 | 63 | .input-container--invalid .input-label { 64 | color: var(--danger-color); 65 | } 66 | 67 | .input-mensagem-erro { 68 | display: none; 69 | } 70 | 71 | .input-container--invalid .input-mensagem-erro { 72 | color: var(--danger-color); 73 | display: block; 74 | margin-top: 0.5rem; 75 | padding-left: 0.5rem; 76 | } 77 | 78 | .textarea { 79 | box-sizing: border-box; 80 | border: 1px solid var(--secundary-color); 81 | padding: 0.5rem; 82 | border-radius: 7px; 83 | width: 100%; 84 | min-height: 3rem; 85 | } 86 | 87 | .textarea-container { 88 | position: relative; 89 | margin-top: 2rem; 90 | margin-bottom: 1rem; 91 | font-weight: var(--font-input); 92 | } 93 | 94 | .textarea::placeholder { 95 | visibility: hidden; 96 | } 97 | 98 | .textarea:focus { 99 | outline: none; 100 | } 101 | 102 | .textarea-label { 103 | position: absolute; 104 | top: 0.5rem; 105 | left: 0.5rem; 106 | font-size: var(--font-size-input-label); 107 | transition: all 0.25s; 108 | } 109 | 110 | .textarea:not(:placeholder-shown) + .textarea-label, 111 | .textarea:focus + .textarea-label { 112 | font-size: 0.875rem; 113 | top: -1.25rem; 114 | transition: all 0.25s; 115 | } 116 | 117 | .textarea-container--invalid { 118 | margin-bottom: 0.5rem; 119 | } 120 | 121 | .textarea-container--invalid .textarea { 122 | border: 1px solid var(--danger-color); 123 | } 124 | 125 | .textarea-container--invalid .textarea-label { 126 | color: var(--danger-color); 127 | } 128 | 129 | .textarea-mensagem-erro { 130 | display: none; 131 | } 132 | 133 | .textarea-container--invalid .textarea-mensagem-erro { 134 | display: block; 135 | color: var(--danger-color); 136 | margin-top: 0.5rem; 137 | padding-left: 0.5rem; 138 | } 139 | -------------------------------------------------------------------------------- /src/assets/img/doguito.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/img/doguito404.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/css/componentes/header.css: -------------------------------------------------------------------------------- 1 | .header { 2 | background-color: var(--contrast-light-color); 3 | border-radius: 0 0 10px 10px; 4 | box-shadow: var(--shadow); 5 | display: grid; 6 | grid-template-columns: 1fr 1fr 1fr; 7 | align-items: center; 8 | height: 4.75rem; 9 | } 10 | 11 | .menu-hamburguer { 12 | width: 1.5rem; 13 | height: 0.75rem; 14 | transition: 0.2s; 15 | } 16 | 17 | .menu-hamburguer--active .menu-hamburguer__icon { 18 | transform: rotate(90deg); 19 | transition: 0.2s; 20 | } 21 | 22 | .menu-hamburguer__icon { 23 | display: block; 24 | width: 100%; 25 | height: 100%; 26 | background-image: url(../../img/menu.svg); 27 | background-size: contain; 28 | } 29 | 30 | .header__logo { 31 | width: 3rem; 32 | } 33 | 34 | .header__title { 35 | font-family: var(--font-family-logo); 36 | font-size: var(--font-logo); 37 | margin-left: 0.5rem; 38 | } 39 | 40 | .menu-header-background { 41 | background-color: #00000020; 42 | position: fixed; 43 | top: 0; 44 | left: -100vw; 45 | width: 100vw; 46 | height: 100vh; 47 | } 48 | 49 | .menu-header { 50 | position: fixed; 51 | left: -100vw; 52 | top: 0; 53 | background-color: var(--contrast-light-color); 54 | width: 70vw; 55 | height: 100vh; 56 | box-sizing: border-box; 57 | font-size: var(--font-size-menu-header-item); 58 | font-weight: var(--font-menu-header-item); 59 | z-index: 10; 60 | transition: 0.25s; 61 | } 62 | 63 | .menu-header__fechar { 64 | position: absolute; 65 | right: -2.5rem; 66 | top: 0.5rem; 67 | color: var(--contrast-light-color); 68 | padding: 1rem; 69 | box-sizing: border-box; 70 | border-radius: 50%; 71 | background-color: var(--primary-color); 72 | } 73 | 74 | .menu-header__fechar::before { 75 | content: "X"; 76 | position: absolute; 77 | left: 50%; 78 | top: 50%; 79 | transform: translate(-50%, -50%); 80 | } 81 | 82 | .menu-item { 83 | display: block; 84 | padding-top: 1.5rem; 85 | padding-left: 1rem; 86 | padding-bottom: 1.5rem; 87 | border-bottom: 1px solid var(--cor-divisao); 88 | } 89 | 90 | .menu-item--entrar { 91 | background-color: var(--primary-color); 92 | color: var(--contrast-light-color); 93 | border: none; 94 | } 95 | 96 | .menu-header--ativo { 97 | left: 0; 98 | top: 0; 99 | transition: 0.25s; 100 | } 101 | 102 | .menu-header--ativo + .menu-header-background { 103 | left: 0; 104 | } 105 | 106 | @media (min-width: 900px) { 107 | .header { 108 | grid-template-areas: "menu logo ."; 109 | height: 6.75rem; 110 | } 111 | 112 | .header-container { 113 | grid-area: logo; 114 | } 115 | 116 | .menu-hamburguer { 117 | display: none; 118 | } 119 | 120 | .menu-header { 121 | justify-self: flex-start; 122 | position: static; 123 | width: fit-content; 124 | height: fit-content; 125 | grid-area: menu; 126 | } 127 | 128 | .menu-header__fechar { 129 | display: none; 130 | } 131 | 132 | .menu-header-background { 133 | display: none; 134 | } 135 | 136 | .menu-items { 137 | display: flex; 138 | align-items: center; 139 | } 140 | 141 | .menu-item { 142 | border: none; 143 | padding: 0; 144 | margin-right: 1rem; 145 | } 146 | 147 | .menu-item--entrar { 148 | border-radius: 2rem; 149 | padding: 1rem 1.5rem; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t 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. 37 | 38 | 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 you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `yarn build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /db.json: -------------------------------------------------------------------------------- 1 | { 2 | "categorias": [ 3 | { 4 | "id": "bienestar", 5 | "nome": "bienestar", 6 | "subcategorias": ["higiene", "salud"] 7 | }, 8 | { 9 | "id": "comportamiento", 10 | "nome": "comportamiento", 11 | "subcategorias": ["entrenamiento", "educacion"] 12 | } 13 | ], 14 | "posts": [ 15 | { 16 | "id": 1, 17 | "title": "Baño en perros", 18 | "metadescription": "Utiliza las herramientas ideales para bañar a tu perro", 19 | "body": "La mayoría de los perros prefieren saltarse la hora del baño, pero el baño juega un papel importante en la salud del pelaje y la piel de su perro, ya que ayuda a mantenerla limpia y libre de suciedad y parásitos. Tener los productos adecuados puede ayudarlo a sentirse más cómodo.", 20 | "categoria": "bienestar", 21 | "subcategoria": "higiene" 22 | }, 23 | { 24 | "id": 2, 25 | "title": "Tu cachorro merece un tapete higiénico", 26 | "metadescription": "El baño que tu cachorro merece", 27 | "body": "Los tapetes higiénicos son una innovación en el mercado de las mascotas, perfectas para que tu perro haga sus necesidades con comodidad y sin ensuciar la casa. Son productos desechables o lavables que garantizan la comodidad de tu mascota.", 28 | "categoria": "bienestar", 29 | "subcategoria": "higiene" 30 | }, 31 | { 32 | "id": 3, 33 | "title": "¿Época de pulgas?", 34 | "metadescription": "Es necesario evitar que tus mascotas contraigan estos parásitos", 35 | "body": "No es la mordedura, sino la reacción alérgica a ella lo que hace que tu perro sienta comezón. Algunas mascotas son hipersensibles a las pulgas y pueden tener una reacción grave con solo un mordisco. Sin embargo, todas las mascotas experimentarán molestias por las picaduras de pulgas. Entonces, tan pronto como veas rasguños repetidos, sospeche de las pulgas.", 36 | "categoria": "bienestar", 37 | "subcategoria": "salud" 38 | }, 39 | { 40 | "id": 4, 41 | "title": "¿Tu mascota está estresada?", 42 | "metadescription": "El cambio de rutina puede ser el mayor factor.", 43 | "body": "Talvez eres de las personas que le dan atención adicional, pero cuando tienes que ir a la oficina o a realizar alguna actividad lo dejas en tu casa, causandole esa falta de atención que le brindas constantemente, lo ideal es mimarlos en la medida cierta. Debido a la pandemia hemos estado más presentes en nuestro hogar lo cuál puede acostumbrar a tu mascota a estar más tiempo contigo.", 44 | "categoria": "comportamiento", 45 | "subcategoria": "educacion" 46 | }, 47 | { 48 | "id": 5, 49 | "title": "¿Cómo entrenar a tu perro para que no tenga miedo?", 50 | "metadescription": "La socialización es un grande factor en este aprendizaje.", 51 | "body": "Solo se puede enseñar a un perro a dejar de tener miedo aumentando su confianza en sí mismo. Esto significa cambiar la forma en que reacciona su mente en determinadas situaciones y convertir las asociaciones negativas en positivas. Hacer esto requiere mucha paciencia y una serie de exposiciones controladas al evento u objeto temido, pero lo suficientemente lejos como para que el perro no se sienta ansioso.", 52 | "categoria": "comportamiento", 53 | "subcategoria": "educacion" 54 | }, 55 | { 56 | "id": 6, 57 | "title": "¿Por qué los gatos ronroñean?", 58 | "metadescription": "El ronroneo es una señal de aviso.", 59 | "body": "Una cosa que los científicos saben con certeza es que la parte del cerebro del gato que controla las vocalizaciones está muy conectada con la parte del cerebro que controla las emociones del gato. Entonces, lo que el gato está “diciendo” es absolutamente un reflejo de como se siente.", 60 | "categoria": "comportamiento", 61 | "subcategoria": "entrenamiento" 62 | }, 63 | { 64 | "id": 7, 65 | "title": "¿Cómo entrenar a tu gato?", 66 | "metadescription": "Si, tu puedes entrenar a tu gato y es mucho más fácil de lo que pensabas.", 67 | "body": "Puedes utilizar herramientas de entrenamiento para una amplia variedad de animales, un 'clicker' solo costará unos pocos dólares y te ayudará a dar un refuerzo positivo cuando aprendas a entrenar a un gato. (También puedes usar un bolígrafo normal con un botón de click; lo importante es tener un ruido distintivo). La mayoría de los entrenamientos para gatos implican darle a tu gato una golosina que le guste después de un click para marcar el comportamiento deseado.", 68 | "categoria": "comportamiento", 69 | "subcategoria": "entrenamiento" 70 | } 71 | ] 72 | } 73 | -------------------------------------------------------------------------------- /.eslintcache: -------------------------------------------------------------------------------- 1 | [{"/Users/harlandlohora/Documents/Alura/1925-React-Router/petshop/src/App.jsx":"1","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/App.jsx":"2","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Page404.jsx":"3","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/Header.jsx":"4","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/ListPosts.jsx":"5","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Post.jsx":"6","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/api/api.js":"7","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/ListCategories.jsx":"8","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Categorie.jsx":"9","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/SubCategory.jsx":"10","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Home.jsx":"11","/Users/harlandlohora/Documents/Alura/react-router-petshop/src/App.jsx":"12","/Users/harlandlohora/Documents/Alura/react-router-petshop/src/pages/Home.jsx":"13","/Users/harlandlohora/Documents/Alura/react-router-petshop/src/pages/Sobre.jsx":"14"},{"size":129,"mtime":1627787604778,"results":"15","hashOfConfig":"16"},{"size":863,"mtime":1627847855133,"results":"17","hashOfConfig":"18"},{"size":368,"mtime":1627834497352,"results":"19","hashOfConfig":"18"},{"size":1078,"mtime":1627836075830,"results":"20","hashOfConfig":"18"},{"size":854,"mtime":1627842738779,"results":"21","hashOfConfig":"18"},{"size":682,"mtime":1627838730158,"results":"22","hashOfConfig":"18"},{"size":219,"mtime":1627838646698,"results":"23","hashOfConfig":"18"},{"size":717,"mtime":1627839447708,"results":"24","hashOfConfig":"18"},{"size":1645,"mtime":1627850315212,"results":"25","hashOfConfig":"18"},{"size":295,"mtime":1627847887645,"results":"26","hashOfConfig":"18"},{"size":374,"mtime":1628180085410,"results":"27","hashOfConfig":"18"},{"size":436,"mtime":1628189914285,"results":"28","hashOfConfig":"29"},{"size":728,"mtime":1628185539380,"results":"30","hashOfConfig":"29"},{"size":498,"mtime":1628185595907,"results":"31","hashOfConfig":"29"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"189fk1x",{"filePath":"34","messages":"35","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"36"},"1sx9070",{"filePath":"37","messages":"38","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"kobwdr",{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/harlandlohora/Documents/Alura/1925-React-Router/petshop/src/App.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/App.jsx",["61"],"import React from 'react'\nimport './assets/css/base/base.css'\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n Link\n} from \"react-router-dom\";\nimport Home from \"./pages/Home\"\nimport About from \"./pages/About\"\nimport Page404 from \"./pages/Page404\";\nimport Header from \"./components/Header\";\nimport Post from \"./pages/Post\";\nimport Categorie from \"./pages/Categorie\";\n\nfunction App() {\n \n return (\n <>\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport default App\n","/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Page404.jsx",["62"],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/Header.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/ListPosts.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Post.jsx",["63"],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/api/api.js",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/components/ListCategories.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Categorie.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/SubCategory.jsx",[],"/Users/harlandlohora/Documents/Alura/Copia de 1925-React-Router/petshop/src/pages/Home.jsx",[],"/Users/harlandlohora/Documents/Alura/react-router-petshop/src/App.jsx",["64","65"],"/Users/harlandlohora/Documents/Alura/react-router-petshop/src/pages/Home.jsx",[],"/Users/harlandlohora/Documents/Alura/react-router-petshop/src/pages/Sobre.jsx",[],{"ruleId":"66","severity":1,"message":"67","line":7,"column":3,"nodeType":"68","messageId":"69","endLine":7,"endColumn":7},{"ruleId":"70","severity":1,"message":"71","line":7,"column":7,"nodeType":"72","endLine":7,"endColumn":59},{"ruleId":"73","severity":1,"message":"74","line":15,"column":6,"nodeType":"75","endLine":15,"endColumn":10,"suggestions":"76"},{"ruleId":"66","severity":1,"message":"77","line":8,"column":3,"nodeType":"68","messageId":"69","endLine":8,"endColumn":9},{"ruleId":"66","severity":1,"message":"67","line":10,"column":3,"nodeType":"68","messageId":"69","endLine":10,"endColumn":7},"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","jsx-a11y/img-redundant-alt","Redundant alt attribute. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.","JSXOpeningElement","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'history'. Either include it or remove the dependency array.","ArrayExpression",["78"],"'Switch' is defined but never used.",{"desc":"79","fix":"80"},"Update the dependencies array to be: [history, id]",{"range":"81","text":"82"},[410,414],"[history, id]"] -------------------------------------------------------------------------------- /src/assets/img/doguitoadm.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------