mad formatting

This commit is contained in:
Christopher committed 2021-03-02 20:41:25 +01:00
1 parent 6777498bcc
commit 046447b0fb
74 files changed
+329 -309

No files matched your search

+17 -13
View File
@@ -1,10 +1,5 @@
import React from 'react';
import {
blue,
common,
grey,
purple,
} from '@material-ui/core/colors';
import { blue, common, grey, purple } from '@material-ui/core/colors';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faAd,
@@ -41,9 +36,18 @@ import {
CONTACTS_APP_PRIMARY_COLOR,
CONTACTS_APP_TEXT_COLOR,
} from '../../../apps/contacts/contacts.theme';
import { SELLOUT_APP_PRIMARY_COLOR, SELLOUT_APP_ICON_COLOR } from '../../../apps/sellout/sellout.theme';
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
import {
SELLOUT_APP_PRIMARY_COLOR,
SELLOUT_APP_ICON_COLOR,
} from '../../../apps/sellout/sellout.theme';
import {
NOTES_APP_ICON_COLOR,
NOTES_APP_PRIMARY_COLOR,
} from '../../../apps/notes/notes.theme';
import {
DIALER_APP_PRIMARY_COLOR,
DIALER_APP_TEXT_COLOR,
} from '../../../apps/dialer/dialer.theme';
export interface IAppConfig {
id: string;
@@ -70,7 +74,7 @@ export const APPS: IAppConfig[] = [
{
id: 'MESSAGES',
nameLocale: 'APPS_MESSAGES',
icon: <MessageIcon fontSize="large" />,
icon: <MessageIcon fontSize='large' />,
notificationIcon: <MessageIcon fontSize='small' />,
backgroundColor: MESSAGES_APP_PRIMARY_COLOR,
color: MESSAGES_APP_TEXT_COLOR,
@@ -82,7 +86,7 @@ export const APPS: IAppConfig[] = [
{
id: 'CONTACTS',
nameLocale: 'APPS_CONTACTS',
icon: <ContactsIcon fontSize="large" />,
icon: <ContactsIcon fontSize='large' />,
notificationIcon: <ContactsIcon fontSize='small' />,
backgroundColor: CONTACTS_APP_PRIMARY_COLOR,
color: CONTACTS_APP_TEXT_COLOR,
@@ -94,7 +98,7 @@ export const APPS: IAppConfig[] = [
{
id: 'CALCULATOR',
nameLocale: 'APPS_CALCULATOR',
icon: <CalculatorIcon fontSize="large" />,
icon: <CalculatorIcon fontSize='large' />,
notificationIcon: <CalculatorIcon fontSize='small' />,
backgroundColor: purple[500],
color: grey[50],
@@ -106,7 +110,7 @@ export const APPS: IAppConfig[] = [
{
id: 'SETTINGS',
nameLocale: 'APPS_SETTINGS',
icon: <SettingsIcon fontSize="large" />,
icon: <SettingsIcon fontSize='large' />,
notificationIcon: <SettingsIcon fontSize='small' />,
backgroundColor: '#383838',
color: grey[50],
+2 -2
View File
@@ -5,7 +5,7 @@
* @returns {boolean}
*/
export function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
return item && typeof item === 'object' && !Array.isArray(item);
}
/**
@@ -29,4 +29,4 @@ export function deepMergeObjects(target, ...sources) {
}
return deepMergeObjects(target, ...sources);
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ export const CallModal = () => {
<CallTimer isAccepted={call?.accepted} />
</Box>
<div className={classes.actions}>
<CallControls size="medium" />
<CallControls size='medium' />
</div>
</AppContent>
</AppWrapper>
+5 -7
View File
@@ -1,7 +1,6 @@
import React, { useEffect, useRef } from 'react';
import { useDuration } from '../hooks/useDuration';
const runTimer = (updatedTime, setDuration) => {
let newTime = { ...updatedTime.current };
if (newTime.m >= 60) {
@@ -17,25 +16,24 @@ const runTimer = (updatedTime, setDuration) => {
newTime = { ...newTime, ms: newTime.ms + 1 };
updatedTime.current = newTime;
setDuration(newTime);
}
};
function CallTimer({ isAccepted }) {
const { duration, setDuration } = useDuration();
const updatedTime = useRef({ ms: 0, s: 0, m: 0, h: 0 });
const timer = useRef(null)
const timer = useRef(null);
useEffect(() => {
if (isAccepted) {
runTimer(updatedTime, setDuration)
runTimer(updatedTime, setDuration);
timer.current = setInterval(() => {
runTimer(updatedTime, setDuration)
runTimer(updatedTime, setDuration);
}, 10);
} else {
clearInterval(timer.current);
timer.current = null;
}
return () => clearInterval(timer.current)
return () => clearInterval(timer.current);
}, [isAccepted, setDuration]);
if (!duration || !isAccepted) return null;
+4 -4
View File
@@ -3,14 +3,14 @@ import { atom } from 'recoil';
export const callerState = {
currentCall: atom({
key: 'currentCall',
default: null
default: null,
}),
callModal: atom({
key: 'callingModal',
default: false
default: false,
}),
callDuration: atom({
key: 'callDuration',
default: {ms: 0, s: 0, m: 0, h: 0}
})
default: { ms: 0, s: 0, m: 0, h: 0 },
}),
};
+2 -2
View File
@@ -8,5 +8,5 @@ interface ModalProps {
export const useCallModal = (): ModalProps => {
const [modal, setModal] = useRecoilState(callerState.callModal);
return { modal, setModal }
}
return { modal, setModal };
};
@@ -9,7 +9,7 @@ interface INotificationIcon {
export const NotificationIcon = ({ icon, to }: INotificationIcon) => {
return (
<IconButton component={NavLink} to={to} size="small">
<IconButton component={NavLink} to={to} size='small'>
{icon}
</IconButton>
);
+1 -1
View File
@@ -14,7 +14,7 @@ interface IUsePhone {
export const usePhone = (): IUsePhone => {
const isPhoneOpen = useRecoilValue(phoneState.visibility);
const { removeAlerts } = useNotifications();
const closePhone = () => {