Commit 87848a42 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

profile1

See merge request !22
parents f5525d3e e99a9640
import React from 'react'; import React, { useState, useEffect } from 'react';
import Menu from '@material-ui/core/Menu'; import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem'; import MenuItem from '@material-ui/core/MenuItem';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
...@@ -6,6 +6,7 @@ import Fade from '@material-ui/core/Fade'; ...@@ -6,6 +6,7 @@ import Fade from '@material-ui/core/Fade';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import { Typography, Avatar } from '@material-ui/core'; import { Typography, Avatar } from '@material-ui/core';
import Images from '../assets/Images'; import Images from '../assets/Images';
import { Link, useRouteMatch } from 'react-router-dom';
const useStyles = makeStyles({ const useStyles = makeStyles({
avatar: { avatar: {
...@@ -32,6 +33,8 @@ function FadeMenu() { ...@@ -32,6 +33,8 @@ function FadeMenu() {
const classes = useStyles(); const classes = useStyles();
let { path, url } = useRouteMatch();
return ( return (
<div> <div>
<Grid container justify="center" alignItems="center" > <Grid container justify="center" alignItems="center" >
...@@ -58,8 +61,10 @@ function FadeMenu() { ...@@ -58,8 +61,10 @@ function FadeMenu() {
</MenuItem> </MenuItem>
<MenuItem onClick={handleClose}> <MenuItem onClick={handleClose}>
<div style={{ display: 'flex', padding: 10 }}> <div style={{ display: 'flex', padding: 10 }}>
<img src={Images.setting} style={{ height: 20, width: 20, marginRight: 20 }} /> <Link to={'/home/profile'}>
<Typography>Settings</Typography> <img src={Images.setting} style={{ height: 20, width: 20, marginRight: 20 }} />
<Typography>Settings</Typography>
</Link>
</div> </div>
</MenuItem> </MenuItem>
<MenuItem onClick={handleClose}> <MenuItem onClick={handleClose}>
...@@ -80,24 +85,49 @@ const footerStyle = { ...@@ -80,24 +85,49 @@ const footerStyle = {
// borderTop: "1px solid #E7E7E7", // borderTop: "1px solid #E7E7E7",
textAlign: "center", textAlign: "center",
padding: "20px", padding: "20px",
left: "0", left: 0,
bottom: "0", bottom: 0,
right: 0,
height: "80px", height: "80px",
width: "100%" width: "100%"
}; };
const phantomStyle = { const phantomStyle = {
display: "block", display: "block",
}; };
function Footer({ children }) { function Footer({ children }) {
return ( return (
<div> <div>
{/* <div style={phantomStyle} /> */} {/* <div style={phantomStyle} /> */}
<div style={footerStyle}>{children}</div> <div style={footerStyle}>{children}</div>
</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 }; export { FadeMenu, Footer, UseWindowDimensions };
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -5,25 +5,30 @@ import ApprovalMatrix from '../container/ApprovalMatrix' ...@@ -5,25 +5,30 @@ import ApprovalMatrix from '../container/ApprovalMatrix'
import BudgetTahunan from '../container/BudgetTahunan'; import BudgetTahunan from '../container/BudgetTahunan';
import HomePage from '../container/HomePage'; import HomePage from '../container/HomePage';
import BalanceSheet from '../container/BudgetTahunan/BalanceSheet'; import BalanceSheet from '../container/BudgetTahunan/BalanceSheet';
import Profile from '../container/Profile';
const routes = [ const routes = [
{ {
path: "/home/beranda", path: "/home/beranda",
main: HomePage main: HomePage
}, },
{ {
path: "/home/userrole", path: "/home/userrole",
main: UserRole main: UserRole
}, },
{ {
path: "/home/approval", path: "/home/approval",
main: ApprovalMatrix main: ApprovalMatrix
}, },
{ {
path: "/home/budget-tahunan", path: "/home/budget-tahunan",
main: BalanceSheet main: BalanceSheet
}, },
{
]; path: "/home/profile",
main: Profile
},
];
export default routes; export default routes;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment