Merge branch 'ui-changes'

This commit is contained in:
Taso committed 2020-12-12 16:22:17 -05:00
commit f3af0eebd4
29 files changed
+400 -248

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ import { AppContentTypes } from "../interface/InterfaceUI";
const useStyles = makeStyles(() => ({
wrapper: {
height: "67vh",
height: "70vh", // NOTE: Taso: Hacky change temp, this should be done automatically tbh. Will refactor at some point
overflow: "auto",
},
box: {
@@ -32,7 +32,7 @@ export const AppContent = ({
}: AppContentTypes) => {
const classes = useStyles();
return (
<Paper className={classes.wrapper}>
<Paper className={classes.wrapper} square>
<Box flexGrow={1} className={classes.box} {...props}>
<Paper square elevation={0} className={classes.paper}>
<Backdrop
+5 -4
View File
@@ -18,7 +18,7 @@ const useStyle = makeStyles(
(theme): IUseStyle => ({
root: ({ backgroundColor }) => ({
width: "100%",
textAlign: "center",
textAlign: "left",
backgroundColor: backgroundColor || theme.palette.background.default,
}),
text: ({ color }) => ({
@@ -26,16 +26,17 @@ const useStyle = makeStyles(
}),
})
);
// Taso: Maybe we should pass an icon (maybe fa?) as a prop as well at somepoint
// but need to think about the best way to do that for standardization sake.
export const AppTitle = ({
app: { backgroundColor, color, nameLocale },
variant = "h4",
variant = "h5",
...props
}: IProps) => {
const classes = useStyle({ color, backgroundColor });
const { t } = useTranslation();
return (
<Box px={2} pt={4} className={classes.root} {...props}>
<Box px={2} pt={2} className={classes.root} {...props}>
<Typography className={classes.text} paragraph variant={variant}>
{t(nameLocale)}
</Typography>
+8 -8
View File
@@ -1,18 +1,18 @@
import React from "react";
import React from 'react';
import {
ListItemIcon,
ListItemText,
Slide,
makeStyles,
Paper,
} from "@material-ui/core";
import { List } from "./List";
import { ListItem } from "./ListItem";
} from '@material-ui/core';
import { List } from './List';
import { ListItem } from './ListItem';
const useStyles = makeStyles((theme) => ({
root: {
width: "100%",
position: "absolute",
width: '100%',
position: 'absolute',
bottom: 0,
zIndex: 2,
},
@@ -21,9 +21,9 @@ const useStyles = makeStyles((theme) => ({
export const ContextMenu = ({ open, onClose, options }) => {
const classes = useStyles();
return (
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
<Slide direction='up' in={open} mountOnEnter unmountOnExit>
<Paper square className={classes.root}>
<List>
<List disablePadding>
{options.map((option) => (
<ListItem
selected={option.selected}
+23 -9
View File
@@ -1,8 +1,8 @@
import React, { useEffect } from "react";
import { AppIcon } from "./AppIcon";
import { Grid, makeStyles } from "@material-ui/core";
import { Link } from "react-router-dom";
import { useKeyboard } from "../../os/keyboard/hooks/useKeyboard";
import React, { useEffect } from 'react';
import { AppIcon } from './AppIcon';
import { Grid, makeStyles, Tooltip } from '@material-ui/core';
import { Link } from 'react-router-dom';
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
const useStyles = makeStyles((theme) => ({
root: {
@@ -10,7 +10,11 @@ const useStyles = makeStyles((theme) => ({
},
item: {
marginTop: theme.spacing(3),
width: "20%",
width: '20%',
},
tooltip: {
bottom: -8,
fontSize: 12,
},
}));
@@ -19,18 +23,27 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
const classes = useStyles();
useEffect(function registerKeyHandlers() {
setKey("ArrowLeft", () => {
console.log(":v");
setKey('ArrowLeft', () => {
console.log(':v');
});
// eslint-disable-next-line
}, []);
return (
<Grid container justify="center">
<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
key={item.id}
item
@@ -40,6 +53,7 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
>
<Component {...item} />
</Grid>
// </Tooltip>
))}
</Grid>
</Grid>