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 = {
...
@@ -82,7 +82,7 @@ const footerStyle = {
padding
:
"20px"
,
padding
:
"20px"
,
left
:
"0"
,
left
:
"0"
,
bottom
:
"0"
,
bottom
:
"0"
,
height
:
"
6
0px"
,
height
:
"
8
0px"
,
width
:
"100%"
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 {
...
@@ -4,13 +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"
;
// 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).
//
//
...
@@ -23,64 +23,22 @@ import Beranda from "../container/Beranda";
...
@@ -23,64 +23,22 @@ import Beranda from "../container/Beranda";
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
=
"/profile"
exact
component
=
{
Profile
}
/
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
/Home
>
<
Route
path
=
"/register"
component
=
{
Register
}
/
>
<
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
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