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 React, { useEffect } from 'react';
|
||||||
import { AppIcon } from './AppIcon';
|
import { AppIcon } from './AppIcon';
|
||||||
import { useTranslation } from 'react-i18next';
|
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 { Link } from 'react-router-dom';
|
||||||
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
||||||
|
|
||||||
@@ -14,22 +14,22 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
width: '20%',
|
width: '20%',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
bottom: 0,
|
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const GridMenu = ({ items, Component = AppIcon }) => {
|
export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||||
const { t } = useTranslation();
|
|
||||||
const setKey = useKeyboard();
|
const setKey = useKeyboard();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(function registerKeyHandlers() {
|
useEffect(function registerKeyHandlers() {
|
||||||
setKey('ArrowLeft', () => {
|
setKey('ArrowLeft', () => {
|
||||||
console.log(':v');
|
console.log(':v');
|
||||||
});
|
});
|
||||||
// eslint-disable-next-linep
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
// TODO: Fix tooltip position to be closer to app icon
|
||||||
return (
|
return (
|
||||||
<Grid container justify='center'>
|
<Grid container justify='center'>
|
||||||
<Grid container item>
|
<Grid container item>
|
||||||
@@ -37,21 +37,23 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
|
|||||||
items.length &&
|
items.length &&
|
||||||
items.map((item) => (
|
items.map((item) => (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
arrow
|
||||||
key={item.id}
|
key={item.id}
|
||||||
title={t(item.nameLocale)}
|
title={t(item.nameLocale)}
|
||||||
placement="bottom"
|
placement='top'
|
||||||
classes={{ tooltip: classes.tooltip }}
|
classes={{ tooltip: classes.tooltip }}
|
||||||
|
TransitionComponent={Zoom}
|
||||||
>
|
>
|
||||||
<Grid
|
<Grid
|
||||||
key={item.id}
|
key={item.id}
|
||||||
item
|
item
|
||||||
className={classes.item}
|
className={classes.item}
|
||||||
component={Link}
|
component={Link}
|
||||||
to={item.path}
|
to={item.path}
|
||||||
>
|
>
|
||||||
<Component {...item} />
|
<Component {...item} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in new issue
Block a user