├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── public └── index.html └── src ├── App.js ├── assets ├── About.png ├── Contact.png ├── Home.png ├── pexels-alex-staudinger-1732414.jpg ├── pexels-binyamin-mellish-186078.png └── pexels-pixabay-271816.jpg ├── components ├── Content.jsx ├── Details.jsx ├── DrawerItem.jsx ├── Footer │ ├── Footer.jsx │ ├── FooterLink.jsx │ └── FooterTitle.jsx ├── Gallery.jsx ├── GetInTouch.jsx ├── GetStarted.jsx ├── Header.jsx ├── Navbar.jsx ├── Paragraph.jsx └── Title.jsx ├── index.js └── pages ├── About.js ├── Contact.js └── Home.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Alessandra Do Couto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Landing Page Template com React JS e Material UI :dart: 2 | 3 | Site: https://hbsales.onrender.com/ 4 | 5 | ![link Home do site](https://raw.githubusercontent.com/alessandradocouto/landing-page-template-reactjs/master/src/assets/Home.png) 6 | 7 | 8 | ![link About do site](https://raw.githubusercontent.com/alessandradocouto/landing-page-template-reactjs/master/src/assets/About.png) 9 | 10 | ![link Contact do site](https://raw.githubusercontent.com/alessandradocouto/landing-page-template-reactjs/master/src/assets/Contact.png) 11 | 12 | 13 | 14 | ## Índice 15 | 16 | - [Sobre](https://github.com/alessandradocouto/landing-page-template-reactjs#sobre) 17 | - [Aprendizados](https://github.com/alessandradocouto/landing-page-template-reactjs#aprendizados) 18 | - [Dependências](https://github.com/alessandradocouto/landing-page-template-reactjs#dependências) 19 | 20 | 21 | 22 | ## Sobre 23 | 24 | Landing page Template em React JS feita para desenvolvedores/designs que querem criar rapidamente uma landing page profissional para seus projetos open source. 25 | 26 | 27 | ## Aprendizados 28 | 29 | :heavy_check_mark: React Router v6+ no DOM 30 | 31 | No App.js 32 | 33 | `import {BrowserRouter, Routes, Route} from react-router-dom';` 34 | 35 | O componente **Navbar** tem elementos que se repetem em todas as páginas e tem elementos que estão em 'Routes', logo fica dentro de 'BrowserRouter'. 36 | 37 | ``` 38 | 39 | 40 | 41 | } /> 42 | } /> 43 | } /> 44 | 45 | 46 | ``` 47 | 48 | Dentro da pasta pages :file_folder: e no arquivo :page_with_curl: Home.js 49 | 50 | ``` 51 | const Home = () => { 52 | return ( 53 | <> 54 |
55 | 56 | 57 | 58 | 59 | ) 60 | } 61 | ``` 62 | 63 | 64 | Dentro do componente **Navbar**: 65 | 66 | ``` 67 | import { Link } from 'react-router-dom'; 68 | 69 | const itemList = [ 70 | { 71 | text: "Home", 72 | to: "/" 73 | }, 74 | { 75 | text: "About", 76 | to: "/about" 77 | }, 78 | { 79 | text: "Contact", 80 | to: "/contact" 81 | } 82 | ]; 83 | 84 | 85 | const Navbar = () => { 86 | 87 | return ( 88 | 96 | 97 | 102 | HBSales 103 | 104 | 105 | 106 | {itemList.map( ( item ) => { 107 | const { text } = item; 108 | return( 109 | 110 | 119 | 120 | 121 | 122 | ) 123 | })} 124 | 125 | 126 | 127 | ) 128 | } 129 | 130 | export default Navbar; 131 | ``` 132 | 133 | 134 | 135 | :heavy_check_mark: Utilização de sx e breakpoints em Material UI 136 | 137 | O que é [sx](https://mui.com/system/getting-started/the-sx-prop/)? 138 | 139 | A propriedade sx permite que você trabalhe com um superconjunto de CSS que empacota todas as funções de estilo expostas em @mui/system. Você pode especificar qualquer CSS válido usando este suporte, bem como muitas propriedades com reconhecimento de tema que são exclusivas do MUI System. 140 | 141 | 142 | ``` 143 | 144 | sx={{ 145 | px: 4, 146 | }} 147 | 148 | 149 | 150 | 151 | sx={{ 152 | order: {xs: 4, sm: 4, md: 3} 153 | }} 154 | 155 | ``` 156 | 157 | 158 | :heavy_check_mark: Uso de Componentes reutilizáveis em React; 159 | 160 | Conteúdo do componente Title: 161 | 162 | ``` 163 | import { Typography } from '@mui/material' 164 | import React from 'react' 165 | 166 | const Title = ({ text, textAlign }) => { 167 | return ( 168 | 176 | {text} 177 | 178 | ) 179 | } 180 | 181 | export default Title; 182 | ``` 183 | 184 | 185 | :heavy_check_mark: Utilização de Styled-Components com Material UI 186 | 187 | Personlizar o 'Box' 188 | 189 | ``` 190 | const ListMenu = styled(List)(({ theme }) => ({ 191 | display: 'none', 192 | [theme.breakpoints.up("sm")] : { 193 | display: "flex", 194 | }, 195 | })); 196 | ``` 197 | 198 | 199 | 200 | :heavy_check_mark: Design responsivo e mobile first; 201 | 202 | [Uso de Grid no Material UI](https://mui.com/material-ui/react-grid/) 203 | 204 | ```react 205 | 206 | 211 | 212 | ``` 213 | 214 | 215 | :heavy_check_mark: Uso de Menu mobile com MUI (Drawer) 216 | 217 | [Drawer para usod e menu Mobile/Hamburguer](https://mui.com/material-ui/react-drawer/) 218 | 219 | 220 | 221 | 222 | ## Dependências 223 | 224 | - [Material UI v5](https://www.npmjs.com/package/@mui/material) - Pacotes de utilidades de CSS para layouts. 225 | 226 | ` npm install @mui/material @emotion/react @emotion/styled ` 227 | 228 | 229 | - [react router v6+]("react-router-dom": "^6.6.1") - Pacote para usar React Router em aplicativos Web. 230 | 231 | `npm i react-router-dom` 232 | 233 | 234 | - [react responsive carousel v3.2+](https://www.npmjs.com/package/react-responsive-carousel) - Carousel responsivo e customizável para galeria de iamgens. 235 | 236 | `npm i react-responsive-carousel` 237 | 238 | 239 | - [react animation](https://www.npmjs.com) - Animação de Componentes 240 | 241 | 242 | ## 243 | 244 | ### Clonar o repositorio: 245 | 246 | `git clone https://github.com/nome-usuario/nome-projeto.git` 247 | 248 | ### Instalar dependências 249 | 250 | `npm install` 251 | 252 | ### Rodar aplicação 253 | 254 | `npm start` 255 | 256 | Abra o link [http://localhost:3000](http://localhost:3000) 257 | 258 | ### Criar pasta build 259 | 260 | `npm run build` 261 | 262 | ### Testar aplicação: 263 | 264 | `npm test` 265 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "landing-page-reactjs-materialui", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@emotion/react": "^11.10.5", 7 | "@emotion/styled": "^11.10.5", 8 | "@mui/icons-material": "^5.11.0", 9 | "@mui/material": "^5.11.2", 10 | "@testing-library/jest-dom": "^5.16.5", 11 | "@testing-library/react": "^13.4.0", 12 | "@testing-library/user-event": "^13.5.0", 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0", 15 | "react-responsive-carousel": "^3.2.23", 16 | "react-router-dom": "^6.6.1", 17 | "react-scripts": "5.0.1", 18 | "web-vitals": "^2.1.4" 19 | }, 20 | "scripts": { 21 | "start": "react-scripts start", 22 | "build": "react-scripts build", 23 | "test": "react-scripts test", 24 | "eject": "react-scripts eject" 25 | }, 26 | "eslintConfig": { 27 | "extends": [ 28 | "react-app", 29 | "react-app/jest" 30 | ] 31 | }, 32 | "browserslist": { 33 | "production": [ 34 | ">0.2%", 35 | "not dead", 36 | "not op_mini all" 37 | ], 38 | "development": [ 39 | "last 1 chrome version", 40 | "last 1 firefox version", 41 | "last 1 safari version" 42 | ] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 15 | 21 | HBSales - New home buying experience for you 22 | 23 | 24 | 25 |
26 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from'react'; 2 | //rotas 3 | import {BrowserRouter, Routes, Route} from 'react-router-dom'; 4 | //pages 5 | import Home from './pages/Home'; 6 | import About from './pages/About'; 7 | import Contact from './pages/Contact'; 8 | //componentes 9 | import Navbar from './components/Navbar'; 10 | import Footer from './components/Footer/Footer'; 11 | 12 | function App() { 13 | return ( 14 | <> 15 | 16 | 17 | 18 | } /> 19 | } /> 20 | } /> 21 | 22 | 23 |