Skip to content

Commit

Permalink
Refactorizacion para React Router
Browse files Browse the repository at this point in the history
  • Loading branch information
NaFrust committed Apr 26, 2022
1 parent ab8318b commit d8b0148
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 20 deletions.
58 changes: 58 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
32 changes: 19 additions & 13 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import './App.css';
import Carrousel from './components/Carrousel';
import ValoresContenedor from './components/ValoresContenedor';
import ServiciosContenedor from './components/ServiciosContenedor';
import ProyectosContenedor from './components/ProyectosContenedor';
import {BrowserRouter, Routes, Route} from 'react-router-dom';
import Navbar from './components/Navbar';
import Nosotros from './components/Nosotros';
import Footer from './components/Footer'
import Footer from './components/Footer';
import Home from './pages/Home.jsx';
import NosotrosPage from './pages/NosotrosPage';
import ServiciosPages from './pages/ServiciosPages';




function App() {
return (
<div className="App">
<Navbar />
<Carrousel />
<ValoresContenedor />
<Nosotros />
<ServiciosContenedor />
<ProyectosContenedor />
<Footer />
<BrowserRouter>
<Navbar />
<Routes>
<Route path='/' exact element={<Home/>} />
<Route path='/nosotros' exact element={<NosotrosPage/>} />
<Route path='/servicios' exact element={<ServiciosPages/>} />

</Routes>
<Footer />
</BrowserRouter>
</div>
);
}
Expand Down
14 changes: 7 additions & 7 deletions src/components/Menuitems.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
export const menuItems = [
{
title: 'Home',
url: '#',
url: '/',
cName: 'nav-links'
},
{
title: 'Services',
url: '#',
title: 'Nosotros',
url: '/nosotros',
cName: 'nav-links'
},
{
title: 'Products',
url: '#',
title: 'Servicios',
url: '/servicios',
cName: 'nav-links'
},
{
title: 'Contact Us',
url: '#',
title: 'Contactanos',
url: '/contacto',
cName: 'nav-links'
},
]
21 changes: 21 additions & 0 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import Carrousel from '../components/Carrousel';
import ValoresContenedor from '../components/ValoresContenedor';
import Nosotros from '../components/Nosotros';
import ServiciosContenedor from '../components/ServiciosContenedor';
import ProyectosContenedor from '../components/ProyectosContenedor';


function home() {
return (
<div>
<Carrousel />
<ValoresContenedor />
<Nosotros />
<ServiciosContenedor />
<ProyectosContenedor />
</div>
)
}

export default home
10 changes: 10 additions & 0 deletions src/pages/NosotrosPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import Nosotros from '../components/Nosotros'

function NosotrosPage() {
return (
<div><Nosotros /></div>
)
}

export default NosotrosPage
14 changes: 14 additions & 0 deletions src/pages/ServiciosPages.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import ProyectosContenedor from '../components/ProyectosContenedor'
import ServiciosContenedor from '../components/ServiciosContenedor'

function ServiciosPages() {
return (
<div>
<ServiciosContenedor />
<ProyectosContenedor />
</div>
)
}

export default ServiciosPages

0 comments on commit d8b0148

Please sign in to comment.