diff --git a/phone/public/media/backgrounds/default.jpg b/phone/public/media/backgrounds/default.jpg new file mode 100644 index 0000000..52add86 Binary files /dev/null and b/phone/public/media/backgrounds/default.jpg differ diff --git a/phone/src/config/default.json b/phone/src/config/default.json index 964ea7f..d912043 100644 --- a/phone/src/config/default.json +++ b/phone/src/config/default.json @@ -17,6 +17,10 @@ { "label": "Project Error", "value": "projecterror.jpg" + }, + { + "label": "Default", + "value": "default.jpg" } ], "frames": [ @@ -141,8 +145,8 @@ "value": "en" }, "wallpaper": { - "label": "Project Error", - "value": "projecterror.jpg" + "label": "Default", + "value": "default.jpg" }, "customWallpaper": "", "frame": { diff --git a/phone/src/config/themes.json b/phone/src/config/themes.json index e6d6a2d..7c7311d 100644 --- a/phone/src/config/themes.json +++ b/phone/src/config/themes.json @@ -47,6 +47,13 @@ "background": { "default": "#033A18", "paper": "#011308" + }, + "text": { + "primary": "#fff", + "secondary": "rgba(255, 255, 255, 0.7)", + "disabled": "rgba(255, 255, 255, 0.5)", + "hint": "rgba(255, 255, 255, 0.5)", + "icon": "rgba(255, 255, 255, 0.5)" } } } diff --git a/phone/src/os/apps/config/apps.tsx b/phone/src/os/apps/config/apps.tsx index 330f630..58e0646 100644 --- a/phone/src/os/apps/config/apps.tsx +++ b/phone/src/os/apps/config/apps.tsx @@ -1,26 +1,9 @@ import React from 'react'; import { blue, common, grey, purple } from '@material-ui/core/colors'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { - faAd, - faPlaneArrival, - faPhoneAlt, - faWonSign, - faStickyNote, -} from '@fortawesome/free-solid-svg-icons'; -import { faTwitter } from '@fortawesome/free-brands-svg-icons'; - -import ContactsIcon from '@material-ui/icons/Contacts'; -import SettingsIcon from '@material-ui/icons/Settings'; -import MessageIcon from '@material-ui/icons/Message'; -import FireIcon from '@material-ui/icons/Whatshot'; -import { CalculatorIcon } from '../../../apps/calculator/components/CalculatorIcon'; -import CameraAltIcon from '@material-ui/icons/CameraAlt'; import { DialerApp } from '../../../apps/dialer/components/DialerApp'; import { ContactsApp } from '../../../apps/contacts/components/ContactsApp'; import { CalculatorApp } from '../../../apps/calculator/components/CalculatorApp'; import { SettingsApp } from '../../../apps/settings/components/SettingsApp'; -import { BankApp } from '../../../apps/bank/components/BankApp'; import { MessagesApp } from '../../../apps/messages/components/MessagesApp'; import { MatchApp } from '../../../apps/match/components/MatchApp'; import { TwitterApp } from '../../../apps/twitter/components/TwitterApp'; @@ -49,24 +32,30 @@ import { TWITTER_APP_TEXT_COLOR, } from '../../../apps/twitter/twitter.theme'; import { MATCH_APP_PRIMARY_COLOR, MATCH_APP_TEXT_COLOR } from '../../../apps/match/match.theme'; +import { SvgIconProps } from '@material-ui/core'; +import { INotificationIcon } from '../../notifications/providers/NotificationsProvider'; export interface IAppConfig { id: string; nameLocale: string; - icon: JSX.Element; - notificationIcon: JSX.Element; backgroundColor: string; color: string; path: string; Route: React.FC; } +export type IApp = IAppConfig & { + notification: INotificationIcon; + icon: JSX.Element; + notificationIcon: JSX.Element; + NotificationIcon: React.FC; + Icon: React.FC; +}; + export const APPS: IAppConfig[] = [ { id: 'DIALER', nameLocale: 'APPS_DIALER', - icon: , - notificationIcon: , backgroundColor: DIALER_APP_PRIMARY_COLOR, color: DIALER_APP_TEXT_COLOR, path: '/phone', @@ -75,8 +64,6 @@ export const APPS: IAppConfig[] = [ { id: 'MESSAGES', nameLocale: 'APPS_MESSAGES', - icon: , - notificationIcon: , backgroundColor: MESSAGES_APP_PRIMARY_COLOR, color: MESSAGES_APP_TEXT_COLOR, path: '/messages', @@ -85,8 +72,6 @@ export const APPS: IAppConfig[] = [ { id: 'CONTACTS', nameLocale: 'APPS_CONTACTS', - icon: , - notificationIcon: , backgroundColor: CONTACTS_APP_PRIMARY_COLOR, color: CONTACTS_APP_TEXT_COLOR, path: '/contacts', @@ -95,8 +80,6 @@ export const APPS: IAppConfig[] = [ { id: 'CALCULATOR', nameLocale: 'APPS_CALCULATOR', - icon: , - notificationIcon: , backgroundColor: purple[500], color: grey[50], path: '/calculator', @@ -105,8 +88,6 @@ export const APPS: IAppConfig[] = [ { id: 'SETTINGS', nameLocale: 'APPS_SETTINGS', - icon: , - notificationIcon: , backgroundColor: '#383838', color: grey[50], path: '/settings', @@ -116,8 +97,6 @@ export const APPS: IAppConfig[] = [ /*{ id: 'BANK', nameLocale: 'APPS_BANK', - icon: , - notificationIcon: , backgroundColor: blue[900], color: common.white, path: '/bank', @@ -126,8 +105,6 @@ export const APPS: IAppConfig[] = [ { id: 'MATCH', nameLocale: 'APPS_MATCH', - icon: , - notificationIcon: , backgroundColor: MATCH_APP_PRIMARY_COLOR, color: MATCH_APP_TEXT_COLOR, path: '/match', @@ -136,8 +113,6 @@ export const APPS: IAppConfig[] = [ { id: 'TWITTER', nameLocale: 'APPS_TWITTER', - icon: , - notificationIcon: , backgroundColor: TWITTER_APP_PRIMARY_COLOR, color: TWITTER_APP_TEXT_COLOR, path: '/twitter', @@ -146,8 +121,6 @@ export const APPS: IAppConfig[] = [ { id: 'SELLOUT', nameLocale: 'APPS_SELLOUT', - icon: , - notificationIcon: , backgroundColor: SELLOUT_APP_PRIMARY_COLOR, color: SELLOUT_APP_ICON_COLOR, path: '/marketplace', @@ -156,8 +129,6 @@ export const APPS: IAppConfig[] = [ { id: 'NOTES', nameLocale: 'APPS_NOTES', - icon: , - notificationIcon: , backgroundColor: NOTES_APP_PRIMARY_COLOR, color: NOTES_APP_ICON_COLOR, path: '/notes', @@ -166,8 +137,6 @@ export const APPS: IAppConfig[] = [ { id: 'CAMERA', nameLocale: 'APPS_CAMERA', - icon: , - notificationIcon: , backgroundColor: grey['A400'], color: common.white, path: '/camera', @@ -180,8 +149,6 @@ if (process.env.NODE_ENV === 'development') { APPS.push({ id: 'EXAMPLE', nameLocale: 'APPS_EXAMPLE', - icon: , - notificationIcon: , backgroundColor: blue[500], color: blue[50], path: '/example', diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index 3ba6c34..20d0032 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -1,24 +1,48 @@ -import { useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { useNotifications } from '../../notifications/hooks/useNotifications'; -import { APPS, IAppConfig } from '../config/apps'; +import { createLazyAppIcon } from '../utils/createLazyAppIcon'; +import { APPS, IApp } from '../config/apps'; +import { SvgIconComponent } from '@material-ui/icons'; +import { useTheme } from '@material-ui/core'; + +const DEFAULT_ICONSET = 'default'; export const useApps = () => { const { icons } = useNotifications(); - const apps = useMemo( + const theme = useTheme(); + const iconset = DEFAULT_ICONSET; + const apps: IApp[] = useMemo( () => - APPS.map((a) => ({ - ...a, - notification: icons.find((i) => i.key === a.id), - })), - [icons], + APPS.map((app) => { + + const SvgIcon = React.lazy( + () => import(`${__dirname}/../icons/${iconset}/svg/${app.id}`), + ); + const AppIcon = React.lazy( + () => import(`${__dirname}/../icons/${iconset}/app/${app.id}`), + ); + + const NotificationIcon = createLazyAppIcon(SvgIcon); + const Icon = createLazyAppIcon(AppIcon); + + return { + ...app, + notification: icons.find((i) => i.key === app.id), + NotificationIcon, + Icon, + notificationIcon: ( + + ), + icon: , + }; + }), + [icons, iconset, theme], ); - const getApp = useCallback((id: string): IAppConfig => apps.find((a) => a.id === id) || null, [ - apps, - ]); + const getApp = useCallback((id: string): IApp => apps.find((a) => a.id === id) || null, [apps]); return { apps, getApp }; }; -export const useApp = (id: string): IAppConfig => { +export const useApp = (id: string): IApp => { const { getApp } = useApps(); return getApp(id); }; diff --git a/phone/src/os/apps/icons/default/app/BANK.tsx b/phone/src/os/apps/icons/default/app/BANK.tsx new file mode 100644 index 0000000..1086928 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/BANK.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const BankAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + ); +}; + +export default BankAppIcon; diff --git a/phone/src/os/apps/icons/default/app/CALCULATOR.tsx b/phone/src/os/apps/icons/default/app/CALCULATOR.tsx new file mode 100644 index 0000000..9570819 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/CALCULATOR.tsx @@ -0,0 +1,86 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const CalculatorAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default CalculatorAppIcon; diff --git a/phone/src/os/apps/icons/default/app/CAMERA.tsx b/phone/src/os/apps/icons/default/app/CAMERA.tsx new file mode 100644 index 0000000..796f065 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/CAMERA.tsx @@ -0,0 +1,69 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const CameraAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default CameraAppIcon; diff --git a/phone/src/os/apps/icons/default/app/CONTACTS.tsx b/phone/src/os/apps/icons/default/app/CONTACTS.tsx new file mode 100644 index 0000000..18fd203 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/CONTACTS.tsx @@ -0,0 +1,47 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const ContactsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + ); +}; + +export default ContactsAppIcon; diff --git a/phone/src/os/apps/icons/default/app/DIALER.tsx b/phone/src/os/apps/icons/default/app/DIALER.tsx new file mode 100644 index 0000000..09f2161 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/DIALER.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const DialerAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + ); +}; + +export default DialerAppIcon; diff --git a/phone/src/os/apps/icons/default/app/EMAIL.tsx b/phone/src/os/apps/icons/default/app/EMAIL.tsx new file mode 100644 index 0000000..3b29891 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/EMAIL.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const EmailAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + ); +}; + +export default EmailAppIcon; diff --git a/phone/src/os/apps/icons/default/app/EXAMPLE.tsx b/phone/src/os/apps/icons/default/app/EXAMPLE.tsx new file mode 100644 index 0000000..1086928 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/EXAMPLE.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const BankAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + ); +}; + +export default BankAppIcon; diff --git a/phone/src/os/apps/icons/default/app/MATCH.tsx b/phone/src/os/apps/icons/default/app/MATCH.tsx new file mode 100644 index 0000000..ade5247 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/MATCH.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const MatchAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + ); +}; + +export default MatchAppIcon; diff --git a/phone/src/os/apps/icons/default/app/MESSAGES.tsx b/phone/src/os/apps/icons/default/app/MESSAGES.tsx new file mode 100644 index 0000000..87601f3 --- /dev/null +++ b/phone/src/os/apps/icons/default/app/MESSAGES.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const MessagesAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + + + ); +}; + +export default MessagesAppIcon; diff --git a/phone/src/os/apps/icons/default/app/NOTES.tsx b/phone/src/os/apps/icons/default/app/NOTES.tsx new file mode 100644 index 0000000..e4eef6b --- /dev/null +++ b/phone/src/os/apps/icons/default/app/NOTES.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const NotesAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + ); +}; + +export default NotesAppIcon; diff --git a/phone/src/os/apps/icons/default/app/SELLOUT.tsx b/phone/src/os/apps/icons/default/app/SELLOUT.tsx new file mode 100644 index 0000000..262df9e --- /dev/null +++ b/phone/src/os/apps/icons/default/app/SELLOUT.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const SelloutAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + ); +}; + +export default SelloutAppIcon; diff --git a/phone/src/os/apps/icons/default/app/SETTINGS.tsx b/phone/src/os/apps/icons/default/app/SETTINGS.tsx new file mode 100644 index 0000000..14940fc --- /dev/null +++ b/phone/src/os/apps/icons/default/app/SETTINGS.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const SettingsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + + ); +}; + +export default SettingsAppIcon; diff --git a/phone/src/os/apps/icons/default/app/TWITTER.tsx b/phone/src/os/apps/icons/default/app/TWITTER.tsx new file mode 100644 index 0000000..b5bde5a --- /dev/null +++ b/phone/src/os/apps/icons/default/app/TWITTER.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const TwitterAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + + + + + ); +}; + +export default TwitterAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/BANK.tsx b/phone/src/os/apps/icons/default/svg/BANK.tsx new file mode 100644 index 0000000..e32c456 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/BANK.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const BankAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + +export default BankAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/CALCULATOR.tsx b/phone/src/os/apps/icons/default/svg/CALCULATOR.tsx new file mode 100644 index 0000000..f7c056d --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/CALCULATOR.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const CalculatorAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + +export default CalculatorAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/CAMERA.tsx b/phone/src/os/apps/icons/default/svg/CAMERA.tsx new file mode 100644 index 0000000..78e2ab4 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/CAMERA.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const CameraAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + + + ); +}; + +export default CameraAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/CONTACTS.tsx b/phone/src/os/apps/icons/default/svg/CONTACTS.tsx new file mode 100644 index 0000000..226a715 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/CONTACTS.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const ContactsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default ContactsAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/DIALER.tsx b/phone/src/os/apps/icons/default/svg/DIALER.tsx new file mode 100644 index 0000000..dc31ee5 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/DIALER.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const DialerAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default DialerAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/EMAIL.tsx b/phone/src/os/apps/icons/default/svg/EMAIL.tsx new file mode 100644 index 0000000..67ecbfe --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/EMAIL.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const SettingsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default SettingsAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/EXAMPLE.tsx b/phone/src/os/apps/icons/default/svg/EXAMPLE.tsx new file mode 100644 index 0000000..e32c456 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/EXAMPLE.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const BankAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + +export default BankAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/MATCH.tsx b/phone/src/os/apps/icons/default/svg/MATCH.tsx new file mode 100644 index 0000000..630143a --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/MATCH.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const SettingsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default SettingsAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/MESSAGES.tsx b/phone/src/os/apps/icons/default/svg/MESSAGES.tsx new file mode 100644 index 0000000..6823f12 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/MESSAGES.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const MessagesAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + +export default MessagesAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/NOTES.tsx b/phone/src/os/apps/icons/default/svg/NOTES.tsx new file mode 100644 index 0000000..52e9b10 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/NOTES.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const NotesAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default NotesAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/SELLOUT.tsx b/phone/src/os/apps/icons/default/svg/SELLOUT.tsx new file mode 100644 index 0000000..3104506 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/SELLOUT.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + + const SelloutAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + + + +export default SelloutAppIcon; \ No newline at end of file diff --git a/phone/src/os/apps/icons/default/svg/SETTINGS.tsx b/phone/src/os/apps/icons/default/svg/SETTINGS.tsx new file mode 100644 index 0000000..45d50b5 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/SETTINGS.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const SettingsAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + + + + ); +}; + +export default SettingsAppIcon; diff --git a/phone/src/os/apps/icons/default/svg/TWITTER.tsx b/phone/src/os/apps/icons/default/svg/TWITTER.tsx new file mode 100644 index 0000000..9b67020 --- /dev/null +++ b/phone/src/os/apps/icons/default/svg/TWITTER.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'; + +const TwitterAppIcon = (props: SvgIconProps) => { + return ( + + + dayiskuan@gmail.com + + + + + ); +}; + +export default TwitterAppIcon; diff --git a/phone/src/os/apps/utils/createLazyAppIcon.tsx b/phone/src/os/apps/utils/createLazyAppIcon.tsx new file mode 100644 index 0000000..9569c68 --- /dev/null +++ b/phone/src/os/apps/utils/createLazyAppIcon.tsx @@ -0,0 +1,14 @@ +import React, { Suspense } from 'react'; +import AppsIcon from '@material-ui/icons/Apps'; +import { SvgIconProps } from '@material-ui/core'; +import { SvgIconComponent } from '@material-ui/icons'; + +export const createLazyAppIcon = ( + Icon: React.LazyExoticComponent, +): React.FC => (props: SvgIconProps) => { + return ( + }> + + + ); +}; diff --git a/phone/src/os/notifications/components/NotificationBar.tsx b/phone/src/os/notifications/components/NotificationBar.tsx index aee3d09..0963e74 100644 --- a/phone/src/os/notifications/components/NotificationBar.tsx +++ b/phone/src/os/notifications/components/NotificationBar.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { makeStyles, Typography, @@ -77,6 +77,12 @@ export const NotificationBar = () => { const time = usePhoneTime(); + useEffect(() => { + if (notifications.length === 0) { + setBarUncollapsed(false); + } + }, [notifications, setBarUncollapsed]); + return ( <> { - + @@ -128,9 +134,6 @@ export const NotificationBar = () => { onClose={(e) => { e.stopPropagation(); notification.onClose?.(notification); - if (notifications.length === 1) { - setBarUncollapsed(false); - } removeNotification(idx); }} onClickClose={() => { diff --git a/phone/src/os/notifications/providers/NotificationsProvider.tsx b/phone/src/os/notifications/providers/NotificationsProvider.tsx index e6791f3..a98f8b8 100644 --- a/phone/src/os/notifications/providers/NotificationsProvider.tsx +++ b/phone/src/os/notifications/providers/NotificationsProvider.tsx @@ -26,7 +26,7 @@ type INotificationAlert = INotification & { resolve(): void; }; -interface INotificationIcon { +export interface INotificationIcon { key: string; icon: JSX.Element; badge: number; diff --git a/phone/src/ui/components/AppIcon.tsx b/phone/src/ui/components/AppIcon.tsx index 9bca4cb..24fef65 100644 --- a/phone/src/ui/components/AppIcon.tsx +++ b/phone/src/ui/components/AppIcon.tsx @@ -21,12 +21,17 @@ const useStyles = makeStyles( height: theme.spacing(8), fontSize: theme.typography.h4.fontSize, }, + icon: { + fontSize: theme.typography.h4.fontSize, + width: theme.spacing(8), + height: theme.spacing(8), + }, tooltip: { fontSize: 12, }, })); -export const AppIcon = ({ id, nameLocale, name, icon, backgroundColor, color, notification }) => { +export const AppIcon = ({ id, nameLocale, name, Icon, backgroundColor, color, notification }) => { const { t } = useTranslation(); const classes = useStyles({ backgroundColor: backgroundColor || green[50], @@ -48,7 +53,11 @@ export const AppIcon = ({ id, nameLocale, name, icon, backgroundColor, color, no badgeContent={notification?.badge} invisible={!notification || notification.badge < 2} > - {icon || name[0].toUpperCase()} + {Icon ? ( + + ) : ( + {name[0].toUpperCase()} + )}