Skip to content

Commit

Permalink
add general routes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmglezpdev committed Jul 19, 2022
1 parent a87008d commit a1fde09
Show file tree
Hide file tree
Showing 39 changed files with 183 additions and 121 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
/assets

# testing
/coverage
Expand Down
62 changes: 60 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "musify",
"name": "hero-app",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand All @@ -8,6 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
Binary file added public/assets/dc-arrow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-batman.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-black.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-flash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-green.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-martian.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-robin.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-superman.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dc-wonder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-captain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-cyclops.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-daredevil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-hawkeye.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-hulk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-iron.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-silver.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-spider.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-thor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/marvel-wolverine.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

25 changes: 0 additions & 25 deletions src/App.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

10 changes: 10 additions & 0 deletions src/HeroesApp.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import { AppRouter } from './routers/AppRouter'

export const HeroesApp = () => {
return (
<div>
<AppRouter />
</div>
)
}
6 changes: 6 additions & 0 deletions src/components/dc/DcScreem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const DcScreem = () => {
return (
<div>DcScreem</div>
)
}
6 changes: 6 additions & 0 deletions src/components/login/LoginScreen.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const LoginScreen = () => {
return (
<div>LoginScreen</div>
)
}
6 changes: 6 additions & 0 deletions src/components/marvel/MarvelScreen.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const MarvelScreen = () => {
return (
<div>MarverScreen</div>
)
}
6 changes: 6 additions & 0 deletions src/components/search/SearchScreen.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const SearchScreen = () => {
return (
<div>SearchScreen</div>
)
}
55 changes: 55 additions & 0 deletions src/components/ui/NavBar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Link, NavLink } from 'react-router-dom';


export const Navbar = () => {

const handleLogout = () => {
console.log("Logout");
}

return (
<nav className="navbar navbar-expand-sm navbar-dark bg-dark">

<Link
className="navbar-brand"
to="/"
>
Asociaciones
</Link>

<div className="navbar-collapse">
<div className="navbar-nav">

<NavLink
className={ ({ isActive }) => `nav-item nav-link ${isActive ? 'active' : ''}` }
to="/marvel"
>
Marvel
</NavLink>

<NavLink
className={ ({ isActive }) => `nav-item nav-link ${isActive ? 'active' : ''}` }
to="/dc"
>
DC
</NavLink>
</div>
</div>

<div className="navbar-collapse collapse w-100 order-3 dual-collapse2 d-flex justify-content-end">
<ul className="navbar-nav ml-auto">
<span className='nav-link nav-item text-info' >
Carlos Manuel
</span>

<button
className="nav-item nav-link btn"
onClick={handleLogout}
>
Logout
</button>
</ul>
</div>
</nav>
)
}
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

21 changes: 6 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { createRoot } from 'react-dom/client';
import { HeroesApp } from './HeroesApp';

const root = createRoot(document.getElementById('root'));

root.render(<HeroesApp />);

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

13 changes: 0 additions & 13 deletions src/reportWebVitals.js

This file was deleted.

24 changes: 24 additions & 0 deletions src/routers/AppRouter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import { Routes, Route, BrowserRouter } from 'react-router-dom';
import { DcScreem } from '../components/dc/DcScreem';
import { LoginScreen } from '../components/login/LoginScreen';
import { MarvelScreen } from '../components/marvel/MarvelScreen';
import { SearchScreen } from '../components/search/SearchScreen';
import { Navbar } from '../components/ui/NavBar';

export const AppRouter = () => {
return (
<BrowserRouter>
<Navbar />

<Routes>
<Route path="/" element={<MarvelScreen />} />
<Route path="/marvel" element={<MarvelScreen />} />
<Route path="/dc" element={<DcScreem />} />
<Route path="/search" element={<SearchScreen />} />
<Route path="/login" element={<LoginScreen />} />

</Routes>
</BrowserRouter>
)
}
5 changes: 0 additions & 5 deletions src/setupTests.js

This file was deleted.

0 comments on commit a1fde09

Please sign in to comment.