feat(phone/browser): Added a browser app

This utilizes an iframe, meaning sites that are blocking cross-origin iframes will ultimately fail.

With this feature, a config option is added to the nui config allowing for users to specify a home page URL to default to.
This commit is contained in:
Taso committed 2021-07-28 21:21:11 -04:00
1 parent b433c2bda0
commit a06ef07902
11 files changed
+248 -5

No files matched your search

+11
View File
@@ -34,6 +34,7 @@ import {
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';
import { BrowserApp } from '../../../apps/browser/components/BrowserApp';
export interface IAppConfig {
id: string;
@@ -61,6 +62,16 @@ export const APPS: IAppConfig[] = [
path: '/phone',
Route: () => <AppRoute id="DIALER" path="/phone" component={DialerApp} emitOnOpen={false} />,
},
{
id: 'BROWSER',
nameLocale: 'BROWSER.NAME',
backgroundColor: blue['300'],
path: '/browser',
color: common.white,
Route: () => (
<AppRoute id="BROWSER" path="/browser" component={BrowserApp} emitOnOpen={false} />
),
},
{
id: 'MESSAGES',
nameLocale: 'APPS_MESSAGES',
+8 -4
View File
@@ -18,11 +18,15 @@ export const useApps = () => {
const apps: IApp[] = useMemo(() => {
return APPS.map((app) => {
const SvgIcon = React.lazy<SvgIconComponent>(
() => import(`${__dirname}/../icons/${curIconSet.name}/svg/${app.id}`),
const SvgIcon = React.lazy<SvgIconComponent>(() =>
import(`${__dirname}/../icons/${curIconSet.name}/svg/${app.id}`).catch(
() => 'Was not able to find a dynamic import for icon from this icon set',
),
);
const AppIcon = React.lazy<SvgIconComponent>(
() => import(`${__dirname}/../icons/${curIconSet.name}/app/${app.id}`),
const AppIcon = React.lazy<SvgIconComponent>(() =>
import(`${__dirname}/../icons/${curIconSet.name}/app/${app.id}`).catch(
() => 'Was not able to find a dynamic import for icon from this icon set',
),
);
const NotificationIcon = createLazyAppIcon(SvgIcon);
@@ -0,0 +1,5 @@
import { Language } from '@material-ui/icons';
const BrowserIcon = () => <Language fontSize="large" />;
export default BrowserIcon;
@@ -0,0 +1,5 @@
import { Language } from '@material-ui/icons';
const BrowserIcon = () => <Language fontSize="small" />;
export default BrowserIcon;
@@ -0,0 +1,5 @@
import { Language } from '@material-ui/icons';
const BrowserIcon = () => <Language fontSize="large" />;
export default BrowserIcon;
@@ -0,0 +1,5 @@
import { Language } from '@material-ui/icons';
const BrowserIcon = () => <Language fontSize="small" />;
export default BrowserIcon;