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
58dc11d4
Commit
58dc11d4
authored
Jul 14, 2022
by
Arfin Syadziy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/arfin' into 'ENV-DEV-CR-CAFRM'
update merging issue See merge request
!1582
parents
32145370
5b8d14ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
1 deletion
+141
-1
Home.js
src/container/Menu/Home.js
+1
-1
index.js
src/utils/index.js
+140
-0
No files found.
src/container/Menu/Home.js
View file @
58dc11d4
...
@@ -27,7 +27,7 @@ import {
...
@@ -27,7 +27,7 @@ import {
useRouteMatch
,
useLocation
useRouteMatch
,
useLocation
}
from
"react-router-dom"
;
}
from
"react-router-dom"
;
import
Images
from
'../../assets/Images'
;
import
Images
from
'../../assets/Images'
;
import
{
UseWindowDimensions
}
from
'../../
Utils/I
ndex'
;
import
{
UseWindowDimensions
}
from
'../../
utils/i
ndex'
;
import
HomeRoutes
from
'../../router/homeRoutes'
import
HomeRoutes
from
'../../router/homeRoutes'
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
...
...
src/utils/index.js
0 → 100644
View file @
58dc11d4
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
Menu
from
'@material-ui/core/Menu'
;
import
MenuItem
from
'@material-ui/core/MenuItem'
;
import
{
makeStyles
}
from
'@material-ui/core/styles'
;
import
Fade
from
'@material-ui/core/Fade'
;
import
Grid
from
'@material-ui/core/Grid'
;
import
{
Typography
,
Avatar
}
from
'@material-ui/core'
;
import
Images
from
'../assets/Images'
;
import
{
Link
,
useRouteMatch
}
from
'react-router-dom'
;
import
Constant
from
'../library/Constant'
;
const
useStyles
=
makeStyles
({
avatar
:
{
margin
:
10
,
},
orangeAvatar
:
{
margin
:
10
,
color
:
'#fff'
,
backgroundColor
:
'black'
,
},
})
function
FadeMenu
()
{
const
[
anchorEl
,
setAnchorEl
]
=
React
.
useState
(
null
);
const
open
=
Boolean
(
anchorEl
);
const
handleClick
=
event
=>
{
setAnchorEl
(
event
.
currentTarget
);
};
const
handleClose
=
()
=>
{
setAnchorEl
(
null
);
};
const
handleLogout
=
()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
setAnchorEl
(
null
);
}
const
classes
=
useStyles
();
let
{
path
,
url
}
=
useRouteMatch
();
return
(
<
div
>
<
Grid
container
justify
=
"center"
alignItems
=
"center"
>
<
div
onClick
=
{
handleClick
}
>
<
img
src
=
{
Images
.
dropdownWhite
}
alt
=
"React Logo"
style
=
{{
marginLeft
:
15
}}
/
>
<
/div
>
<
/Grid
>
<
Menu
id
=
"fade-menu"
anchorEl
=
{
anchorEl
}
keepMounted
open
=
{
open
}
onClose
=
{
handleClose
}
TransitionComponent
=
{
Fade
}
>
<
MenuItem
disabled
=
{
true
}
style
=
{{
opacity
:
1
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Avatar
className
=
{
classes
.
orangeAvatar
}
>
T
<
/Avatar
>
<
div
>
<
Typography
>
Tommy
<
/Typography
>
<
Typography
>
tom_my
@
gmail
.
com
<
/Typography
>
<
/div
>
<
/div
>
<
/MenuItem
>
<
MenuItem
onClick
=
{
handleClose
}
>
<
Link
to
=
{
'/home/profile'
}
>
<
div
style
=
{{
display
:
'flex'
,
padding
:
10
}}
>
<
img
src
=
{
Images
.
setting
}
style
=
{{
height
:
20
,
width
:
20
,
marginRight
:
20
}}
/
>
<
Typography
style
=
{{
color
:
'black'
,
textDecoration
:
'none'
}}
>
Settings
<
/Typography
>
<
/div
>
<
/Link
>
<
/MenuItem
>
<
MenuItem
onClick
=
{
handleLogout
}
>
<
div
style
=
{{
display
:
'flex'
,
padding
:
10
}}
>
<
img
src
=
{
Images
.
logout
}
style
=
{{
height
:
20
,
width
:
20
,
marginRight
:
20
}}
/
>
<
Typography
>
Logout
<
/Typography
>
<
/div
>
<
/MenuItem
>
<
/Menu
>
<
/div
>
);
}
const
footerStyle
=
{
backgroundColor
:
"#0d2846"
,
fontSize
:
"20px"
,
color
:
"white"
,
// borderTop: "1px solid #E7E7E7",
textAlign
:
"center"
,
padding
:
"20px"
,
left
:
0
,
bottom
:
0
,
right
:
0
,
height
:
"80px"
,
width
:
"100%"
};
const
phantomStyle
=
{
display
:
"block"
,
};
function
Footer
({
children
})
{
return
(
<
div
>
{
/* <div style={phantomStyle} /> */
}
<
div
style
=
{
footerStyle
}
>
{
children
}
<
/div
>
<
/div
>
);
}
function
getWindowDimensions
()
{
const
{
innerWidth
:
width
,
innerHeight
:
height
}
=
window
;
return
{
width
,
height
};
}
function
UseWindowDimensions
()
{
const
[
windowDimensions
,
setWindowDimensions
]
=
useState
(
getWindowDimensions
()
);
useEffect
(()
=>
{
function
handleResize
()
{
setWindowDimensions
(
getWindowDimensions
());
}
window
.
addEventListener
(
"resize"
,
handleResize
);
return
()
=>
window
.
removeEventListener
(
"resize"
,
handleResize
);
},
[]);
return
windowDimensions
;
}
export
{
FadeMenu
,
Footer
,
UseWindowDimensions
};
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