Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added navbar with dummy Dragon and MyProfile page. #30

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16,087 changes: 16,078 additions & 9 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"redux": "^4.1.2",
"redux-logger": "^3.0.6",
Expand Down
28 changes: 19 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
// import Rockets from './components/rocketList';
import MissionList from './components/missionList';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Nav from './components/Nav';
import Missions from './components/MissionList';
import Rockets from './components/RocketList';
import MyProfile from './components/MyProfile';
import Dragon from './components/Dragon';

export default function App() {
return (
<div className="App">
<MissionList />
</div>
);
}
const App = () => (
<BrowserRouter>
<Nav />
<Routes>
<Route exact path="/" element={<Rockets />} />
<Route path="/missions" element={<Missions />} />
<Route path="/dragon" element={<Dragon />} />
<Route path="/myprofile" element={<MyProfile />} />
</Routes>
</BrowserRouter>
);

export default App;
9 changes: 9 additions & 0 deletions src/components/Dragon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

const Dragon = () => (
<div>
<h1>Work in progress</h1>
</div>
);

export default Dragon;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import MissionsComponent from './missionItem';
import MissionsComponent from './MissionItem';
import { getMissionFromApi } from '../redux/reducers';

const MissionList = () => {
Expand Down
9 changes: 9 additions & 0 deletions src/components/MyProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

const MyProfile = () => (
<div>
<h1>Work in progress</h1>
</div>
);

export default MyProfile;
21 changes: 21 additions & 0 deletions src/components/Nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { NavLink } from 'react-router-dom';
import logoo from './logo.png';

const Nav = () => (
<div className="nav">
<nav className="same">
<h1 className="heading">
<img src={logoo} className="App-logoo" alt="logoo" width="70px" height="70px" />
Space Traveller&apos;s Hub
</h1>
<ul className="nav-link">
<NavLink activeClassName="selected" to="/">Rockets</NavLink>
<NavLink activeClassName="selected" id="mission" to="/missions">Missions</NavLink>
<NavLink activeClassName="selected" to="/dragon">Dragon</NavLink>
<NavLink activeClassName="selected" to="/myprofile">My Profile</NavLink>
</ul>
</nav>
</div>
);

export default Nav;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { getRocketFromApi } from '../redux/reducers';
import Rock from './rocketItem';
import Rock from './RocketItem';

const Rockets = () => {
const dispatch = useDispatch();
Expand Down
Binary file added src/components/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.