Moved Router and Routes from Navigation component to App.js
This commit is contained in:
parent
aae4a979ae
commit
094228a78d
20
src/App.js
20
src/App.js
@ -4,14 +4,30 @@ import "bootstrap/dist/js/bootstrap.bundle.min";
|
|||||||
import './App.css';
|
import './App.css';
|
||||||
import Navigation from './UI/Navigation';
|
import Navigation from './UI/Navigation';
|
||||||
|
|
||||||
|
import {BrowserRouter as Router, Routes, Route} from 'react-router-dom';
|
||||||
|
|
||||||
|
import Home from './Pages/Home';
|
||||||
|
import Linux from './Pages/Linux/Linux';
|
||||||
|
import Radio from './Pages/Radio/Radio';
|
||||||
|
import Software from './Pages/Software/Software';
|
||||||
|
import DXPDevelopment from './Pages/Software/Projects/DXPDevelopment';
|
||||||
|
import ConfigAutomation from './Pages/Software/Projects/ConfigAutomation';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<Router>
|
||||||
<div className='row '>
|
<div className='row '>
|
||||||
<Navigation />
|
<Navigation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<Routes>
|
||||||
|
<Route exact path='/' element={<Home />}></Route>
|
||||||
|
<Route exact path='/pages/software' element={<Software />}></Route>
|
||||||
|
<Route exact path='/pages/software/dxp-development' element={<DXPDevelopment />}></Route>
|
||||||
|
<Route exact path='/pages/software/configuration-automation' element={<ConfigAutomation />}></Route>
|
||||||
|
<Route exact path='/pages/radio' element={<Radio />}></Route>
|
||||||
|
<Route exact path='/pages/linux' element={<Linux />}></Route>
|
||||||
|
</Routes>
|
||||||
|
</Router>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {BrowserRouter as Router, Routes, Route, Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
|
|
||||||
import Home from '../Pages/Home';
|
|
||||||
import Linux from '../Pages/Linux/Linux';
|
|
||||||
import Radio from '../Pages/Radio/Radio';
|
|
||||||
import Software from '../Pages/Software/Software';
|
|
||||||
import DXPDevelopment from '../Pages/Software/Projects/DXPDevelopment';
|
|
||||||
import ConfigAutomation from '../Pages/Software/Projects/ConfigAutomation';
|
|
||||||
|
|
||||||
import './Navigation.css';
|
import './Navigation.css';
|
||||||
|
|
||||||
|
|
||||||
const Navigation = (props) => {
|
const Navigation = (props) => {
|
||||||
return (
|
return (
|
||||||
<Router>
|
|
||||||
<nav className="navbar navbar-expand-lg fixed-top text-light navbar-dark bg-primary">
|
<nav className="navbar navbar-expand-lg fixed-top text-light navbar-dark bg-primary">
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<a className="navbar-brand" href="/">Kevin Matsubara<br/><span className='logo-sub'>Software Developer</span></a>
|
<a className="navbar-brand" href="/">Kevin Matsubara<br/><span className='logo-sub'>Software Developer</span></a>
|
||||||
@ -48,15 +40,6 @@ const Navigation = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<Routes>
|
|
||||||
<Route exact path='/' element={<Home />}></Route>
|
|
||||||
<Route exact path='/pages/software' element={<Software />}></Route>
|
|
||||||
<Route exact path='/pages/software/dxp-development' element={<DXPDevelopment />}></Route>
|
|
||||||
<Route exact path='/pages/software/configuration-automation' element={<ConfigAutomation />}></Route>
|
|
||||||
<Route exact path='/pages/radio' element={<Radio />}></Route>
|
|
||||||
<Route exact path='/pages/linux' element={<Linux />}></Route>
|
|
||||||
</Routes>
|
|
||||||
</Router>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user