Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
06f2c78b
Commit
06f2c78b
authored
Aug 06, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ead05b18
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
188 additions
and
246 deletions
+188
-246
Index.js
src/Utils/Index.js
+1
-1
Home.js
src/container/Home.js
+139
-186
Screen404.js
src/container/Screen404.js
+16
-0
homeRoutes.js
src/router/homeRoutes.js
+15
-0
index.js
src/router/index.js
+17
-59
No files found.
src/Utils/Index.js
View file @
06f2c78b
...
...
@@ -82,7 +82,7 @@ const footerStyle = {
padding
:
"20px"
,
left
:
"0"
,
bottom
:
"0"
,
height
:
"
6
0px"
,
height
:
"
8
0px"
,
width
:
"100%"
};
...
...
src/container/Home.js
View file @
06f2c78b
This diff is collapsed.
Click to expand it.
src/container/Screen404.js
0 → 100644
View file @
06f2c78b
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
src/router/homeRoutes.js
0 → 100644
View file @
06f2c78b
import
screen404
from
'../container/Screen404'
import
Beranda
from
'../container/Beranda'
const
routes
=
[
{
path
:
"/beranda"
,
main
:
Beranda
},
{
path
:
"/screen404"
,
main
:
screen404
},
];
export
default
routes
;
\ No newline at end of file
src/router/index.js
View file @
06f2c78b
...
...
@@ -4,13 +4,13 @@ import {
Switch
,
Route
,
Link
,
useLocation
useLocation
,
Redirect
}
from
"react-router-dom"
;
import
Home
from
'../container/Home'
import
Login
from
'../container/Login'
import
Register
from
'../container/Register'
import
Profile
from
'../container/Profile'
import
Beranda
from
"../container/Beranda"
;
import
Screen404
from
'../container/Screen404'
// This site has 3 pages, all of which are rendered
// dynamically in the browser (not server rendered).
//
...
...
@@ -23,64 +23,22 @@ import Beranda from "../container/Beranda";
export
default
function
BasicExample
()
{
return
(
<
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
>
<
Route
exact
path
=
"/"
exact
component
=
{
Login
}
/
>
{
/* <Route path="*">
<NoMatch />
</Route> */
}
<
Route
path
=
"/register"
exact
component
=
{
Register
}
/
>
<
Home
>
<
Route
path
=
"/home"
exact
component
=
{
Beranda
}
/
>
<
Route
path
=
"/profile"
exact
component
=
{
Profile
}
/
>
<
/Home
>
<
Route
exact
path
=
"/"
>
<
Redirect
to
=
{{
pathname
:
"/home"
,
// state: { from: location }
}}
/
>
<
/Route
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
Route
path
=
"/register"
component
=
{
Register
}
/
>
<
Route
path
=
"/home"
component
=
{
Home
}
/
>
<
Route
path
=
"*"
>
<
Screen404
/>
<
/Route
>
<
/Switch
>
{
/* </div> */
}
<
/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment