mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
styling(misc): Misc. Tweaks and gen styling changes
General Phone: - Removed unecessary border that was causing an issue at 80% zoom - Added tooltips to the app grid - Added 4 new backgrounds Contact App: - Fix styling issue that lead to seeing the background from modal - Fix add new contact button sticky position Notes: - Removed padding from list - Fixed localeName Sellout: - Changed NavBar and Title Color Settings: - Removed modal list padding Note: Let me if you prefer the AppTitle component vs the old Title method also this is just a start to the full app restyles
This commit is contained in:
1 parent
f7165bf9ae
commit
954ef6277c
18 files changed
+290
-265
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 164 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -24,7 +24,6 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
border-top: 2px solid black;
|
|
||||||
border-left: 4px solid black;
|
border-left: 4px solid black;
|
||||||
border-right: 4px solid black;
|
border-right: 4px solid black;
|
||||||
bottom: 100px;
|
bottom: 100px;
|
||||||
|
|||||||
+121
-121
@@ -1,35 +1,35 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import "./Phone.css";
|
import './Phone.css';
|
||||||
import "./i18n";
|
import './i18n';
|
||||||
import { Route } from "react-router-dom";
|
import { Route } from 'react-router-dom';
|
||||||
import { useSettings } from "./apps/settings/hooks/useSettings";
|
import { useSettings } from './apps/settings/hooks/useSettings';
|
||||||
import MessageIcon from "@material-ui/icons/Email";
|
import MessageIcon from '@material-ui/icons/Email';
|
||||||
import { CallModal } from "./modal/components/CallModal";
|
import { CallModal } from './modal/components/CallModal';
|
||||||
import { HomeApp } from "./apps/home/components/Home";
|
import { HomeApp } from './apps/home/components/Home';
|
||||||
import { ThemeProvider } from "@material-ui/core";
|
import { ThemeProvider } from '@material-ui/core';
|
||||||
import { useInitKeyboard } from "./os/keyboard/hooks/useKeyboard";
|
import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard';
|
||||||
import { NotificationIcon } from "./os/notifications/components/NotificationIcon";
|
import { NotificationIcon } from './os/notifications/components/NotificationIcon';
|
||||||
import { NotificationBar } from "./os/notifications/components/NotificationBar";
|
import { NotificationBar } from './os/notifications/components/NotificationBar';
|
||||||
import { Navigation } from "./os/navigation-bar/components/Navigation";
|
import { Navigation } from './os/navigation-bar/components/Navigation';
|
||||||
import { useNuiService } from "./os/nui-events/hooks/useNuiService";
|
import { useNuiService } from './os/nui-events/hooks/useNuiService';
|
||||||
import { useSimcardService } from "./os/simcard/hooks/useSimcardService";
|
import { useSimcardService } from './os/simcard/hooks/useSimcardService';
|
||||||
import { usePhoneService } from "./os/phone/hooks/usePhoneService";
|
import { usePhoneService } from './os/phone/hooks/usePhoneService';
|
||||||
import { useApps } from "./os/apps/hooks/useApps";
|
import { useApps } from './os/apps/hooks/useApps';
|
||||||
|
|
||||||
import { useContactsService } from "./apps/contacts/hooks/useContactsService";
|
import { useContactsService } from './apps/contacts/hooks/useContactsService';
|
||||||
import { useTwitterService } from "./apps/twitter/hooks/useTwitterService";
|
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
|
||||||
import { useSelloutService } from "./apps/sellout/hooks/useSelloutService";
|
import { useSelloutService } from './apps/sellout/hooks/useSelloutService';
|
||||||
import { useBankService } from './apps/bank/hooks/useBankService';
|
import { useBankService } from './apps/bank/hooks/useBankService';
|
||||||
import { useNotesService } from "./apps/notes/hooks/useNotesService";
|
import { useNotesService } from './apps/notes/hooks/useNotesService';
|
||||||
|
|
||||||
//These events are just for testing. Comment it out before building.
|
//These events are just for testing. Comment it out before building.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: "SIMCARD",
|
app: 'SIMCARD',
|
||||||
method: "setNumber",
|
method: 'setNumber',
|
||||||
data: "111-1134",
|
data: '111-1134',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -37,10 +37,10 @@ setTimeout(() => {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: "PHONE",
|
app: 'PHONE',
|
||||||
method: "setVisibility",
|
method: 'setVisibility',
|
||||||
data: true,
|
data: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -49,7 +49,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: 'NOTES',
|
app: 'NOTES',
|
||||||
method: 'setNotes',
|
method: 'setNotes',
|
||||||
@@ -57,56 +57,55 @@ setTimeout(() => {
|
|||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
title: 'First note',
|
title: 'First note',
|
||||||
content: 'Hello, this is my shitty note'
|
content: 'Hello, this is my shitty note',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
title: 'Second note',
|
title: 'Second note',
|
||||||
content: 'Hello, this is another shitty note'
|
content: 'Hello, this is another shitty note',
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
)
|
);
|
||||||
}, 1000)
|
}, 1000);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
new MessageEvent("messsage", {
|
new MessageEvent('messsage', {
|
||||||
data: {
|
data: {
|
||||||
app: "BANK",
|
app: 'BANK',
|
||||||
method: "setNotification",
|
method: 'setNotification',
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
message: "ahhaha"
|
message: 'ahhaha',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}, 1000)
|
}, 1000);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
new MessageEvent("messsage", {
|
new MessageEvent('messsage', {
|
||||||
data: {
|
data: {
|
||||||
app: "TWITTER",
|
app: 'TWITTER',
|
||||||
method: "setNotification",
|
method: 'setNotification',
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
message: "ahhaha"
|
message: 'ahhaha',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}, 1000)
|
}, 1000);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: "BANK",
|
app: 'BANK',
|
||||||
method: "setCredentials",
|
method: 'setCredentials',
|
||||||
data:
|
data: {
|
||||||
{
|
name: 'Firstname Lastname',
|
||||||
name: "Firstname Lastname",
|
balance: 2000,
|
||||||
balance: 2000
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -114,7 +113,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setTransaction',
|
method: 'setTransaction',
|
||||||
@@ -123,67 +122,37 @@ setTimeout(() => {
|
|||||||
id: 1,
|
id: 1,
|
||||||
amount: 200,
|
amount: 200,
|
||||||
type: 'Deposit',
|
type: 'Deposit',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
amount: 200,
|
amount: 200,
|
||||||
type: 'Withdraw',
|
type: 'Withdraw',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
amount: 200,
|
amount: 200,
|
||||||
type: 'Withdraw',
|
type: 'Withdraw',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
amount: 50,
|
amount: 50,
|
||||||
type: 'Deposit',
|
type: 'Deposit',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
amount: 50,
|
amount: 50,
|
||||||
type: 'Deposit',
|
type: 'Deposit',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
amount: 50,
|
amount: 50,
|
||||||
type: 'Deposit',
|
type: 'Deposit',
|
||||||
source: "chip"
|
source: 'chip',
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
window.dispatchEvent(
|
|
||||||
new MessageEvent("message", {
|
|
||||||
data: {
|
|
||||||
app: "CONTACTS",
|
|
||||||
method: "setContacts",
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
number: "345-4366",
|
|
||||||
display: "chip",
|
|
||||||
avatar: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
number: "456-4366",
|
|
||||||
display: "shit",
|
|
||||||
avatar: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
number: "123-4366",
|
|
||||||
display: "rocky",
|
|
||||||
avatar: 'https://i.imgur.com/B8ta5Aa.jpeg'
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -193,27 +162,58 @@ setTimeout(() => {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent('message', {
|
||||||
data: {
|
data: {
|
||||||
app: "SELLOUT",
|
app: 'CONTACTS',
|
||||||
method: "setListings",
|
method: 'setContacts',
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "Some guy",
|
number: '345-4366',
|
||||||
number: "123-4567",
|
display: 'chip',
|
||||||
title: "Car",
|
avatar:
|
||||||
description:
|
'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif',
|
||||||
"Selling this cool car",
|
|
||||||
url: "https://i.imgur.com/ROmGTwi.jpeg",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "Some other dude",
|
number: '456-4366',
|
||||||
number: "666-6666",
|
display: 'shit',
|
||||||
title: "Material",
|
avatar: '',
|
||||||
description: "Selling my wife",
|
},
|
||||||
url: "",
|
{
|
||||||
|
id: 3,
|
||||||
|
number: '123-4366',
|
||||||
|
display: 'rocky',
|
||||||
|
avatar: 'https://i.imgur.com/B8ta5Aa.jpeg',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
window.dispatchEvent(
|
||||||
|
new MessageEvent('message', {
|
||||||
|
data: {
|
||||||
|
app: 'SELLOUT',
|
||||||
|
method: 'setListings',
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'Some guy',
|
||||||
|
number: '123-4567',
|
||||||
|
title: 'Car',
|
||||||
|
description: 'Selling this cool car',
|
||||||
|
url: 'https://i.imgur.com/ROmGTwi.jpeg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: 'Some other dude',
|
||||||
|
number: '666-6666',
|
||||||
|
title: 'Material',
|
||||||
|
description: 'Selling my wife',
|
||||||
|
url: '',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -242,18 +242,18 @@ function Phone() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={currentTheme()}>
|
<ThemeProvider theme={currentTheme()}>
|
||||||
<div className="PhoneWrapper">
|
<div className='PhoneWrapper'>
|
||||||
<div style={{ zoom: "80%" }}>
|
<div style={{ zoom: '100%' }}>
|
||||||
<div className="Phone">
|
<div className='Phone'>
|
||||||
<div
|
<div
|
||||||
className="PhoneFrame"
|
className='PhoneFrame'
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(./media/frames/${settings.frame})`,
|
backgroundImage: `url(./media/frames/${settings.frame})`,
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
id="phone"
|
id='phone'
|
||||||
className="PhoneScreen"
|
className='PhoneScreen'
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(./media/backgrounds/${settings.wallpaper})`,
|
backgroundImage: `url(./media/backgrounds/${settings.wallpaper})`,
|
||||||
}}
|
}}
|
||||||
@@ -262,17 +262,17 @@ function Phone() {
|
|||||||
<NotificationBar
|
<NotificationBar
|
||||||
notifications={[
|
notifications={[
|
||||||
{
|
{
|
||||||
key: "newMessage",
|
key: 'newMessage',
|
||||||
icon: <NotificationIcon Icon={MessageIcon} />,
|
icon: <NotificationIcon Icon={MessageIcon} />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<div className="PhoneAppContainer">
|
<div className='PhoneAppContainer'>
|
||||||
{calling ? (
|
{calling ? (
|
||||||
<CallModal />
|
<CallModal />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Route exact path="/" component={HomeApp} />
|
<Route exact path='/' component={HomeApp} />
|
||||||
|
|
||||||
{allApps.map((App) => (
|
{allApps.map((App) => (
|
||||||
<App.Route key={App.id} />
|
<App.Route key={App.id} />
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { AppWrapper } from "../../../ui/components";
|
import { AppWrapper } from '../../../ui/components';
|
||||||
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
|
||||||
import { AppTitle } from "../../../ui/components/AppTitle";
|
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||||
import { AppContent } from "../../../ui/components/AppContent";
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
import { ContactList } from "./List/ContactList";
|
import { ContactList } from './List/ContactList';
|
||||||
import { useApp } from "../../../os/apps/hooks/useApps";
|
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||||
import { AddContactModal } from "./ContactModal";
|
import { AddContactModal } from './ContactModal';
|
||||||
import { useModal } from "../hooks/useModal";
|
import { useModal } from '../hooks/useModal';
|
||||||
import { SearchContacts } from "./List/SearchContacts";
|
import { SearchContacts } from './List/SearchContacts';
|
||||||
import PersonAddIcon from "@material-ui/icons/PersonAdd";
|
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||||
import Fab from "@material-ui/core/Fab";
|
import Fab from '@material-ui/core/Fab';
|
||||||
import { useContactModal } from "../hooks/useContactModal";
|
import { useContactModal } from '../hooks/useContactModal';
|
||||||
import { InfoModal } from "./modal/InfoModal";
|
import { InfoModal } from './modal/InfoModal';
|
||||||
import { useContactDetail } from "../hooks/useContactDetail";
|
import { useContactDetail } from '../hooks/useContactDetail';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
backgroundModal: {
|
backgroundModal: {
|
||||||
background: "black",
|
background: 'black',
|
||||||
opacity: "0.6",
|
opacity: '0.6',
|
||||||
position: "absolute",
|
position: 'absolute',
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
@@ -27,9 +27,9 @@ const useStyles = makeStyles((theme: Theme) =>
|
|||||||
zIndex: 5,
|
zIndex: 5,
|
||||||
},
|
},
|
||||||
absolute: {
|
absolute: {
|
||||||
position: "sticky",
|
position: 'absolute',
|
||||||
bottom: theme.spacing(2),
|
bottom: theme.spacing(2),
|
||||||
left: theme.spacing(3),
|
right: theme.spacing(3),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -37,7 +37,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
|||||||
export const ContactsApp = () => {
|
export const ContactsApp = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { showModal, setShowModal } = useModal();
|
const { showModal, setShowModal } = useModal();
|
||||||
const contacts = useApp("CONTACTS");
|
const contacts = useApp('CONTACTS');
|
||||||
const { contactDetail } = useContactDetail();
|
const { contactDetail } = useContactDetail();
|
||||||
|
|
||||||
const openModal = () => {
|
const openModal = () => {
|
||||||
@@ -45,7 +45,7 @@ export const ContactsApp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppWrapper id="contact-app">
|
<AppWrapper id='contact-app'>
|
||||||
<AppTitle app={contacts}></AppTitle>
|
<AppTitle app={contacts}></AppTitle>
|
||||||
<SearchContacts />
|
<SearchContacts />
|
||||||
<AddContactModal />
|
<AddContactModal />
|
||||||
@@ -55,7 +55,7 @@ export const ContactsApp = () => {
|
|||||||
<ContactList />
|
<ContactList />
|
||||||
<Fab
|
<Fab
|
||||||
onClick={openModal}
|
onClick={openModal}
|
||||||
style={{ backgroundColor: "#2196f3", color: "#fff" }}
|
style={{ backgroundColor: '#2196f3', color: '#fff' }}
|
||||||
className={classes.absolute}
|
className={classes.absolute}
|
||||||
>
|
>
|
||||||
<PersonAddIcon />
|
<PersonAddIcon />
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Paper,
|
Paper,
|
||||||
Slide,
|
Slide,
|
||||||
Button,
|
Button,
|
||||||
TextField,
|
TextField,
|
||||||
Avatar as MuiAvatar,
|
Avatar as MuiAvatar,
|
||||||
} from "@material-ui/core";
|
} from '@material-ui/core';
|
||||||
import useStyles from "./modal.styles";
|
import useStyles from './modal.styles';
|
||||||
import { useContactModal } from "../../hooks/useContactModal";
|
import { useContactModal } from '../../hooks/useContactModal';
|
||||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useContactDetail } from "../../hooks/useContactDetail";
|
import { useContactDetail } from '../../hooks/useContactDetail';
|
||||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
export const InfoModal = () => {
|
export const InfoModal = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
@@ -21,14 +21,14 @@ export const InfoModal = () => {
|
|||||||
const { contactDetail, setContactDetail } = useContactDetail();
|
const { contactDetail, setContactDetail } = useContactDetail();
|
||||||
|
|
||||||
const [display, setDisplay] = useState(
|
const [display, setDisplay] = useState(
|
||||||
contactDetail ? contactDetail.display : ""
|
contactDetail ? contactDetail.display : ''
|
||||||
);
|
);
|
||||||
console.log(contactDetail);
|
console.log(contactDetail);
|
||||||
const [number, setNumber] = useState(
|
const [number, setNumber] = useState(
|
||||||
contactDetail ? contactDetail.number : ""
|
contactDetail ? contactDetail.number : ''
|
||||||
);
|
);
|
||||||
const [avatar, setAvatar] = useState(
|
const [avatar, setAvatar] = useState(
|
||||||
contactDetail ? contactDetail.avatar : ""
|
contactDetail ? contactDetail.avatar : ''
|
||||||
);
|
);
|
||||||
|
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
@@ -37,7 +37,7 @@ export const InfoModal = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const updateContact = () => {
|
const updateContact = () => {
|
||||||
Nui.send("phone:updateContact", {
|
Nui.send('phone:updateContact', {
|
||||||
id: contactDetail.id,
|
id: contactDetail.id,
|
||||||
display,
|
display,
|
||||||
number,
|
number,
|
||||||
@@ -48,7 +48,7 @@ export const InfoModal = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deleteContact = () => {
|
const deleteContact = () => {
|
||||||
Nui.send("phone:deleteContact", {
|
Nui.send('phone:deleteContact', {
|
||||||
id: contactDetail.id,
|
id: contactDetail.id,
|
||||||
});
|
});
|
||||||
setContactDetail(null);
|
setContactDetail(null);
|
||||||
@@ -56,9 +56,10 @@ export const InfoModal = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Slide direction="up" in={showContactModal}>
|
<Slide direction='up' in={showContactModal}>
|
||||||
<Paper
|
<Paper
|
||||||
className={showContactModal ? classes.modalRoot : classes.modalHide}
|
className={showContactModal ? classes.modalRoot : classes.modalHide}
|
||||||
|
square
|
||||||
>
|
>
|
||||||
<Button style={{ margin: 10 }} onClick={closeModal}>
|
<Button style={{ margin: 10 }} onClick={closeModal}>
|
||||||
<ArrowBackIcon />
|
<ArrowBackIcon />
|
||||||
@@ -69,7 +70,7 @@ export const InfoModal = () => {
|
|||||||
className={classes.input}
|
className={classes.input}
|
||||||
value={display}
|
value={display}
|
||||||
onChange={(e) => setDisplay(e.target.value)}
|
onChange={(e) => setDisplay(e.target.value)}
|
||||||
placeholder={t("APPS_CONTACT_FORM_NAME")}
|
placeholder={t('APPS_CONTACT_FORM_NAME')}
|
||||||
fullWidth
|
fullWidth
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputProps,
|
className: classes.inputProps,
|
||||||
@@ -79,7 +80,7 @@ export const InfoModal = () => {
|
|||||||
className={classes.input}
|
className={classes.input}
|
||||||
value={number}
|
value={number}
|
||||||
onChange={(e) => setNumber(e.target.value)}
|
onChange={(e) => setNumber(e.target.value)}
|
||||||
placeholder={t("APPS_CONTACT_FORM_NUMBER")}
|
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
|
||||||
fullWidth
|
fullWidth
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputProps,
|
className: classes.inputProps,
|
||||||
@@ -87,7 +88,7 @@ export const InfoModal = () => {
|
|||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder={t("APPS_CONTACT_FORM_AVATAR")}
|
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
|
||||||
fullWidth
|
fullWidth
|
||||||
value={avatar}
|
value={avatar}
|
||||||
onChange={(e) => setAvatar(e.target.value)}
|
onChange={(e) => setAvatar(e.target.value)}
|
||||||
@@ -96,7 +97,7 @@ export const InfoModal = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div style={{ display: "block" }}>
|
<div style={{ display: 'block' }}>
|
||||||
<Button onClick={updateContact} className={classes.updateButton}>
|
<Button onClick={updateContact} className={classes.updateButton}>
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { AppWrapper } from "../../ui/components/AppWrapper";
|
import { AppWrapper } from '../../ui/components/AppWrapper';
|
||||||
import { AppContent } from "../../ui/components/AppContent";
|
import { AppContent } from '../../ui/components/AppContent';
|
||||||
import NotesTitle from "./NotesTitle";
|
import { AppTitle } from '../../ui/components/AppTitle';
|
||||||
import NoteList from "./list/NoteList";
|
import { useApp } from '../../os/apps/hooks/useApps';
|
||||||
|
import NoteList from './list/NoteList';
|
||||||
|
|
||||||
import { useNotes } from "./hooks/useNotes";
|
import { useNotes } from './hooks/useNotes';
|
||||||
import { NoteModal } from "./modal/NoteModal";
|
import { NoteModal } from './modal/NoteModal';
|
||||||
import { Fab } from "@material-ui/core";
|
import { Fab } from '@material-ui/core';
|
||||||
import AddIcon from "@material-ui/icons/Add";
|
import AddIcon from '@material-ui/icons/Add';
|
||||||
|
|
||||||
import { useNoteModal } from "./hooks/useNoteModal";
|
import { useNoteModal } from './hooks/useNoteModal';
|
||||||
import { useNoteDetail } from "./hooks/useNoteDetail";
|
import { useNoteDetail } from './hooks/useNoteDetail';
|
||||||
|
|
||||||
import useStyles from "./notes.styles";
|
import useStyles from './notes.styles';
|
||||||
|
|
||||||
export const NotesApp = () => {
|
export const NotesApp = () => {
|
||||||
const { setNoteModal } = useNoteModal();
|
const { setNoteModal } = useNoteModal();
|
||||||
const { detail, setDetail } = useNoteDetail();
|
const { detail, setDetail } = useNoteDetail();
|
||||||
const notes = useNotes();
|
const notes = useNotes();
|
||||||
|
const notesApp = useApp('NOTES');
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
@@ -27,8 +29,8 @@ export const NotesApp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppWrapper id="notes-app">
|
<AppWrapper id='notes-app'>
|
||||||
<NotesTitle />
|
<AppTitle app={notesApp} />
|
||||||
<NoteModal key={detail?.id} />
|
<NoteModal key={detail?.id} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<NoteList notes={notes} />
|
<NoteList notes={notes} />
|
||||||
@@ -36,8 +38,8 @@ export const NotesApp = () => {
|
|||||||
className={classes.absolute}
|
className={classes.absolute}
|
||||||
onClick={handleModal}
|
onClick={handleModal}
|
||||||
style={{
|
style={{
|
||||||
background: "#f9a825",
|
background: '#f9a825',
|
||||||
color: "#fff",
|
color: '#fff',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
|
|||||||
@@ -1,28 +1,34 @@
|
|||||||
import { List, ListItem, ListItemText } from '@material-ui/core';
|
import { List, ListItem, ListItemText } from '@material-ui/core';
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
import { useNoteModal } from '../hooks/useNoteModal';
|
import { useNoteModal } from '../hooks/useNoteModal';
|
||||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||||
|
|
||||||
// add search bar later
|
// add search bar later
|
||||||
const NoteList = ({notes}) => {
|
// TODO: Add interface for note
|
||||||
|
const NoteList = ({ notes }) => {
|
||||||
const { setNoteModal } = useNoteModal();
|
const { setNoteModal } = useNoteModal();
|
||||||
const { setDetail } = useNoteDetail();
|
const { setDetail } = useNoteDetail();
|
||||||
|
|
||||||
const handleNoteModal = (note) => {
|
const handleNoteModal = (note) => {
|
||||||
setNoteModal(true)
|
setNoteModal(true);
|
||||||
setDetail(note)
|
setDetail(note);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<List>
|
<List disablePadding>
|
||||||
{notes.map((note) => (
|
{notes.map((note) => (
|
||||||
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
<ListItem
|
||||||
<ListItemText><strong>{note.title}</strong></ListItemText>
|
key={note.id}
|
||||||
|
button
|
||||||
|
divider
|
||||||
|
onClick={() => handleNoteModal(note)}
|
||||||
|
>
|
||||||
|
<ListItemText>{note.title}</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default NoteList;
|
export default NoteList;
|
||||||
@@ -1,25 +1,22 @@
|
|||||||
import {
|
import { Button, TextField, Slide } from '@material-ui/core';
|
||||||
Button,
|
import React, { useState } from 'react';
|
||||||
TextField,
|
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||||
Slide,
|
|
||||||
} from "@material-ui/core";
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
|
||||||
|
|
||||||
import { useNoteModal } from "../hooks/useNoteModal";
|
import { useNoteModal } from '../hooks/useNoteModal';
|
||||||
import { useNoteDetail } from "../hooks/useNoteDetail";
|
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||||
|
|
||||||
import useStyles from "./modal.styles";
|
import useStyles from './modal.styles';
|
||||||
|
|
||||||
import "../NotesApp.css";
|
import '../NotesApp.css';
|
||||||
import Nui from "../../../os/nui-events/utils/Nui";
|
import Nui from '../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
|
// TODO: Fix input focus color
|
||||||
export const NoteModal = () => {
|
export const NoteModal = () => {
|
||||||
const { noteModal, setNoteModal } = useNoteModal();
|
const { noteModal, setNoteModal } = useNoteModal();
|
||||||
const { detail, setDetail } = useNoteDetail();
|
const { detail, setDetail } = useNoteDetail();
|
||||||
console.log(detail);
|
console.log(detail);
|
||||||
const [title, setTitle] = useState(detail ? detail.title : "");
|
const [title, setTitle] = useState(detail ? detail.title : '');
|
||||||
const [content, setContent] = useState(detail ? detail.content : "");
|
const [content, setContent] = useState(detail ? detail.content : '');
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
@@ -31,7 +28,7 @@ export const NoteModal = () => {
|
|||||||
const handleNoteSave = () => {
|
const handleNoteSave = () => {
|
||||||
setNoteModal(false);
|
setNoteModal(false);
|
||||||
setDetail(null);
|
setDetail(null);
|
||||||
Nui.send("phone:addNote", {
|
Nui.send('phone:addNote', {
|
||||||
title,
|
title,
|
||||||
content,
|
content,
|
||||||
});
|
});
|
||||||
@@ -40,14 +37,14 @@ export const NoteModal = () => {
|
|||||||
const handleDeleteNote = () => {
|
const handleDeleteNote = () => {
|
||||||
const id = detail.id;
|
const id = detail.id;
|
||||||
setNoteModal(false);
|
setNoteModal(false);
|
||||||
Nui.send("phone:deleteNote", {
|
Nui.send('phone:deleteNote', {
|
||||||
id,
|
id,
|
||||||
});
|
});
|
||||||
setDetail(null);
|
setDetail(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUpdateNote = () => {
|
const handleUpdateNote = () => {
|
||||||
Nui.send("phone:updateNote", {
|
Nui.send('phone:updateNote', {
|
||||||
id: detail.id,
|
id: detail.id,
|
||||||
title,
|
title,
|
||||||
content,
|
content,
|
||||||
@@ -58,15 +55,15 @@ export const NoteModal = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={noteModal ? classes.modalRoot : classes.modalHide}>
|
<div className={noteModal ? classes.modalRoot : classes.modalHide}>
|
||||||
<Slide direction="left" in={noteModal} mountOnEnter unmountOnExit>
|
<Slide direction='left' in={noteModal} mountOnEnter unmountOnExit>
|
||||||
<div>
|
<div>
|
||||||
<Button className={classes.closeButton} onClick={_handleClose}>
|
<Button className={classes.closeButton} onClick={_handleClose}>
|
||||||
<ArrowBackIcon />
|
<ArrowBackIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<div id="notes-modal" className={classes.noteContainer}>
|
<div id='notes-modal' className={classes.noteContainer}>
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Title"
|
placeholder='Title'
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputPropsTitle,
|
className: classes.inputPropsTitle,
|
||||||
}}
|
}}
|
||||||
@@ -79,11 +76,11 @@ export const NoteModal = () => {
|
|||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputPropsContent,
|
className: classes.inputPropsContent,
|
||||||
}}
|
}}
|
||||||
placeholder="Content"
|
placeholder='Content'
|
||||||
multiline
|
multiline
|
||||||
fullWidth
|
fullWidth
|
||||||
rows={19}
|
rows={19}
|
||||||
variant="outlined"
|
variant='outlined'
|
||||||
value={content}
|
value={content}
|
||||||
onChange={(e) => setContent(e.target.value)}
|
onChange={(e) => setContent(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import Paper from "@material-ui/core/Paper";
|
import Paper from '@material-ui/core/Paper';
|
||||||
import { makeStyles } from "@material-ui/core";
|
import { makeStyles } from '@material-ui/core';
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faAd } from "@fortawesome/free-solid-svg-icons";
|
import { faAd } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
height: "60px",
|
height: '60px',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexFlow: "row nowrap",
|
flexFlow: 'row nowrap',
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
background: "#424242",
|
background: '#262525',
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
color: "#f44336",
|
color: '#f44336',
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@@ -23,7 +23,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const SelloutTitle = () => {
|
export const SelloutTitle = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||||
<FontAwesomeIcon icon={faAd} className={classes.icon} />
|
<FontAwesomeIcon icon={faAd} className={classes.icon} />
|
||||||
</Paper>
|
</Paper>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from 'react';
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from 'react-router-dom';
|
||||||
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core";
|
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faHome } from "@fortawesome/free-solid-svg-icons";
|
import { faHome } from '@fortawesome/free-solid-svg-icons';
|
||||||
import AddCircleIcon from "@material-ui/icons/AddCircle";
|
import AddCircleIcon from '@material-ui/icons/AddCircle';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
|
backgroundColor: '#262525',
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
color: "#f44336",
|
color: '#f44336',
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -30,12 +31,12 @@ export const NavigationBar = () => {
|
|||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<FontAwesomeIcon icon={faHome} />}
|
icon={<FontAwesomeIcon icon={faHome} />}
|
||||||
to="/sellout"
|
to='/sellout'
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<AddCircleIcon />}
|
icon={<AddCircleIcon />}
|
||||||
to="/sellout/new"
|
to='/sellout/new'
|
||||||
/>
|
/>
|
||||||
</BottomNavigation>
|
</BottomNavigation>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
{
|
{
|
||||||
"cellProvider": "AT&T",
|
"cellProvider": "AT&T",
|
||||||
"language": "en_US",
|
"language": "en_US",
|
||||||
"wallpapers": ["default.png", "dragon.jpg", "legacy.jpg"],
|
"wallpapers": [
|
||||||
"frames": ["default.png", "s10.png"],
|
"default.png",
|
||||||
|
"dragon.jpg",
|
||||||
|
"legacy.jpg",
|
||||||
|
"minimal.jpg",
|
||||||
|
"waves.jpg",
|
||||||
|
"surf.jpg",
|
||||||
|
"beach.jpg"
|
||||||
|
],
|
||||||
|
"frames": ["default.png", "s10.png", "tw.png", "samsung.png"],
|
||||||
"themes": {
|
"themes": {
|
||||||
"default-dark": {
|
"default-dark": {
|
||||||
"palette": {
|
"palette": {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"APPS_CALCULATOR": "Calculator",
|
"APPS_CALCULATOR": "Calculator",
|
||||||
"APPS_SETTINGS": "Settings",
|
"APPS_SETTINGS": "Settings",
|
||||||
"APPS_BANK": "WhoDis Banking",
|
"APPS_BANK": "WhoDis Banking",
|
||||||
|
"APPS_NOTES": "Notes",
|
||||||
"APPS_EXAMPLE": "Example app",
|
"APPS_EXAMPLE": "Example app",
|
||||||
"APPS_BANK_TRANSFER": "Transfer",
|
"APPS_BANK_TRANSFER": "Transfer",
|
||||||
"APPS_SETTINGS_OPTIONS_WALLPAPER": "Wallpaper",
|
"APPS_SETTINGS_OPTIONS_WALLPAPER": "Wallpaper",
|
||||||
@@ -52,6 +53,5 @@
|
|||||||
"APPS_CONTACT_FORM_NAME": "Name",
|
"APPS_CONTACT_FORM_NAME": "Name",
|
||||||
"APPS_CONTACT_FORM_NUMBER": "Number",
|
"APPS_CONTACT_FORM_NUMBER": "Number",
|
||||||
"APPS_CONTACT_FORM_AVATAR": "Avatar URL"
|
"APPS_CONTACT_FORM_AVATAR": "Avatar URL"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ const appsState = atom({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'NOTES',
|
id: 'NOTES',
|
||||||
name: 'APPS_NOTES',
|
nameLocale: 'APPS_NOTES',
|
||||||
icon: <FontAwesomeIcon icon={faStickyNote} fixedWidth />,
|
icon: <FontAwesomeIcon icon={faStickyNote} fixedWidth />,
|
||||||
backgroundColor: yellow[800],
|
backgroundColor: yellow[800],
|
||||||
color: common.white,
|
color: common.white,
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
ListItemIcon,
|
ListItemIcon,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
Slide,
|
Slide,
|
||||||
makeStyles,
|
makeStyles,
|
||||||
Paper,
|
Paper,
|
||||||
} from "@material-ui/core";
|
} from '@material-ui/core';
|
||||||
import { List } from "./List";
|
import { List } from './List';
|
||||||
import { ListItem } from "./ListItem";
|
import { ListItem } from './ListItem';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
position: "absolute",
|
position: 'absolute',
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
},
|
},
|
||||||
@@ -21,9 +21,9 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const ContextMenu = ({ open, onClose, options }) => {
|
export const ContextMenu = ({ open, onClose, options }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
|
<Slide direction='up' in={open} mountOnEnter unmountOnExit>
|
||||||
<Paper square className={classes.root}>
|
<Paper square className={classes.root}>
|
||||||
<List>
|
<List disablePadding>
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<ListItem
|
<ListItem
|
||||||
selected={option.selected}
|
selected={option.selected}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from 'react';
|
||||||
import { AppIcon } from "./AppIcon";
|
import { AppIcon } from './AppIcon';
|
||||||
import { Grid, makeStyles } from "@material-ui/core";
|
import { Grid, makeStyles, Tooltip } 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';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -10,7 +10,11 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
marginTop: theme.spacing(3),
|
marginTop: theme.spacing(3),
|
||||||
width: "20%",
|
width: '20%',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
bottom: -8,
|
||||||
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -19,27 +23,34 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
useEffect(function registerKeyHandlers() {
|
useEffect(function registerKeyHandlers() {
|
||||||
setKey("ArrowLeft", () => {
|
setKey('ArrowLeft', () => {
|
||||||
console.log(":v");
|
console.log(':v');
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid container justify="center">
|
<Grid container justify='center'>
|
||||||
<Grid container item>
|
<Grid container item>
|
||||||
{items &&
|
{items &&
|
||||||
items.length &&
|
items.length &&
|
||||||
items.map((item) => (
|
items.map((item) => (
|
||||||
<Grid
|
<Tooltip
|
||||||
key={item.id}
|
title={item.id}
|
||||||
item
|
placement='top'
|
||||||
className={classes.item}
|
arrow
|
||||||
component={Link}
|
classes={{ tooltip: classes.tooltip }}
|
||||||
to={item.path}
|
|
||||||
>
|
>
|
||||||
<Component {...item} />
|
<Grid
|
||||||
</Grid>
|
key={item.id}
|
||||||
|
item
|
||||||
|
className={classes.item}
|
||||||
|
component={Link}
|
||||||
|
to={item.path}
|
||||||
|
>
|
||||||
|
<Component {...item} />
|
||||||
|
</Grid>
|
||||||
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in new issue
Block a user