mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(phone/app-grid): Tweaked tooltip styling
This commit is contained in:
1 parent
28b2599e75
commit
263275b921
1 file changed
+18
-16
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { AppIcon } from './AppIcon';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Grid, makeStyles, Tooltip } from '@material-ui/core';
|
||||
import { Grid, makeStyles, Tooltip, Zoom } from '@material-ui/core';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
||||
|
||||
@@ -14,22 +14,22 @@ const useStyles = makeStyles((theme) => ({
|
||||
width: '20%',
|
||||
},
|
||||
tooltip: {
|
||||
bottom: 0,
|
||||
fontSize: 12,
|
||||
},
|
||||
}));
|
||||
|
||||
export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||
const { t } = useTranslation();
|
||||
const setKey = useKeyboard();
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(function registerKeyHandlers() {
|
||||
setKey('ArrowLeft', () => {
|
||||
console.log(':v');
|
||||
});
|
||||
// eslint-disable-next-linep
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
// TODO: Fix tooltip position to be closer to app icon
|
||||
return (
|
||||
<Grid container justify='center'>
|
||||
<Grid container item>
|
||||
@@ -37,21 +37,23 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
<Tooltip
|
||||
arrow
|
||||
key={item.id}
|
||||
title={t(item.nameLocale)}
|
||||
placement="bottom"
|
||||
placement='top'
|
||||
classes={{ tooltip: classes.tooltip }}
|
||||
TransitionComponent={Zoom}
|
||||
>
|
||||
<Grid
|
||||
key={item.id}
|
||||
item
|
||||
className={classes.item}
|
||||
component={Link}
|
||||
to={item.path}
|
||||
>
|
||||
<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