Commit 98946a32 authored by Deni Rinaldi's avatar Deni Rinaldi

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

tooltipMenu

See merge request !240
parents 9fa80097 01509e4f
...@@ -18,6 +18,7 @@ import Collapse from '@material-ui/core/Collapse'; ...@@ -18,6 +18,7 @@ import Collapse from '@material-ui/core/Collapse';
import DateFnsUtils from '@date-io/date-fns'; import DateFnsUtils from '@date-io/date-fns';
import { MuiPickersUtilsProvider } from "@material-ui/pickers"; import { MuiPickersUtilsProvider } from "@material-ui/pickers";
import localeID from 'date-fns/locale/en-US'; import localeID from 'date-fns/locale/en-US';
import ReactTooltip from 'react-tooltip';
import { import {
BrowserRouter as Router, BrowserRouter as Router,
...@@ -511,20 +512,26 @@ export default function MiniDrawer() { ...@@ -511,20 +512,26 @@ export default function MiniDrawer() {
{application.map((item, index) => ( {application.map((item, index) => (
<div style={{ marginTop: index === 0 ? null : 5 }} > <div style={{ marginTop: index === 0 ? null : 5 }} >
{item.subItem.length !== 0 ? {item.subItem.length !== 0 ?
<div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 5, paddingRight: 10, cursor: 'pointer' }} onClick={() => { handleCollapse(item) }}> <a data-tip={item.label} data-for={item.label}>
<ListItem key={item.label}> <div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 5, paddingRight: 10, cursor: 'pointer' }} onClick={() => { handleCollapse(item) }}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} /></ListItemIcon> <ListItem key={item.label}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography> <ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} /></ListItemIcon>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
{item.subItem.length !== 0 ? (item.collapse ? <ExpandLess style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} /> : <ExpandMore style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} />) : null} </ListItem>
</div> {item.subItem.length !== 0 ? (item.collapse ? <ExpandLess style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} /> : <ExpandMore style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} />) : null}
{!open && (<ReactTooltip border={true} id={item.label} place="bottom" type="light" effect="solid" />)}
</div>
</a>
: :
<Link to={`${url}/${item.path}`}> <Link to={`${url}/${item.path}`}>
<div style={{ paddingLeft: 5 }} className={selectedIndex === item.label ? "active" : ""}> <div style={{ paddingLeft: 5 }} className={selectedIndex === item.label ? "active" : ""}>
<ListItem button key={item.label} onClick={() => selectIndex(item.label)}> <a data-tip={item.label} data-for={item.label}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} style={{ fill: '#525355' }} /></ListItemIcon> <ListItem button key={item.label} onClick={() => selectIndex(item.label)}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography> <ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} style={{ fill: '#525355' }} /></ListItemIcon>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
</ListItem>
</a>
{!open && (<ReactTooltip border={true} id={item.label} place="bottom" type="light" effect="solid" />)}
</div> </div>
</Link> </Link>
} }
...@@ -535,11 +542,14 @@ export default function MiniDrawer() { ...@@ -535,11 +542,14 @@ export default function MiniDrawer() {
{item.subItem.map((sub, indexs) => { {item.subItem.map((sub, indexs) => {
return ( return (
<Link to={sub.label === "Logout" ? `/` : `${url}/${sub.path}`}> <Link to={sub.label === "Logout" ? `/` : `${url}/${sub.path}`}>
<div style={{ paddingLeft: 5, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => sub.label === "Logout" ? logout() : selectSub(sub.label)}> <a data-tip={sub.label} data-for={sub.label}>
<ListItem button style={{ paddingLeft: 57 }}> <div style={{ paddingLeft: 5, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => sub.label === "Logout" ? logout() : selectSub(sub.label)}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{sub.label}</Typography> <ListItem button style={{ paddingLeft: 57 }}>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{sub.label}</Typography>
</div> </ListItem>
</div>
</a>
{!open && (<ReactTooltip border={true} id={sub.label} place="bottom" type="light" effect="solid" />)}
</Link> </Link>
) )
})} })}
...@@ -559,20 +569,26 @@ export default function MiniDrawer() { ...@@ -559,20 +569,26 @@ export default function MiniDrawer() {
{setting.map((item, index) => ( {setting.map((item, index) => (
<div style={{ marginTop: index === 0 ? null : 5 }} > <div style={{ marginTop: index === 0 ? null : 5 }} >
{item.subItem.length !== 0 ? {item.subItem.length !== 0 ?
<div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 5, paddingRight: 10, cursor: 'pointer' }} onClick={() => { handleCollapseSetting(item) }}> <a data-tip={item.label} data-for={item.label}>
<ListItem key={item.label}> <div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 5, paddingRight: 10, cursor: 'pointer' }} onClick={() => { handleCollapseSetting(item) }}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} /></ListItemIcon> <ListItem key={item.label}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography> <ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} /></ListItemIcon>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
{item.subItem.length !== 0 ? (item.collapse ? <ExpandLess style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} /> : <ExpandMore style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} />) : null} </ListItem>
</div> {item.subItem.length !== 0 ? (item.collapse ? <ExpandLess style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} /> : <ExpandMore style={{ color: "#525355", marginLeft: 50, alignSelf: 'center' }} />) : null}
{!open && (<ReactTooltip border={true} id={item.label} place="bottom" type="light" effect="solid" />)}
</div>
</a>
: :
<Link to={`${url}/${item.path}`}> <Link to={`${url}/${item.path}`}>
<div style={{ paddingLeft: 5 }} className={selectedIndex === item.label ? "active" : ""}> <div style={{ paddingLeft: 5 }} className={selectedIndex === item.label ? "active" : ""}>
<ListItem button key={item.label} onClick={() => selectIndex(item.label)}> <a data-tip={item.label} data-for={item.label}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} style={{ fill: '#525355' }} /></ListItemIcon> <ListItem button key={item.label} onClick={() => selectIndex(item.label)}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography> <ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} style={{ fill: '#525355' }} /></ListItemIcon>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
</ListItem>
</a>
{!open && (<ReactTooltip border={true} id={item.label} place="bottom" type="light" effect="solid" />)}
</div> </div>
</Link> </Link>
} }
...@@ -583,11 +599,14 @@ export default function MiniDrawer() { ...@@ -583,11 +599,14 @@ export default function MiniDrawer() {
{item.subItem.map((sub, indexs) => { {item.subItem.map((sub, indexs) => {
return ( return (
<Link to={sub.label === "Logout" ? `/` : `${url}/${sub.path}`}> <Link to={sub.label === "Logout" ? `/` : `${url}/${sub.path}`}>
<div style={{ paddingLeft: 5, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => sub.label === "Logout" ? logout() : selectSub(sub.label)}> <a data-tip={sub.label} data-for={sub.label}>
<ListItem button style={{ paddingLeft: 57 }}> <div style={{ paddingLeft: 5, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => sub.label === "Logout" ? logout() : selectSub(sub.label)}>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{sub.label}</Typography> <ListItem button style={{ paddingLeft: 57 }}>
</ListItem> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{sub.label}</Typography>
</div> </ListItem>
</div>
</a>
{!open && (<ReactTooltip border={true} id={sub.label} place="bottom" type="light" effect="solid" />)}
</Link> </Link>
) )
})} })}
......
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