Commit fd41235f authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 3fb62e85 ffc3cefd
...@@ -82,7 +82,7 @@ const footerStyle = { ...@@ -82,7 +82,7 @@ const footerStyle = {
padding: "20px", padding: "20px",
left: "0", left: "0",
bottom: "0", bottom: "0",
height: "60px", height: "80px",
width: "100%" width: "100%"
}; };
......
This diff is collapsed.
import React from 'react'
import {
useLocation
} from "react-router-dom";
export default function NoMatch() {
let location = useLocation();
return (
<div>
<h3>
Link '<code>{location.pathname}</code>' engga ada euy
</h3>
</div>
);
}
\ No newline at end of file
import screen404 from '../container/Screen404'
import Beranda from '../container/Beranda'
const routes = [
{
path: "/home/beranda",
main: Beranda
},
{
path: "/home/screen404",
main: screen404
},
];
export default routes;
\ No newline at end of file
...@@ -4,14 +4,13 @@ import { ...@@ -4,14 +4,13 @@ import {
Switch, Switch,
Route, Route,
Link, Link,
useLocation useLocation,
Redirect
} from "react-router-dom"; } from "react-router-dom";
import Home from '../container/Home' import Home from '../container/Home'
import Login from '../container/Login' import Login from '../container/Login'
import Register from '../container/Register' import Register from '../container/Register'
import Profile from '../container/Profile' import Screen404 from '../container/Screen404'
import Beranda from "../container/Beranda";
import HomePage from "../container/HomePage";
// This site has 3 pages, all of which are rendered // This site has 3 pages, all of which are rendered
// dynamically in the browser (not server rendered). // dynamically in the browser (not server rendered).
// //
...@@ -24,65 +23,22 @@ import HomePage from "../container/HomePage"; ...@@ -24,65 +23,22 @@ import HomePage from "../container/HomePage";
export default function BasicExample() { export default function BasicExample() {
return ( return (
<Router> <Router>
{/* <div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">About</Link>
</li>
<li>
<Link to="/dashboard">Dashboard</Link>
</li>
</ul>
<hr /> */}
{/*
A <Switch> looks through all its children <Route>
elements and renders the first one whose path
matches the current URL. Use a <Switch> any time
you have multiple routes, but you want only one
of them to render at a time
*/}
<Switch> <Switch>
<Route exact path="/" exact component={Login} /> <Route exact path="/">
{/* <Route path="*"> <Redirect
<NoMatch /> to={{
</Route> */} pathname: "/home",
<Route path="/register" exact component={Register}/> // state: { from: location }
}}
<Home> />
<Route path="/home" exact component={Beranda} /> </Route>
<Route path="/home2" exact component={HomePage} /> <Route path="/login" component={Login} />
<Route path="/profile" exact component={Profile} /> <Route path="/register" component={Register}/>
</Home> <Route path="/home" component={Home} />
<Route path="*">
<Screen404 />
</Route>
</Switch> </Switch>
{/* </div> */}
</Router> </Router>
); );
}
// You can think of these components as "pages"
// in your app.
// function Home() {
// return (
// <div>
// <h2>Home</h2>
// </div>
// );
// }
function NoMatch() {
let location = useLocation();
return (
<div>
<h3>
Link '<code>{location.pathname}</code>' engga ada euy
</h3>
</div>
);
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment