mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Working tooltips
This commit is contained in:
1 parent
63aea89e2b
commit
948f8dfade
1 file changed
+19
-19
@@ -1,6 +1,7 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AppIcon } from './AppIcon';
|
||||
import { Grid, makeStyles } from '@material-ui/core';
|
||||
import { Grid, makeStyles, Tooltip } from '@material-ui/core';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
||||
|
||||
@@ -13,12 +14,13 @@ const useStyles = makeStyles((theme) => ({
|
||||
width: '20%',
|
||||
},
|
||||
tooltip: {
|
||||
bottom: -8,
|
||||
bottom: -12,
|
||||
fontSize: 12,
|
||||
},
|
||||
}));
|
||||
|
||||
export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||
const { t } = useTranslation();
|
||||
const setKey = useKeyboard();
|
||||
const classes = useStyles();
|
||||
|
||||
@@ -35,25 +37,23 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||
{items &&
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
// <Tooltip
|
||||
// title={item.id}
|
||||
// placement='top'
|
||||
// arrow
|
||||
// classes={{ tooltip: classes.tooltip }}
|
||||
// PopperProps={{
|
||||
// anchorEl={}
|
||||
// }}
|
||||
// >
|
||||
<Grid
|
||||
<Tooltip
|
||||
key={item.id}
|
||||
item
|
||||
className={classes.item}
|
||||
component={Link}
|
||||
to={item.path}
|
||||
title={t(item.nameLocale)}
|
||||
placement="top-start"
|
||||
classes={{ tooltip: classes.tooltip }}
|
||||
arrow
|
||||
>
|
||||
<Component {...item} />
|
||||
</Grid>
|
||||
// </Tooltip>
|
||||
<Grid
|
||||
key={item.id}
|
||||
item
|
||||
className={classes.item}
|
||||
component={Link}
|
||||
to={item.path}
|
||||
>
|
||||
<Component {...item} />
|
||||
</Grid>
|
||||
</Tooltip>
|
||||
))}
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in new issue
Block a user