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
b4a4a132
Commit
b4a4a132
authored
Aug 07, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
Didam See merge request
!16
parents
786a5493
0d02d36e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
36 deletions
+194
-36
Home.js
src/container/Home.js
+50
-31
UserRole.js
src/container/UserRole.js
+9
-0
index.js
src/index.js
+0
-1
Array.js
src/library/Array.js
+111
-0
homeRoutes.js
src/router/homeRoutes.js
+3
-3
index.js
src/router/index.js
+21
-1
No files found.
src/container/Home.js
View file @
b4a4a132
...
@@ -10,6 +10,8 @@ import Typography from '@material-ui/core/Typography';
...
@@ -10,6 +10,8 @@ import Typography from '@material-ui/core/Typography';
import
Divider
from
'@material-ui/core/Divider'
;
import
Divider
from
'@material-ui/core/Divider'
;
import
IconButton
from
'@material-ui/core/IconButton'
;
import
IconButton
from
'@material-ui/core/IconButton'
;
import
MenuIcon
from
'@material-ui/icons/Menu'
;
import
MenuIcon
from
'@material-ui/icons/Menu'
;
import
ExpandMore
from
'@material-ui/icons/ExpandMore'
import
ExpandLess
from
'@material-ui/icons/ExpandLess'
import
ChevronLeftIcon
from
'@material-ui/icons/ChevronLeft'
;
import
ChevronLeftIcon
from
'@material-ui/icons/ChevronLeft'
;
import
ChevronRightIcon
from
'@material-ui/icons/ChevronRight'
;
import
ChevronRightIcon
from
'@material-ui/icons/ChevronRight'
;
import
ListItem
from
'@material-ui/core/ListItem'
;
import
ListItem
from
'@material-ui/core/ListItem'
;
...
@@ -17,6 +19,7 @@ import ListItemIcon from '@material-ui/core/ListItemIcon';
...
@@ -17,6 +19,7 @@ import ListItemIcon from '@material-ui/core/ListItemIcon';
import
ListItemText
from
'@material-ui/core/ListItemText'
;
import
ListItemText
from
'@material-ui/core/ListItemText'
;
import
InboxIcon
from
'@material-ui/icons/MoveToInbox'
;
import
InboxIcon
from
'@material-ui/icons/MoveToInbox'
;
import
MailIcon
from
'@material-ui/icons/Mail'
;
import
MailIcon
from
'@material-ui/icons/Mail'
;
import
Collapse
from
'@material-ui/core/Collapse'
;
import
{
import
{
BrowserRouter
as
Router
,
BrowserRouter
as
Router
,
...
@@ -31,6 +34,7 @@ import { FadeMenu, Footer } from '../Utils/Index';
...
@@ -31,6 +34,7 @@ import { FadeMenu, Footer } from '../Utils/Index';
import
Beranda
from
'./Beranda'
;
import
Beranda
from
'./Beranda'
;
import
{
Avatar
}
from
'@material-ui/core'
;
import
{
Avatar
}
from
'@material-ui/core'
;
import
HomeRoutes
from
'../router/homeRoutes'
import
HomeRoutes
from
'../router/homeRoutes'
import
ArraySide
from
'../library/Array'
const
drawerWidth
=
307
;
const
drawerWidth
=
307
;
...
@@ -114,7 +118,11 @@ export default function MiniDrawer() {
...
@@ -114,7 +118,11 @@ export default function MiniDrawer() {
const
classes
=
useStyles
();
const
classes
=
useStyles
();
const
theme
=
useTheme
();
const
theme
=
useTheme
();
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
[
selectedIndex
,
setSelectedIndex
]
=
React
.
useState
([]);
React
.
useEffect
(()
=>
{
// alert(ArraySide)
})
const
handleDrawerOpen
=
()
=>
{
const
handleDrawerOpen
=
()
=>
{
setOpen
(
true
);
setOpen
(
true
);
};
};
...
@@ -203,25 +211,52 @@ export default function MiniDrawer() {
...
@@ -203,25 +211,52 @@ export default function MiniDrawer() {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
}
}
{
open
&&
<
div
style
=
{{
marginLeft
:
25
,
marginTop
:
20
,
marginBottom
:
20
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
}}
>
APLIKASI
<
/Typography
>
<
/div
>
}
<
List
>
<
List
>
{[
'Inbox'
,
'Starred'
,
'Send email'
,
'Drafts'
].
map
((
text
,
index
)
=>
(
{
ArraySide
.
map
((
item
,
index
)
=>
(
<
ListItem
button
key
=
{
text
}
>
<
div
>
<
ListItemIcon
>
{
index
%
2
===
0
?
<
InboxIcon
/>
:
<
MailIcon
/>
}
<
/ListItemIcon
>
{
item
.
subItem
!=
null
?
<
ListItemText
primary
=
{
text
}
/
>
<
div
style
=
{{
justifyContent
:
'space-between'
,
flexDirection
:
'row'
,
display
:
'flex'
,
paddingRight
:
10
}}
onClick
=
{()
=>
selectedIndex
==
0
?
setSelectedIndex
(
index
)
:
setSelectedIndex
(
0
)}
>
<
/ListItem
>
<
ListItem
button
key
=
{
item
.
label
}
>
))}
<
ListItemIcon
>
{
index
%
2
===
0
?
<
InboxIcon
style
=
{{
color
:
"white"
}}
/> : <MailIcon style={{color:"white"}}/
>
}
<
/ListItemIcon
>
<
/List
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
}}
>
{
item
.
label
}
<
/Typography
>
<
Divider
/>
<
/ListItem
>
<
List
>
{
item
.
subItem
!=
null
?
(
index
===
selectedIndex
?
<
ExpandMore
style
=
{{
color
:
"white"
,
marginLeft
:
50
,
alignSelf
:
'center'
}}
/> : <ExpandLess style={{color:"white", marginLeft: 50, alignSelf:'center'}}/
>
)
:
null
}
{[
'All mail'
,
'Trash'
,
'Spam'
].
map
((
text
,
index
)
=>
(
<
/div
>
<
ListItem
button
key
=
{
text
}
>
:
<
ListItemIcon
>
{
index
%
2
===
0
?
<
Link
to
=
{
`
${
url
}
/beranda`
}
><
InboxIcon
/><
/Link> : <Link to={`${url}/
screen404
`}><MailIcon /></Link>}</ListItemIcon>
<
Link
to
=
{
`
${
url
}
/
${
item
.
path
}
`
}
>
<ListItemText primary={text} />
<
ListItem
button
key
=
{
item
.
label
}
onClick
=
{()
=>
setSelectedIndex
(
index
)}
>
</ListItem>
<
ListItemIcon
>
{
index
%
2
===
0
?
<
InboxIcon
style
=
{{
color
:
"white"
}}
/> : <MailIcon style={{color:"white"}}/
>
}
<
/ListItemIcon
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
}}
>
{
item
.
label
}
<
/Typography
>
<
/ListItem
>
<
/Link>
}
{
item
.
subItem
!=
null
&&
<
div
>
<
Collapse
in
=
{
index
===
selectedIndex
}
timeout
=
"auto"
unmountOnExit
>
<
List
component
=
"div"
disablePadding
>
{
item
.
subItem
.
map
((
sub
,
index
)
=>
{
return
(
<
Link
to
=
{
`
${
url
}
/
${
sub
.
path
}
`
}
>
<
ListItem
style
=
{{
paddingLeft
:
70
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
}}
>
{
sub
.
label
}
<
/Typography
>
<
/ListItem
>
<
/Link
>
)
})}
<
/List
>
<
/Collapse
>
<
/div
>
}
<
/div
>
))}
))}
<
/List
>
<
/List
>
<
/Drawer
>
<
/Drawer
>
<div className={classes.content} style={{
height: '100vh',
justifyContent: 'space-between', padding: 0, backgroundColor: '#f8f8f8' }}>
<
div
className
=
{
classes
.
content
}
style
=
{{
justifyContent
:
'space-between'
,
padding
:
0
,
backgroundColor
:
'#f8f8f8'
}}
>
<
div
>
<
div
>
<
div
className
=
{
classes
.
toolbar
}
/
>
<
div
className
=
{
classes
.
toolbar
}
/
>
<
Switch
>
<
Switch
>
...
@@ -249,20 +284,4 @@ export default function MiniDrawer() {
...
@@ -249,20 +284,4 @@ export default function MiniDrawer() {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
}
function Topic() {
// The <Route> that rendered this component has a
// path of `
/
topics
/
:
topicId
`. The `
:
topicId
` portion
// of the URL indicates a placeholder that we can
// get from `
useParams
()
`.
let { topicId } = useParams();
React.useEffect(() => {
alert(topicId)
})
return (
<div>
<h3>{topicId}</h3>
</div>
);
}
}
\ No newline at end of file
src/container/UserRole.js
0 → 100644
View file @
b4a4a132
import
React
,
{
Component
}
from
'react'
;
export
default
class
componentName
extends
Component
{
render
()
{
return
(
<
div
style
=
{{
height
:
'100vh'
,
width
:
'100%'
,
flex
:
1
}}
>
textInComponent
<
/div
>
);
}
}
src/index.js
View file @
b4a4a132
import
React
from
'react'
;
import
React
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
ReactDOM
from
'react-dom'
;
import
'./index.css'
;
import
'./index.css'
;
import
'../node_modules/font-awesome/css/font-awesome.min.css'
;
import
App
from
'./App'
;
import
App
from
'./App'
;
import
*
as
serviceWorker
from
'./serviceWorker'
;
import
*
as
serviceWorker
from
'./serviceWorker'
;
...
...
src/library/Array.js
0 → 100644
View file @
b4a4a132
const
arraySide
=
[
{
img
:
''
,
label
:
'Beranda'
,
path
:
'beranda'
,
subItem
:
null
},
{
img
:
''
,
label
:
'Budget Tahunan'
,
path
:
'beranda'
,
subItem
:
null
},
{
img
:
''
,
label
:
'Laporan Bulanan'
,
path
:
'beranda'
,
subItem
:
null
},
{
img
:
''
,
label
:
'Manajemen Dokumen'
,
path
:
'beranda'
,
subItem
:
null
},
{
img
:
''
,
label
:
'Laporan'
,
path
:
''
,
subItem
:
[
{
img
:
'beranda'
,
label
:
'Dashboard CAT'
,
path
:
'beranda'
,
},
{
img
:
'beranda'
,
label
:
'Report Summary Triputra Group'
,
path
:
'beranda'
,
},
{
img
:
''
,
label
:
'Report Sub Holding'
,
path
:
'beranda'
,
}
]
},
{
img
:
''
,
label
:
'PENGATURAN'
,
path
:
'beranda'
,
subItem
:
null
},
{
img
:
''
,
label
:
'Master Data'
,
path
:
''
,
subItem
:
[
{
img
:
''
,
label
:
'Unit Bisnis'
,
path
:
'beranda'
,
},
{
img
:
''
,
label
:
'Perusahaan'
,
path
:
'beranda'
,
},
{
img
:
''
,
label
:
'Item Laporan'
,
path
:
'beranda'
,
},
{
img
:
''
,
label
:
'Manajemen Laporan'
,
path
:
'beranda'
,
},
{
img
:
''
,
label
:
'Parameter Lainnya'
,
path
:
'beranda'
,
},
]
},
{
img
:
''
,
label
:
'Otorisasi'
,
path
:
''
,
subItem
:
[
{
img
:
''
,
label
:
'User Role'
,
path
:
'userrole'
,
},
{
img
:
''
,
label
:
'User'
,
path
:
'beranda'
,
}
]
},
{
img
:
''
,
label
:
'Approvalz Matrix'
,
path
:
'beranda'
,
subItem
:
null
}
]
export
default
arraySide
;
\ No newline at end of file
src/router/homeRoutes.js
View file @
b4a4a132
import
screen404
from
'../container/Screen404'
import
screen404
from
'../container/Screen404'
import
Beranda
from
'../container/Beranda'
import
Beranda
from
'../container/Beranda'
import
HomePage
from
'../container/HomePage'
;
import
UserRole
from
'../container/UserRole'
const
routes
=
[
const
routes
=
[
{
{
...
@@ -8,8 +8,8 @@ const routes = [
...
@@ -8,8 +8,8 @@ const routes = [
main
:
HomePage
main
:
HomePage
},
},
{
{
path
:
"/home/
screen404
"
,
path
:
"/home/
userrole
"
,
main
:
screen404
main
:
UserRole
},
},
];
];
...
...
src/router/index.js
View file @
b4a4a132
...
@@ -34,11 +34,31 @@ export default function BasicExample() {
...
@@ -34,11 +34,31 @@ export default function BasicExample() {
<
/Route
>
<
/Route
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
Route
path
=
"/register"
component
=
{
Register
}
/
>
<
Route
path
=
"/register"
component
=
{
Register
}
/
>
<
Route
path
=
"/home"
component
=
{
Home
}
/
>
<
Private
Route
path
=
"/home"
component
=
{
Home
}
/
>
<
Route
path
=
"*"
>
<
Route
path
=
"*"
>
<
Screen404
/>
<
Screen404
/>
<
/Route
>
<
/Route
>
<
/Switch
>
<
/Switch
>
<
/Router
>
<
/Router
>
);
);
}
function
PrivateRoute
({
children
,
...
rest
})
{
return
(
<
Route
{...
rest
}
render
=
{({
location
})
=>
// fakeAuth.isAuthenticated ? (
// children
// ) : (
<
Redirect
to
=
{{
pathname
:
"/login"
,
// state: { from: location }
}}
/
>
// )
}
/
>
);
}
}
\ 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