-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Router principal y secundario terminado
- Loading branch information
1 parent
f97b7f5
commit 674fa1f
Showing
11 changed files
with
441 additions
and
59 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import React from "react"; | ||
import AppRouter from "./routers/AppRouter"; | ||
|
||
const HeroesApp = () => { | ||
return ( | ||
<div> | ||
<h1>HeroesApp</h1> | ||
</div> | ||
); | ||
return <AppRouter />; | ||
}; | ||
|
||
export default HeroesApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import { Link, NavLink } from "react-router-dom"; | ||
|
||
export const Navbar = () => { | ||
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 | ||
activeClassName="active" | ||
className="nav-item nav-link" | ||
exact | ||
to="/marvel" | ||
> | ||
Marvel | ||
</NavLink> | ||
|
||
<NavLink | ||
activeClassName="active" | ||
className="nav-item nav-link" | ||
exact | ||
to="/dc" | ||
> | ||
DC | ||
</NavLink> | ||
</div> | ||
</div> | ||
|
||
<div className="navbar-collapse collapse w-100 order-3 dual-collapse2"> | ||
<ul className="navbar-nav ml-auto"> | ||
<NavLink | ||
activeClassName="active" | ||
className="nav-item nav-link" | ||
exact | ||
to="/login" | ||
> | ||
Logout | ||
</NavLink> | ||
</ul> | ||
</div> | ||
</nav> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
const DcScreen = () => { | ||
return ( | ||
<div> | ||
<h1>DC Screen</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DcScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
const HeroeScreen = () => { | ||
return ( | ||
<div> | ||
<h1>Hero Screen</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeroeScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
const LoginScreen = () => { | ||
return <div>Login Screen</div>; | ||
}; | ||
|
||
export default LoginScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
|
||
const MarvelScreen = () => { | ||
return ( | ||
<div> | ||
<h1>Marvel Screen</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MarvelScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||
import LoginScreen from "../pages/login/LoginScreen"; | ||
import DashboardRoutes from "./DashboardRoutes"; | ||
|
||
const AppRouter = () => { | ||
return ( | ||
<Router> | ||
<div> | ||
<Switch> | ||
<Route exact path="/login" component={LoginScreen} /> | ||
<Route path="/" component={DashboardRoutes} /> | ||
</Switch> | ||
</div> | ||
</Router> | ||
); | ||
}; | ||
|
||
export default AppRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
import { Switch, Redirect, Route } from "react-router-dom"; | ||
import { Navbar } from "../components/ui/Navbar"; | ||
import DcScreen from "../pages/dc/DcScreen"; | ||
import HeroeScreen from "../pages/heroes/HeroeScreen"; | ||
import MarvelScreen from "../pages/marvel/MarvelScreen"; | ||
|
||
const DashboardRoutes = () => { | ||
return ( | ||
<> | ||
<Navbar /> | ||
<div> | ||
<Switch> | ||
<Route exact path="/marvel" component={MarvelScreen} /> | ||
<Route exact path="/heroe/:heroeId" component={HeroeScreen} /> | ||
<Route exact path="/dc" component={DcScreen} /> | ||
<Redirect to="/marvel" /> | ||
</Switch> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default DashboardRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters