From d6a8c45d5270e8e21e4d61bfccb52796a78af29d Mon Sep 17 00:00:00 2001 From: RockySouthpaw <55056068+RockySouthpaw@users.noreply.github.com> Date: Wed, 3 Feb 2021 20:22:30 -0500 Subject: [PATCH] Revert "Merge pull request #62 from project-error/feature/show-app-name-on-hover" This reverts commit 5f7875182c91bbccbbb1b5e68e155afc4c06614f. --- phone/src/os/apps/hooks/useApps.tsx | 12 +------- phone/src/ui/components/AppIcon.tsx | 5 ++- phone/src/ui/components/GridMenu.tsx | 46 ++++++++++++---------------- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index 7d29fe9..7ceccbc 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -39,16 +39,6 @@ import { SelloutApp } from '../../../apps/sellout/components/SelloutApp'; import { NotesApp } from '../../../apps/notes/NotesApp'; import CameraApp from '../../../apps/camera/components/CameraApp'; -export interface AppConfiguration { - id: string; - nameLocale: string; - icon: JSX.Element; - backgroundColor: string; - color: string; - path: string; - Route: () => JSX.Element; -} - const appsState = atom({ key: 'apps', default: { @@ -158,7 +148,7 @@ const appsState = atom({ export const useApps = () => { const [apps, setApps] = useConfig(appsState); - const allApps: AppConfiguration[] = [...apps.preinstalled]; + const allApps = [...apps.preinstalled]; const getApp = (id) => allApps.find((a) => a.id === id) || null; diff --git a/phone/src/ui/components/AppIcon.tsx b/phone/src/ui/components/AppIcon.tsx index 590cc3e..0b3c10a 100644 --- a/phone/src/ui/components/AppIcon.tsx +++ b/phone/src/ui/components/AppIcon.tsx @@ -4,7 +4,6 @@ import Avatar from '@material-ui/core/Avatar'; import { green } from '@material-ui/core/colors'; import { Button } from '@material-ui/core'; import Nui from '../../os/nui-events/utils/Nui'; -import { AppConfiguration } from '../../os/apps/hooks/useApps'; interface IStyles { root: any; @@ -30,7 +29,7 @@ const useStyles = makeStyles( }) ); -export const AppIcon = ({ id, icon, backgroundColor, color }: AppConfiguration) => { +export const AppIcon = ({ id, name, icon, backgroundColor, color }) => { const classes = useStyles({ backgroundColor: backgroundColor || green[50], color: color || green[400], @@ -43,7 +42,7 @@ export const AppIcon = ({ id, icon, backgroundColor, color }: AppConfiguration) return ( ); diff --git a/phone/src/ui/components/GridMenu.tsx b/phone/src/ui/components/GridMenu.tsx index f3145d9..564d0a4 100644 --- a/phone/src/ui/components/GridMenu.tsx +++ b/phone/src/ui/components/GridMenu.tsx @@ -1,10 +1,8 @@ import React, { useEffect } from 'react'; -import { useTranslation } from 'react-i18next'; import { AppIcon } from './AppIcon'; -import { Grid, makeStyles, Tooltip } from '@material-ui/core'; +import { Grid, makeStyles } from '@material-ui/core'; import { Link } from 'react-router-dom'; import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard'; -import { AppConfiguration } from '../../os/apps/hooks/useApps'; const useStyles = makeStyles((theme) => ({ root: { @@ -15,18 +13,12 @@ const useStyles = makeStyles((theme) => ({ width: '20%', }, tooltip: { - bottom: -12, + bottom: -8, fontSize: 12, }, })); -interface IProps { - items: AppConfiguration[]; - Component: (...AppConfiguration) => JSX.Element; -} - -export const GridMenu = ({ items, Component = AppIcon }: IProps) => { - const { t } = useTranslation(); +export const GridMenu = ({ items, Component = AppIcon }) => { const setKey = useKeyboard(); const classes = useStyles(); @@ -43,23 +35,25 @@ export const GridMenu = ({ items, Component = AppIcon }: IProps) => { {items && items.length && items.map((item) => ( - + - - - - + + + // ))}