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
48b74075
Commit
48b74075
authored
Aug 16, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home ++
parent
dc4b6f25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
29 deletions
+50
-29
Home.js
src/container/Home.js
+19
-15
HomePage.js
src/container/HomePage.js
+14
-8
Array.js
src/library/Array.js
+17
-6
No files found.
src/container/Home.js
View file @
48b74075
...
@@ -131,19 +131,19 @@ export default function MiniDrawer() {
...
@@ -131,19 +131,19 @@ export default function MiniDrawer() {
const
[
selectedSubIndex
,
setSelectSub
]
=
React
.
useState
([]);
const
[
selectedSubIndex
,
setSelectSub
]
=
React
.
useState
([]);
const
[
userFullname
,
setUserFullname
]
=
React
.
useState
(
""
)
const
[
userFullname
,
setUserFullname
]
=
React
.
useState
(
""
)
const
[
userEmail
,
setUserEmail
]
=
React
.
useState
(
""
)
const
[
userEmail
,
setUserEmail
]
=
React
.
useState
(
""
)
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
userFullname
==
""
&&
userEmail
==
""
)
{
if
(
userFullname
==
""
&&
userEmail
==
""
)
{
getUserData
()
getUserData
()
}
}
})
})
const
getUserData
=
()
=>
{
const
getUserData
=
()
=>
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
setUserFullname
(
response
.
data
.
data
.
fullname
==
null
?
'Anonym'
:
response
.
data
.
data
.
fullname
)
setUserFullname
(
response
.
data
.
data
.
fullname
==
null
?
'Anonym'
:
response
.
data
.
data
.
fullname
)
setUserEmail
(
response
.
data
.
data
.
email
==
null
?
'Anonym@123.xyz'
:
response
.
data
.
data
.
email
)
setUserEmail
(
response
.
data
.
data
.
email
==
null
?
'Anonym@123.xyz'
:
response
.
data
.
data
.
email
)
console
.
log
(
userEmail
)
console
.
log
(
userEmail
)
}
}
})
})
...
@@ -172,6 +172,11 @@ export default function MiniDrawer() {
...
@@ -172,6 +172,11 @@ export default function MiniDrawer() {
setSelectedIndex
(
e
)
setSelectedIndex
(
e
)
}
}
const
logout
=
()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
}
let
{
path
,
url
}
=
useRouteMatch
();
let
{
path
,
url
}
=
useRouteMatch
();
const
{
height
,
width
}
=
UseWindowDimensions
();
const
{
height
,
width
}
=
UseWindowDimensions
();
...
@@ -201,24 +206,23 @@ export default function MiniDrawer() {
...
@@ -201,24 +206,23 @@ export default function MiniDrawer() {
>
>
<
div
className
=
{
classes
.
toolbarDrawer
}
style
=
{{
<
div
className
=
{
classes
.
toolbarDrawer
}
style
=
{{
backgroundColor
:
'#1a2d3e'
,
backgroundColor
:
'#1a2d3e'
,
height
:
open
?
null
:
78
,
height
:
open
?
203
:
78
,
paddingLeft
:
open
?
null
:
55
,
paddingLeft
:
open
?
null
:
55
,
display
:
open
?
null
:
'grid'
,
display
:
open
?
null
:
'grid'
,
paddingBottom
:
open
?
55
:
null
,
alignSelf
:
open
?
null
:
'center'
alignSelf
:
open
?
null
:
'center'
}}
>
}}
>
{
open
===
true
?
{
open
===
true
?
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
flex
:
1
,
padding
:
10
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
flex
:
1
,
padding
:
10
}}
>
<
img
src
=
{
Images
.
triputra
}
alt
=
"React Logo"
style
=
{{
height
:
31
,
width
:
151
,
alignSelf
:
'center'
}}
/
>
<
img
src
=
{
Images
.
triputra
}
alt
=
"React Logo"
style
=
{{
height
:
31
,
width
:
151
,
alignSelf
:
'center'
}}
/
>
<
IconButton
onClick
=
{
handleDrawerClose
}
style
=
{{
outline
:
'none'
}}
>
<
IconButton
onClick
=
{
handleDrawerClose
}
style
=
{{
outline
:
'none'
}}
>
<
ChevronLeftIcon
style
=
{{
fill
:
'white'
}}
/
>
<
ChevronLeftIcon
style
=
{{
fill
:
'white'
}}
/
>
<
/IconButton
>
<
/IconButton
>
<
/div>
:
<
/div>
:
<
IconButton
<
IconButton
color
=
"inherit"
color
=
"inherit"
aria
-
label
=
"open drawer"
aria
-
label
=
"open drawer"
style
=
{{
outline
:
'none'
}}
style
=
{{
outline
:
'none'
}}
onClick
=
{
handleDrawerOpen
}
onClick
=
{
handleDrawerOpen
}
edge
=
"start"
edge
=
"start"
className
=
{
clsx
(
classes
.
menuButton
,
{
className
=
{
clsx
(
classes
.
menuButton
,
{
...
@@ -228,15 +232,15 @@ export default function MiniDrawer() {
...
@@ -228,15 +232,15 @@ export default function MiniDrawer() {
<
MenuIcon
style
=
{{
fill
:
'white'
}}
/
>
<
MenuIcon
style
=
{{
fill
:
'white'
}}
/
>
<
/IconButton>
}
<
/IconButton>
}
{
open
&&
{
open
&&
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
width
:
'100%'
,
marginTop
:
15
,
marginBottom
:
60
}}
>
<
Typography
style
=
{{
fontSize
:
1
2
,
color
:
'#fff'
,
textAlign
:
'center'
,
fontWeight
:
'bold'
}}
>
John
Doe
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
1
4
,
color
:
'#fff'
,
textAlign
:
'center'
,
fontWeight
:
'bold'
}}
>
{
userFullname
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
1
2
,
color
:
'#fff'
,
textAlign
:
'center'
,
marginTop
:
10
}}
>
john
@
tia
.
com
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
1
4
,
color
:
'#fff'
,
textAlign
:
'center'
,
marginTop
:
10
}}
>
{
userEmail
}
<
/Typography
>
<
/div
>
<
/div
>
}
}
<
/div
>
<
/div
>
<
Divider
/>
<
Divider
/>
{
open
&&
{
open
&&
<
div
style
=
{{
width
:
'100%'
,
textAlign
:
'-webkit-center'
,
marginTop
:
-
4
0
}}
>
<
div
style
=
{{
width
:
'100%'
,
textAlign
:
'-webkit-center'
,
marginTop
:
-
4
5
}}
>
<
div
className
=
{
"sub-color"
}
style
=
{{
width
:
90
,
height
:
90
,
borderRadius
:
50
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
className
=
{
"sub-color"
}
style
=
{{
width
:
90
,
height
:
90
,
borderRadius
:
50
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
72
,
height
:
72
,
backgroundColor
:
'#838383'
,
borderRadius
:
50
,
alignSelf
:
'center'
}}
>
<
div
style
=
{{
width
:
72
,
height
:
72
,
backgroundColor
:
'#838383'
,
borderRadius
:
50
,
alignSelf
:
'center'
}}
>
<
/div
>
<
/div
>
...
@@ -285,7 +289,7 @@ export default function MiniDrawer() {
...
@@ -285,7 +289,7 @@ export default function MiniDrawer() {
{
item
.
subItem
.
map
((
sub
,
indexs
)
=>
{
{
item
.
subItem
.
map
((
sub
,
indexs
)
=>
{
return
(
return
(
<
Link
to
=
{
`
${
url
}
/
${
sub
.
path
}
`
}
>
<
Link
to
=
{
`
${
url
}
/
${
sub
.
path
}
`
}
>
<
div
style
=
{{
paddingLeft
:
5
,
}}
className
=
{
selectedSubIndex
===
sub
.
label
?
"active"
:
""
}
onClick
=
{()
=>
selectSub
(
sub
.
label
)}
>
<
div
style
=
{{
paddingLeft
:
5
,
}}
className
=
{
selectedSubIndex
===
sub
.
label
?
"active"
:
""
}
onClick
=
{()
=>
s
ub
.
label
===
"Logout"
?
logout
()
:
s
electSub
(
sub
.
label
)}
>
<
ListItem
button
style
=
{{
paddingLeft
:
61
}}
>
<
ListItem
button
style
=
{{
paddingLeft
:
61
}}
>
<
Typography
style
=
{{
fontFamily
:
'nunito'
,
color
:
'#525355'
,
fontSize
:
14
}}
>
{
sub
.
label
}
<
/Typography
>
<
Typography
style
=
{{
fontFamily
:
'nunito'
,
color
:
'#525355'
,
fontSize
:
14
}}
>
{
sub
.
label
}
<
/Typography
>
<
/ListItem
>
<
/ListItem
>
...
...
src/container/HomePage.js
View file @
48b74075
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
CircularProgress
}
from
'@material-ui/core'
;
import
{
Typography
,
CircularProgress
,
MuiThemeProvider
,
createMuiTheme
}
from
'@material-ui/core'
;
import
MUIDataTable
from
"mui-datatables"
;
import
MUIDataTable
from
"mui-datatables"
;
import
Images
from
'../assets/Images'
;
import
Images
from
'../assets/Images'
;
import
DonutChart
from
'react-d3-donut'
;
import
DonutChart
from
'react-d3-donut'
;
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
class
HomePage
extends
Component
{
class
HomePage
extends
Component
{
render
()
{
render
()
{
const
columns
=
[
"#"
,
"Nama Perusahaan"
,
"Revisi"
,
"Status"
,
{
const
columns
=
[
"#"
,
"Nama Perusahaan"
,
"Revisi"
,
"Status"
,
{
...
@@ -16,7 +19,8 @@ class HomePage extends Component {
...
@@ -16,7 +19,8 @@ class HomePage extends Component {
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
,
marginRight
:
10
}}
}}
onClick
=
{()
=>
null
}
onClick
=
{()
=>
null
}
>
>
...
@@ -95,11 +99,13 @@ class HomePage extends Component {
...
@@ -95,11 +99,13 @@ class HomePage extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
>
<
div
>
<
MUIDataTable
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
data
=
{
data
}
<
MUIDataTable
columns
=
{
columns
}
data
=
{
data
}
options
=
{
options
}
columns
=
{
columns
}
/
>
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Status
Laporan
<
/Typography
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Status
Laporan
<
/Typography
>
...
@@ -145,7 +151,7 @@ class HomePage extends Component {
...
@@ -145,7 +151,7 @@ class HomePage extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
280
,
height
:
400
,
padding
:
20
,
backgroundColor
:
'white'
,
borderRadius
:
6
,
border
:
'solid 1px #c4c4c4'
,
marginRight
:
25
}}
>
<
div
style
=
{{
width
:
280
,
height
:
400
,
padding
:
20
,
backgroundColor
:
'white'
,
borderRadius
:
6
,
border
:
'solid 1px #c4c4c4'
,
marginRight
:
25
}}
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
'24px'
,
fontWeight
:
'bold'
}}
>
Laporan
Bulanan
-
Oct
2020
<
/Typography
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
'24px'
,
fontWeight
:
'bold'
}}
>
Laporan
Bulanan
-
Oct
2020
<
/Typography
>
<
div
style
=
{{
textAlign
:
'center'
}}
>
<
div
style
=
{{
textAlign
:
'center'
}}
>
<
DonutChart
<
DonutChart
...
...
src/library/Array.js
View file @
48b74075
...
@@ -71,12 +71,6 @@ const arraySide = [
...
@@ -71,12 +71,6 @@ const arraySide = [
path
:
'beranda'
,
path
:
'beranda'
,
subItem
:
null
subItem
:
null
},
},
{
img
:
''
,
label
:
'Profile'
,
path
:
'profile'
,
subItem
:
null
},
{
{
img
:
Images
.
masterdata
,
img
:
Images
.
masterdata
,
label
:
'Master Data'
,
label
:
'Master Data'
,
...
@@ -126,6 +120,23 @@ const arraySide = [
...
@@ -126,6 +120,23 @@ const arraySide = [
label
:
'Approval Matrix'
,
label
:
'Approval Matrix'
,
path
:
'approval-matrix'
,
path
:
'approval-matrix'
,
subItem
:
null
subItem
:
null
},
{
img
:
Images
.
otorisasi
,
label
:
'User Management'
,
path
:
''
,
subItem
:
[
{
img
:
''
,
label
:
'Profile'
,
path
:
'profile'
,
},
{
img
:
''
,
label
:
'Logout'
,
path
:
''
,
},
]
}
}
]
]
...
...
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