Merge pull request #68 from project-error/fix/zoom

Fixed issues with using non standard `zoom` css property
This commit is contained in:
Taso authored and GitHub committed 2021-02-06 13:38:05 -05:00
commit 686b86acf9
5 files changed
+36 -27

No files matched your search

+8 -2
View File
@@ -1,12 +1,13 @@
.PhoneWrapper {
width: 100vw;
height: 100vh;
position: relative;
}
.Phone {
position: absolute;
bottom: 0vh;
right: 0vh;
bottom: 0;
right: 0;
width: 500px;
height: 1000px;
background-size: cover;
@@ -58,3 +59,8 @@
*::-webkit-scrollbar-thumb {
background-color: #666;
}
.zoomProp {
transform: scale(10);
}
+5 -2
View File
@@ -324,8 +324,11 @@ function Phone() {
return (
<ThemeProvider theme={currentTheme()}>
<div className='PhoneWrapper'>
<div style={{ zoom: settings.zoom }}>
<div className='Phone'>
<div>
<div
className='Phone'
style={{ transformOrigin: 'right bottom', transform: `scale(${settings.zoom}` }}
>
<div
className='PhoneFrame'
style={{
@@ -9,7 +9,7 @@ import {
interface IProps {
options?: any;
label: string;
value?: string | null;
value?: string | number | null;
onClick?: any;
icon: JSX.Element;
}
+2 -2
View File
@@ -11,7 +11,7 @@
"wallpaper": "minimal.png",
"frame": "s10.png",
"theme": "taso-dark",
"zoom": "100%",
"zoom": 1,
"ringtone": "pixel",
"ringtoneVol": 100
},
@@ -20,7 +20,7 @@
"logLevel": 1
},
"frames": ["s10.png"],
"zoomOptions": ["120%", "100%", "80%", "60%", "40%"],
"zoomOptions": [1, 0.9, 0.8],
"ringtones": ["marimba", "pixel"],
"themes": {
"default-dark": {
+20 -20
View File
@@ -1,6 +1,7 @@
import React, { useEffect } from 'react';
import { AppIcon } from './AppIcon';
import { Grid, makeStyles } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
import { Grid, makeStyles, Tooltip, Zoom } from '@material-ui/core';
import { Link } from 'react-router-dom';
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
@@ -13,7 +14,6 @@ const useStyles = makeStyles((theme) => ({
width: '20%',
},
tooltip: {
bottom: -8,
fontSize: 12,
},
}));
@@ -21,6 +21,7 @@ const useStyles = makeStyles((theme) => ({
export const GridMenu = ({ items, Component = AppIcon }) => {
const setKey = useKeyboard();
const classes = useStyles();
const { t } = useTranslation();
useEffect(function registerKeyHandlers() {
setKey('ArrowLeft', () => {
@@ -28,32 +29,31 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
});
// eslint-disable-next-line
}, []);
// TODO: Fix tooltip position to be closer to app icon
return (
<Grid container justify='center'>
<Grid container item>
{items &&
items.length &&
items.map((item) => (
// <Tooltip
// title={item.id}
// placement='top'
// arrow
// classes={{ tooltip: classes.tooltip }}
// PopperProps={{
// anchorEl={}
// }}
// >
<Grid
<Tooltip
arrow
key={item.id}
item
className={classes.item}
component={Link}
to={item.path}
title={t(item.nameLocale)}
placement='top'
classes={{ tooltip: classes.tooltip }}
TransitionComponent={Zoom}
>
<Component {...item} />
</Grid>
// </Tooltip>
<Grid
key={item.id}
item
className={classes.item}
component={Link}
to={item.path}
>
<Component {...item} />
</Grid>
</Tooltip>
))}
</Grid>
</Grid>