diff --git a/phone/src/Phone.js b/phone/src/Phone.js index d8ace59..602cdf4 100644 --- a/phone/src/Phone.js +++ b/phone/src/Phone.js @@ -8,7 +8,7 @@ import MessageIcon from "@material-ui/icons/Email"; import { HomeApp } from "./apps/home/components/Home"; import { ContactsApp } from "./apps/contacts/components/ContactsApp"; import { SettingsApp } from "./apps/settings/components/SettingsApp"; -import { PhoneApp } from "./apps/phone/components/PhoneApp"; +import { DialerApp } from "./apps/dialer/components/DialerApp"; import { BankApp } from "./apps/bank/components/BankApp"; import { ThemeProvider } from "@material-ui/core"; import { CalculatorApp } from "./apps/calculator/components/CalculatorApp"; @@ -18,8 +18,10 @@ import { NotificationBar } from "./os/notifications/components/NotificationBar"; import { Navigation } from "./os/navigation-bar/components/Navigation"; import { useNuiService } from "./os/nui-events/hooks/useNuiService"; import { useSimcardService } from "./os/simcard/hooks/useSimcardService"; +import { usePhoneService } from "./os/phone/hooks/usePhoneService"; // @TODO: Remove this testing shit +// Used for testing NUI events while we work on clientside setTimeout(() => { window.dispatchEvent( new MessageEvent("message", { @@ -32,12 +34,49 @@ setTimeout(() => { ); }, 3000); +setTimeout(() => { + window.dispatchEvent( + new MessageEvent("message", { + data: { + app: "PHONE", + method: "setPowerOff", + data: false, + }, + }) + ); +}, 4000); + +setTimeout(() => { + window.dispatchEvent( + new MessageEvent("message", { + data: { + app: "PHONE", + method: "setVisibility", + data: true, + }, + }) + ); +}, 3000); + function Phone() { useNuiService(); + const { visibility, powerOff } = usePhoneService(); useSimcardService(); useInitKeyboard(); const { settings, currentTheme } = useSettings(); + if (visibility === false) { + return null; + } + + const screenStyle = powerOff + ? { + backgroundColor: "black", + } + : { + backgroundImage: `url(${process.env.PUBLIC_URL}/media/backgrounds/${settings.wallpaper})`, + }; + return (
@@ -49,30 +88,28 @@ function Phone() { backgroundImage: `url(${process.env.PUBLIC_URL}/media/frames/${settings.frame})`, }} >
-
- , - }, - ]} - /> -
- - - - - - -
- +
+ {!powerOff && ( + <> + , + }, + ]} + /> +
+ + + + + + +
+ + + )}
diff --git a/phone/src/apps/appmarket/hooks/useApps.js b/phone/src/apps/appmarket/hooks/useApps.js deleted file mode 100644 index 2b622c1..0000000 --- a/phone/src/apps/appmarket/hooks/useApps.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { useEffect } from "react"; -import { useConfig } from "../../../config/hooks/useConfig"; -import { blue, grey, green, orange } from "@material-ui/core/colors"; -import { useTranslation } from "react-i18next"; -import ContactsIcon from "@material-ui/icons/Contacts"; -import SettingsIcon from '@material-ui/icons/Settings' -import PhoneIcon from '@material-ui/icons/Phone'; -import AccountBalanceIcon from '@material-ui/icons/AccountBalance'; -import { atom } from "recoil"; -import { useSettings } from "../../settings/hooks/useSettings"; -import { CalculatorIcon } from "../../calculator/components/CalculatorIcon"; - -const appsState = atom({ - key: "apps", - default: { preinstalled: [] }, -}); - -export const useApps = () => { - const [apps, setApps] = useConfig(appsState); - const { currentTheme } = useSettings(); - const { t } = useTranslation(); - useEffect(() => { - setApps("preinstalled", [ - { - id: "phone", - name: t("APPS_PHONE"), - icon: , - backgroundColor: green[400], - color: green[50], - path: "/phone", - }, - { - id: "contacts", - name: t("APPS_CONTACTS"), - icon: , - backgroundColor: blue[500], - color: blue[50], - path: "/contacts", - }, - { - id: "calculator", - name: t("APPS_CALCULATOR"), - icon: , - backgroundColor: currentTheme().palette.primary.light, - color: currentTheme().palette.primary.contrastText, - path: "/calculator", - }, - { - id: "settings", - name: t("APPS_SETTINGS"), - icon: , - backgroundColor: grey[700], - color: grey[50], - path: '/settings' - }, - { - id: 'bank', - name: t('APPS_BANK'), - icon: , - backgroundColor: orange[600], - color: orange[50], - path: '/bank' - }, - ]); - // eslint-disable-next-line - }, []); - - const allApps = [...apps.preinstalled]; - - const getApp = (id) => allApps.find((a) => a.id === id) || {}; - - return { apps, allApps, setApps, getApp }; -}; diff --git a/phone/src/apps/bank/components/BankApp.js b/phone/src/apps/bank/components/BankApp.js index 001b014..bb4584e 100644 --- a/phone/src/apps/bank/components/BankApp.js +++ b/phone/src/apps/bank/components/BankApp.js @@ -5,9 +5,10 @@ import { AppWrapper } from "../../../ui/components"; import { AppContent } from "../../../ui/components/AppContent"; import { useTranslation } from "react-i18next"; import { Button } from "@material-ui/core"; -import { useBank } from '../hooks/useBank'; -import { TransactionList } from './transactionList'; +import { useBank } from "../hooks/useBank"; +import { TransactionList } from "./TransactionList"; import "./BankApp.css"; +import { useApp } from "../../../os/apps/hooks/useApps"; const useStyles = makeStyles((theme) => ({ root: { @@ -33,11 +34,10 @@ export const BankApp = () => { const { transactionList } = useBank(); const { t } = useTranslation(); const classes = useStyles(); + const bank = useApp("BANK"); return ( - -

WhoDis Banking

-
+
- +
); diff --git a/phone/src/apps/bank/components/transactionList.js b/phone/src/apps/bank/components/transactionList.js index 3171c8b..0610fe5 100644 --- a/phone/src/apps/bank/components/transactionList.js +++ b/phone/src/apps/bank/components/transactionList.js @@ -1,19 +1,19 @@ -import React from 'react'; -import { List } from '../../../ui/components/List'; -import { ListItem } from '../../../ui/components/ListItem'; +import React from "react"; +import { List } from "../../../ui/components/List"; +import { ListItem } from "../../../ui/components/ListItem"; import ListItemText from "@material-ui/core/ListItemText"; export const TransactionList = ({ transactions }) => { - return ( - - {transactions.map((transaction) => ( - - - - ))} - - ) -} \ No newline at end of file + return ( + + {transactions.map((transaction) => ( + + + + ))} + + ); +}; diff --git a/phone/src/apps/calculator/components/CalculatorApp.js b/phone/src/apps/calculator/components/CalculatorApp.js index c6e2464..d1542a2 100644 --- a/phone/src/apps/calculator/components/CalculatorApp.js +++ b/phone/src/apps/calculator/components/CalculatorApp.js @@ -2,18 +2,14 @@ import React from "react"; import { AppWrapper } from "../../../ui/components"; import { AppTitle } from "../../../ui/components/AppTitle"; import { AppContent } from "../../../ui/components/AppContent"; -import { useTranslation } from "react-i18next"; -import { useApps } from "../../appmarket/hooks/useApps"; import { Calculator } from "./Calculator"; +import { useApp } from "../../../os/apps/hooks/useApps"; export const CalculatorApp = () => { - const { t } = useTranslation(); - const { getApp } = useApps(); + const calculator = useApp("CALCULATOR"); return ( - - {t("APPS_CALCULATOR")} - + diff --git a/phone/src/apps/contacts/components/ContactsApp.js b/phone/src/apps/contacts/components/ContactsApp.js index 237b5f8..ca0de73 100644 --- a/phone/src/apps/contacts/components/ContactsApp.js +++ b/phone/src/apps/contacts/components/ContactsApp.js @@ -2,24 +2,20 @@ import React from "react"; import { AppWrapper } from "../../../ui/components"; import { AppTitle } from "../../../ui/components/AppTitle"; import { AppContent } from "../../../ui/components/AppContent"; -import { useTranslation } from "react-i18next"; import { useContacts } from "../hooks/useContacts"; import { ContactList } from "./ContactList"; -import { useApps } from "../../appmarket/hooks/useApps"; +import { useApp } from "../../../os/apps/hooks/useApps"; export const ContactsApp = () => { const { contactList } = useContacts(); - const { getApp } = useApps(); - const { t } = useTranslation(); + const contacts = useApp("CONTACTS"); return ( - - {t("APPS_CONTACTS")} - + console.log(contact))} + onCall={(contact) => console.log(contact)} onMessage={() => console.log("Opening messages")} /> diff --git a/phone/src/apps/dialer/components/DialerApp.js b/phone/src/apps/dialer/components/DialerApp.js new file mode 100644 index 0000000..6d36b65 --- /dev/null +++ b/phone/src/apps/dialer/components/DialerApp.js @@ -0,0 +1,20 @@ +import React from "react"; +import { AppWrapper } from "../../../ui/components"; +import { AppTitle } from "../../../ui/components/AppTitle"; +import { AppContent } from "../../../ui/components/AppContent"; +import { DialerHistory } from "./DialerHistory"; +import { useDialerHistory } from "../hooks/useDialerHistory"; +import { useApp } from "../../../os/apps/hooks/useApps"; + +export const DialerApp = () => { + const { history } = useDialerHistory(); + const dialer = useApp("DIALER"); + return ( + + + + + + + ); +}; diff --git a/phone/src/apps/phone/components/PhoneList.js b/phone/src/apps/dialer/components/DialerHistory.js similarity index 93% rename from phone/src/apps/phone/components/PhoneList.js rename to phone/src/apps/dialer/components/DialerHistory.js index aa0a192..189a1bf 100644 --- a/phone/src/apps/phone/components/PhoneList.js +++ b/phone/src/apps/dialer/components/DialerHistory.js @@ -10,7 +10,7 @@ const CallTypeIcon = { outgoing: , }; -export const PhoneList = ({ calls }) => { +export const DialerHistory = ({ calls }) => { return ( {calls.map((call) => ( diff --git a/phone/src/apps/dialer/hooks/useDialerHistory.js b/phone/src/apps/dialer/hooks/useDialerHistory.js new file mode 100644 index 0000000..cfc6d31 --- /dev/null +++ b/phone/src/apps/dialer/hooks/useDialerHistory.js @@ -0,0 +1,24 @@ +import { useRecoilState, atom } from "recoil"; + +const dialerHistoryState = atom({ + key: "dialerHistory", + default: [ + { + id: 0, + caller: "Kidz", + phoneNumber: "000-1111", + type: "incoming", + }, + { + id: 1, + caller: "ROCKY", + phoneNumber: "000-1112", + type: "outgoing", + }, + ], +}); + +export const useDialerHistory = () => { + const [history, setHistory] = useRecoilState(dialerHistoryState); + return { history, setHistory }; +}; diff --git a/phone/src/apps/home/components/Home.js b/phone/src/apps/home/components/Home.js index 7b72309..d97a0ba 100644 --- a/phone/src/apps/home/components/Home.js +++ b/phone/src/apps/home/components/Home.js @@ -1,14 +1,16 @@ import React from "react"; import { AppWrapper } from "../../../ui/components"; import { Box } from "@material-ui/core"; -import { useApps } from "../../appmarket/hooks/useApps"; import { GridMenu } from "../../../ui/components/GridMenu"; +import { useApps } from "../../../os/apps/hooks/useApps"; export const HomeApp = () => { const { apps } = useApps(); return ( - {apps && } + + {apps && } + ); }; diff --git a/phone/src/apps/phone/components/PhoneApp.js b/phone/src/apps/phone/components/PhoneApp.js deleted file mode 100644 index a91bfcd..0000000 --- a/phone/src/apps/phone/components/PhoneApp.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react' -import { AppWrapper } from "../../../ui/components"; -import { AppTitle } from "../../../ui/components/AppTitle"; -import { AppContent } from "../../../ui/components/AppContent"; -import { useTranslation } from "react-i18next"; -import { useApps } from "../../appmarket/hooks/useApps"; -import { PhoneList } from './PhoneList'; -import { useCalls } from '../hooks/useCalls'; - -export const PhoneApp = () => { - const { callList } = useCalls(); - const { getApp } = useApps(); - const { t } = useTranslation(); - return ( - - - {t("APPS_PHONE")} - - - - - - ) -} diff --git a/phone/src/apps/phone/hooks/useCalls.js b/phone/src/apps/phone/hooks/useCalls.js deleted file mode 100644 index 8cec4dc..0000000 --- a/phone/src/apps/phone/hooks/useCalls.js +++ /dev/null @@ -1,25 +0,0 @@ -import { useRecoilState, atom } from 'recoil'; - -const callListState = atom({ - key: 'callList', - default: [ - { - id: 0, - caller: 'Kidz', - phoneNumber: "000-1111", - type: 'incoming' - }, - { - id: 1, - caller: 'ROCKY', - phoneNumber: '000-1112', - type: 'outgoing' - }, - ], -}); - -export const useCalls = () => { - const [callList, setCallList] = useRecoilState - (callListState); - return { callList, setCallList }; -} \ No newline at end of file diff --git a/phone/src/apps/settings/components/SettingItem.js b/phone/src/apps/settings/components/SettingItem.js new file mode 100644 index 0000000..075299e --- /dev/null +++ b/phone/src/apps/settings/components/SettingItem.js @@ -0,0 +1,13 @@ +import React from "react"; +import { ListItem, ListItemText, Divider } from "@material-ui/core"; + +export const SettingItem = ({ options, label, value, onClick }) => { + return ( + <> + onClick(options)} button> + + + + + ); +}; diff --git a/phone/src/apps/settings/components/SettingsApp.js b/phone/src/apps/settings/components/SettingsApp.js index b416d00..a2ad205 100644 --- a/phone/src/apps/settings/components/SettingsApp.js +++ b/phone/src/apps/settings/components/SettingsApp.js @@ -1,37 +1,23 @@ import React from "react"; import { AppWrapper } from "../../../ui/components"; -import { ListItemText, Divider } from "@material-ui/core"; import { AppTitle } from "../../../ui/components/AppTitle"; import { AppContent } from "../../../ui/components/AppContent"; -import { useTranslation } from "react-i18next"; import { useContextMenu, MapStringOptions, } from "../../../ui/hooks/useContextMenu"; import { useConfig } from "../../../config/hooks/useConfig"; import { useSettings } from "../hooks/useSettings"; -import { useApps } from "../../appmarket/hooks/useApps"; import { List } from "../../../ui/components/List"; -import { ListItem } from "../../../ui/components/ListItem"; import { useSimcard } from "../../../os/simcard/hooks/useSimcard"; - -export const SettingItem = ({ options, label, value, onClick }) => { - return ( - <> - onClick(options)} button> - - - - - ); -}; +import { useApp } from "../../../os/apps/hooks/useApps"; +import { SettingItem } from "./SettingItem"; export const SettingsApp = () => { - const { t } = useTranslation(); + const settingsApp = useApp("SETTINGS"); const [config] = useConfig(); - const { getApp } = useApps(); const { setSettings, settings } = useSettings(); - const simcard = useSimcard(); + const simcard = useSimcard(); const wallpapers = config.wallpapers.map( MapStringOptions(settings.wallpaper, (val) => setSettings("wallpaper", val)) @@ -46,9 +32,7 @@ export const SettingsApp = () => { const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu(); return ( - - {t("APPS_SETTINGS")} - + { options={frames} onClick={openMenu} /> - + diff --git a/phone/src/locale/en.json b/phone/src/locale/en.json index c3d186c..8b55405 100644 --- a/phone/src/locale/en.json +++ b/phone/src/locale/en.json @@ -1,16 +1,16 @@ { - "translation": { - "COMING_SOON": "Coming soon...", - "APPS_PHONE": "Phone", - "APPS_CONTACTS": "Contacts", - "APPS_MESSAGES": "Messages", - "APPS_CALCULATOR": "Calculator", - "APPS_SETTINGS": "Settings", - "APPS_BANK": "WhoDis Banking", - "APPS_BANK_DEPOSIT": "Deposit", - "APPS_BANK_WITHDRAW": "Withdraw", - "APPS_BANK_TRANSFER": "Transfer", - "APPS_SETTINGS_OPTIONS_WALLPAPER": "Wallpaper", - "APPS_SETTINGS_OPTIONS_FRAME": "Frame" - } -} \ No newline at end of file + "translation": { + "COMING_SOON": "Coming soon...", + "APPS_DIALER": "Phone", + "APPS_CONTACTS": "Contacts", + "APPS_MESSAGES": "Messages", + "APPS_CALCULATOR": "Calculator", + "APPS_SETTINGS": "Settings", + "APPS_BANK": "WhoDis Banking", + "APPS_BANK_DEPOSIT": "Deposit", + "APPS_BANK_WITHDRAW": "Withdraw", + "APPS_BANK_TRANSFER": "Transfer", + "APPS_SETTINGS_OPTIONS_WALLPAPER": "Wallpaper", + "APPS_SETTINGS_OPTIONS_FRAME": "Frame" + } +} diff --git a/phone/src/os/apps/hooks/useApps.js b/phone/src/os/apps/hooks/useApps.js new file mode 100644 index 0000000..d89d025 --- /dev/null +++ b/phone/src/os/apps/hooks/useApps.js @@ -0,0 +1,71 @@ +import React from "react"; +import { useConfig } from "../../../config/hooks/useConfig"; +import { blue, grey, green, orange, purple } from "@material-ui/core/colors"; +import ContactsIcon from "@material-ui/icons/Contacts"; +import SettingsIcon from "@material-ui/icons/Settings"; +import PhoneIcon from "@material-ui/icons/Phone"; +import AccountBalanceIcon from "@material-ui/icons/AccountBalance"; +import { atom } from "recoil"; +import { CalculatorIcon } from "../../../apps/calculator/components/CalculatorIcon"; + +const appsState = atom({ + key: "apps", + default: { + preinstalled: [ + { + id: "DIALER", + nameLocale: "APPS_DIALER", + icon: , + backgroundColor: green[400], + color: green[50], + path: "/phone", + }, + { + id: "CONTACTS", + nameLocale: "APPS_CONTACTS", + icon: , + backgroundColor: blue[500], + color: blue[50], + path: "/contacts", + }, + { + id: "CALCULATOR", + nameLocale: "APPS_CALCULATOR", + icon: , + backgroundColor: purple[500], + color: grey[50], + path: "/calculator", + }, + { + id: "SETTINGS", + nameLocale: "APPS_SETTINGS", + icon: , + backgroundColor: grey[700], + color: grey[50], + path: "/settings", + }, + { + id: "BANK", + nameLocale: "APPS_BANK", + icon: , + backgroundColor: orange[600], + color: orange[50], + path: "/bank", + }, + ], + }, +}); + +export const useApps = () => { + const [apps, setApps] = useConfig(appsState); + const allApps = [...apps.preinstalled]; + + const getApp = (id) => allApps.find((a) => a.id === id) || null; + + return { apps, allApps, setApps, getApp }; +}; + +export const useApp = (id) => { + const { getApp } = useApps(); + return getApp(id); +}; diff --git a/phone/src/os/nui-events/hooks/useNuiEvent.js b/phone/src/os/nui-events/hooks/useNuiEvent.js index 8dbba74..689e254 100644 --- a/phone/src/os/nui-events/hooks/useNuiEvent.js +++ b/phone/src/os/nui-events/hooks/useNuiEvent.js @@ -6,16 +6,16 @@ export const useNuiEvent = (app, method, handler, options = {}) => { const { capture, passive, once } = options; useEffect(() => { - savedHandler.current = event => { - const { data } = event; - if (handler && handler.call) { - handler(data); - } - }; + savedHandler.current = handler; }, [handler]); useEffect(() => { - const eventListener = (event) => savedHandler.current(event); + const eventListener = (event) => { + const { data } = event; + if (savedHandler.current && savedHandler.current.call) { + savedHandler.current(data); + } + }; const opts = { capture, passive, once }; const eventName = eventNameFactory(app, method); window.addEventListener(eventName, eventListener, opts); diff --git a/phone/src/os/nui-events/hooks/useNuiService.js b/phone/src/os/nui-events/hooks/useNuiService.js index e7fe9a8..a0126bd 100644 --- a/phone/src/os/nui-events/hooks/useNuiService.js +++ b/phone/src/os/nui-events/hooks/useNuiService.js @@ -4,9 +4,8 @@ import { eventNameFactory } from "../utils/nuiUtils"; export const useNuiService = (options = {}) => { const { capture, passive, once } = options; const eventListener = (event) => { - console.log(event); const { app, method, data } = event.data; - if (app && method && data) { + if (app && method && data !== undefined) { window.dispatchEvent( new MessageEvent(eventNameFactory(app, method), { data, diff --git a/phone/src/os/phone/hooks/state.js b/phone/src/os/phone/hooks/state.js new file mode 100644 index 0000000..15c2fbb --- /dev/null +++ b/phone/src/os/phone/hooks/state.js @@ -0,0 +1,12 @@ +import { atom } from "recoil"; + +export const phoneState = { + visibility: atom({ + key: "phoneVisibility", + default: false, + }), + powerOff: atom({ + key: "phonePowerOff", + default: true, + }), +}; diff --git a/phone/src/os/phone/hooks/usePhone.js b/phone/src/os/phone/hooks/usePhone.js new file mode 100644 index 0000000..3a55419 --- /dev/null +++ b/phone/src/os/phone/hooks/usePhone.js @@ -0,0 +1,8 @@ +import { useRecoilValue } from "recoil"; +import { phoneState } from "./state"; + +export const usePhone = () => { + const visibility = useRecoilValue(phoneState.visibility); + const powerOff = useRecoilValue(phoneState.powerOff); + return { visibility, powerOff }; +}; diff --git a/phone/src/os/phone/hooks/usePhoneService.js b/phone/src/os/phone/hooks/usePhoneService.js new file mode 100644 index 0000000..fdf6050 --- /dev/null +++ b/phone/src/os/phone/hooks/usePhoneService.js @@ -0,0 +1,13 @@ +import { useSetRecoilState } from "recoil"; +import { phoneState } from "./state"; +import { useNuiEvent } from "../../nui-events/hooks/useNuiEvent"; +import { usePhone } from "./usePhone"; + +export const usePhoneService = () => { + const setVisibility = useSetRecoilState(phoneState.visibility); + const setPowerOff = useSetRecoilState(phoneState.powerOff); + useNuiEvent("PHONE", "setPowerOff", setPowerOff); + useNuiEvent("PHONE", "setVisibility", setVisibility); + const { visibility, powerOff } = usePhone(); + return { visibility, powerOff }; +}; diff --git a/phone/src/os/simcard/hooks/useSimcardService.js b/phone/src/os/simcard/hooks/useSimcardService.js index a315bd1..309579e 100644 --- a/phone/src/os/simcard/hooks/useSimcardService.js +++ b/phone/src/os/simcard/hooks/useSimcardService.js @@ -1,10 +1,10 @@ import { useNuiEvent } from "../../nui-events/hooks/useNuiEvent"; import { useSetRecoilState } from "recoil"; import { simcardState } from "./state"; +import { useSimcard } from "./useSimcard"; export const useSimcardService = () => { const setNumber = useSetRecoilState(simcardState.number); - useNuiEvent("SIMCARD", "setNumber", (data) => { - setNumber(data); - }); + useNuiEvent("SIMCARD", "setNumber", setNumber); + return useSimcard(); }; diff --git a/phone/src/ui/components/AppTitle.js b/phone/src/ui/components/AppTitle.js index 0e9be2a..cd6a720 100644 --- a/phone/src/ui/components/AppTitle.js +++ b/phone/src/ui/components/AppTitle.js @@ -1,22 +1,32 @@ import React from "react"; import { Typography, Box, makeStyles } from "@material-ui/core"; +import { useTranslation } from "react-i18next"; -const useStyle = makeStyles(theme => ({ - root: ({ color }) => ({ - width: '100%', - textAlign: 'center', - backgroundColor: color || theme.palette.background.default +const useStyle = makeStyles((theme) => ({ + root: ({ backgroundColor }) => ({ + width: "100%", + textAlign: "center", + backgroundColor: backgroundColor || theme.palette.background.default, + }), + text: ({ color }) => ({ + color: color || theme.palette.text.primary, }), - text: { - color: theme.palette.text.primary - } })); -export const AppTitle = ({ children, color, ...props }) => { - const classes = useStyle({ color }); +export const AppTitle = ({ + backgroundColor, + color, + nameLocale, + variant = "h4", + ...props +}) => { + const classes = useStyle({ color, backgroundColor }); + const { t } = useTranslation(); return ( - {children} + + {t(nameLocale)} + ); }; diff --git a/phone/src/ui/components/GridMenu.js b/phone/src/ui/components/GridMenu.js index 5e8549f..8c6b8e2 100644 --- a/phone/src/ui/components/GridMenu.js +++ b/phone/src/ui/components/GridMenu.js @@ -32,9 +32,9 @@ export const GridMenu = ({ items, Component = AppIcon }) => { items.length && items.map((item) => (