diff --git a/.prettierrc b/.prettierrc index 31b3103..eb077ee 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "printWidth": 90, + "printWidth": 120, "singleQuote": true, "semi": true, "bracketSpacing": true, diff --git a/phone/.babelrc b/phone/.babelrc index 58c3cd4..29c0484 100644 --- a/phone/.babelrc +++ b/phone/.babelrc @@ -8,8 +8,5 @@ ], "@babel/preset-react" ], - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-syntax-dynamic-import" - ] + "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-syntax-dynamic-import"] } diff --git a/phone/public/index.html b/phone/public/index.html index df2e9a6..bd892da 100644 --- a/phone/public/index.html +++ b/phone/public/index.html @@ -2,14 +2,8 @@ - - + + Project Error - New Phone Who Dis diff --git a/phone/src/apps/bank/components/account/AccountTransactions.tsx b/phone/src/apps/bank/components/account/AccountTransactions.tsx index 8c4d13c..b4b6035 100644 --- a/phone/src/apps/bank/components/account/AccountTransactions.tsx +++ b/phone/src/apps/bank/components/account/AccountTransactions.tsx @@ -19,9 +19,7 @@ export const AccountTransactions = (): any => {

{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}

- +
diff --git a/phone/src/apps/bank/components/account/BankAccount.tsx b/phone/src/apps/bank/components/account/BankAccount.tsx index 7be5697..bf485b3 100644 --- a/phone/src/apps/bank/components/account/BankAccount.tsx +++ b/phone/src/apps/bank/components/account/BankAccount.tsx @@ -25,11 +25,7 @@ export const BankAccount = () => {

{t('APPS_BANK_ACCOUNT_TITLE')}

- +
); diff --git a/phone/src/apps/bank/components/home/BankHome.tsx b/phone/src/apps/bank/components/home/BankHome.tsx index 26638c3..e733161 100644 --- a/phone/src/apps/bank/components/home/BankHome.tsx +++ b/phone/src/apps/bank/components/home/BankHome.tsx @@ -24,8 +24,7 @@ export const BankHome = () => { return (
- {t('APPS_BANK_HOME_TITLE')},{' '} - {credentials.name} + {t('APPS_BANK_HOME_TITLE')}, {credentials.name}

Checking:

diff --git a/phone/src/apps/bank/components/navigation/NavigationBar.tsx b/phone/src/apps/bank/components/navigation/NavigationBar.tsx index 971367d..984f7dc 100644 --- a/phone/src/apps/bank/components/navigation/NavigationBar.tsx +++ b/phone/src/apps/bank/components/navigation/NavigationBar.tsx @@ -30,21 +30,9 @@ export const NavigationBar = () => { showLabels className={classes.root} > - } - to="/bank" - /> - } - to="/bank/account" - /> - } - to="/bank/transactions" - /> + } to="/bank" /> + } to="/bank/account" /> + } to="/bank/transactions" /> ); }; diff --git a/phone/src/apps/bank/components/transactions/TransactionList.tsx b/phone/src/apps/bank/components/transactions/TransactionList.tsx index 346eb5b..ba2587a 100644 --- a/phone/src/apps/bank/components/transactions/TransactionList.tsx +++ b/phone/src/apps/bank/components/transactions/TransactionList.tsx @@ -33,22 +33,20 @@ export const TransactionList = () => {
- {transactionList - .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) - .map((transaction: any) => ( -
-
-

{transaction.source}

-

{transaction.type}

-
-
-

- {transaction.type === 'Withdraw' ? '-' : '+'} - {transaction.amount} -

-
+ {transactionList.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((transaction: any) => ( +
+
+

{transaction.source}

+

{transaction.type}

- ))} +
+

+ {transaction.type === 'Withdraw' ? '-' : '+'} + {transaction.amount} +

+
+
+ ))} { if (!photos) return ( - + - @@ -48,27 +39,15 @@ export const GalleryGrid = () => { return (
- + - {photos.map((photo) => ( handlePhotoOpen(photo)}> -
+
))} diff --git a/phone/src/apps/camera/components/modal/GalleryModal.tsx b/phone/src/apps/camera/components/modal/GalleryModal.tsx index 661def2..2b8695e 100644 --- a/phone/src/apps/camera/components/modal/GalleryModal.tsx +++ b/phone/src/apps/camera/components/modal/GalleryModal.tsx @@ -18,10 +18,7 @@ export const GalleryModal = () => { const [shareOpen, setShareOpen] = useState(null); - const meta: ICameraPhoto = useMemo( - () => ({ id: query.id as string, image: query.image as string }), - [query], - ); + const meta: ICameraPhoto = useMemo(() => ({ id: query.id as string, image: query.image as string }), [query]); const _handleClose = () => { history.push(referal); @@ -48,10 +45,7 @@ export const GalleryModal = () => { -
+

Or just copy the image here:

{/* Here we are using the value in a h3 tag */}

{exampleString}

- (playing ? stop() : play())}> - {playing ? : } - + (playing ? stop() : play())}>{playing ? : } diff --git a/phone/src/apps/messages/components/MessagesApp.tsx b/phone/src/apps/messages/components/MessagesApp.tsx index 9ca755d..aa5f972 100644 --- a/phone/src/apps/messages/components/MessagesApp.tsx +++ b/phone/src/apps/messages/components/MessagesApp.tsx @@ -38,11 +38,7 @@ export const MessagesApp = () => { /> - } - /> + } /> history.push('/messages/new')} /> diff --git a/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx b/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx index d2c8735..00f429d 100644 --- a/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx +++ b/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx @@ -32,9 +32,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => { // handles phone numbers in a csv format and strips all spaces and // external characters out of them: // 123-4567, 987-6543, 333-4444 - const phoneNumbers = participants.map(({ number }) => - number.replace(/[^0-9]/g, ''), - ); + const phoneNumbers = participants.map(({ number }) => number.replace(/[^0-9]/g, '')); const labelValue = isGroupChat ? label.trim() : null; if (phoneNumbers.length) { @@ -101,13 +99,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => { )} - diff --git a/phone/src/apps/messages/components/list/MessageGroupItem.tsx b/phone/src/apps/messages/components/list/MessageGroupItem.tsx index 22722a2..0152693 100644 --- a/phone/src/apps/messages/components/list/MessageGroupItem.tsx +++ b/phone/src/apps/messages/components/list/MessageGroupItem.tsx @@ -1,10 +1,5 @@ import React from 'react'; -import { - ListItem, - ListItemText, - ListItemAvatar, - Avatar as MuiAvatar, -} from '@material-ui/core'; +import { ListItem, ListItemText, ListItemAvatar, Avatar as MuiAvatar } from '@material-ui/core'; import { MessageGroup } from '../../../../common/typings/messages'; @@ -15,12 +10,7 @@ interface IProps { const MessageGroupItem = ({ messageGroup, handleClick }: IProps): any => { return ( - + diff --git a/phone/src/apps/messages/components/list/MessageSearch.tsx b/phone/src/apps/messages/components/list/MessageSearch.tsx index 47a02b3..a565854 100644 --- a/phone/src/apps/messages/components/list/MessageSearch.tsx +++ b/phone/src/apps/messages/components/list/MessageSearch.tsx @@ -7,9 +7,7 @@ import useStyles from './list.styles'; interface IProps { value: string; - handleChange: ( - event: React.ChangeEvent, - ) => void; + handleChange: (event: React.ChangeEvent) => void; } const MessageSearch = ({ value, handleChange }: IProps) => { diff --git a/phone/src/apps/messages/components/list/MessagesList.tsx b/phone/src/apps/messages/components/list/MessagesList.tsx index 43838f5..680167b 100644 --- a/phone/src/apps/messages/components/list/MessagesList.tsx +++ b/phone/src/apps/messages/components/list/MessagesList.tsx @@ -13,46 +13,30 @@ const MessagesList = (): any => { const classes = useStyles(); const history = useHistory(); - const { - messageGroups, - createMessageGroupResult, - clearMessageGroupResult, - } = useMessages(); + const { messageGroups, createMessageGroupResult, clearMessageGroupResult } = useMessages(); const [searchValue, setSearchValue] = useState(''); const goToConversation = useCallback( - (messageGroup) => - history.push( - `/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`, - ), + (messageGroup) => history.push(`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`), [history], ); useEffect(() => { if (createMessageGroupResult?.groupId) { - const findGroup = messageGroups.find( - (g) => g.groupId === createMessageGroupResult.groupId, - ); + const findGroup = messageGroups.find((g) => g.groupId === createMessageGroupResult.groupId); clearMessageGroupResult(); if (findGroup) { goToConversation(findGroup); } } - }, [ - messageGroups, - createMessageGroupResult, - goToConversation, - clearMessageGroupResult, - ]); + }, [messageGroups, createMessageGroupResult, goToConversation, clearMessageGroupResult]); if (!messageGroups) return null; const handleClick = (messageGroup: MessageGroup) => () => { Nui.send('phone:fetchMessages', { groupId: messageGroup.groupId }); - history.push( - `/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`, - ); + history.push(`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`); }; const formattedSearch = searchValue.toLowerCase().trim(); @@ -62,25 +46,16 @@ const MessagesList = (): any => { const displayIncludes = groupDisplay.includes(formattedSearch); const label = group.label?.toLowerCase(); - return label - ? displayIncludes || label.includes(formattedSearch) - : displayIncludes; + return label ? displayIncludes || label.includes(formattedSearch) : displayIncludes; }) : messageGroups; return ( <> - setSearchValue(e.target.value)} - /> + setSearchValue(e.target.value)} /> {filteredGroups.map((messageGroup) => ( - + ))} diff --git a/phone/src/apps/messages/components/modal/Conversation.tsx b/phone/src/apps/messages/components/modal/Conversation.tsx index d686af8..6517548 100644 --- a/phone/src/apps/messages/components/modal/Conversation.tsx +++ b/phone/src/apps/messages/components/modal/Conversation.tsx @@ -38,17 +38,10 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => { className={classes.overflowAutoY} > {messages.map((message) => ( - + ))} - setImageModalOpen(true)} - /> + setImageModalOpen(true)} /> ); }; diff --git a/phone/src/apps/messages/components/modal/MessageBubble.tsx b/phone/src/apps/messages/components/modal/MessageBubble.tsx index 39b6c3e..ad92e8d 100644 --- a/phone/src/apps/messages/components/modal/MessageBubble.tsx +++ b/phone/src/apps/messages/components/modal/MessageBubble.tsx @@ -41,33 +41,21 @@ const isImage = (url) => { return /(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|png|jpeg|gif)/g.test(url); }; -export const MessageBubble = ({ - message, - isGroupChat, -}: { - message: Message; - isGroupChat: boolean; -}) => { +export const MessageBubble = ({ message, isGroupChat }: { message: Message; isGroupChat: boolean }) => { const classes = useStyles(); return (
{isImage(message.message) ? ( - multimedia + multimedia ) : (
{message.message}
)}
- {isGroupChat && !message.isMine - ? message.display || message.phone_number - : null} + {isGroupChat && !message.isMine ? message.display || message.phone_number : null}
diff --git a/phone/src/apps/messages/components/modal/MessageImageModal.tsx b/phone/src/apps/messages/components/modal/MessageImageModal.tsx index 6faa00d..43043ae 100644 --- a/phone/src/apps/messages/components/modal/MessageImageModal.tsx +++ b/phone/src/apps/messages/components/modal/MessageImageModal.tsx @@ -89,10 +89,7 @@ export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IP Do you want to share this image? - + - + {t('GENERIC_CANCEL')} @@ -121,20 +108,12 @@ export const NoteModal = () => { ) : ( <> - - + {t('GENERIC_DELETE')} diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx index eedb6a1..7dbd5c0 100644 --- a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx +++ b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx @@ -54,10 +54,7 @@ export const SelloutItem = (listing) => { {listing.name} - + {listing.number} diff --git a/phone/src/apps/sellout/components/navigation/NavigationBar.tsx b/phone/src/apps/sellout/components/navigation/NavigationBar.tsx index 0804554..bda5dd6 100644 --- a/phone/src/apps/sellout/components/navigation/NavigationBar.tsx +++ b/phone/src/apps/sellout/components/navigation/NavigationBar.tsx @@ -28,16 +28,8 @@ export const NavigationBar = () => { showLabels className={classes.root} > - } - to="/sellout" - /> - } - to="/sellout/new" - /> + } to="/sellout" /> + } to="/sellout/new" /> ); }; diff --git a/phone/src/apps/settings/components/SettingsApp.tsx b/phone/src/apps/settings/components/SettingsApp.tsx index 1b2ec39..2eafab2 100644 --- a/phone/src/apps/settings/components/SettingsApp.tsx +++ b/phone/src/apps/settings/components/SettingsApp.tsx @@ -10,15 +10,7 @@ import { useApp } from '../../../os/apps/hooks/useApps'; import { SettingItem } from './SettingItem'; import { useTranslation } from 'react-i18next'; -import { - Brush, - Wallpaper, - Phone, - Smartphone, - ZoomIn, - LibraryMusic, - VolumeUp, -} from '@material-ui/icons'; +import { Brush, Wallpaper, Phone, Smartphone, ZoomIn, LibraryMusic, VolumeUp } from '@material-ui/icons'; import { Box, @@ -53,11 +45,7 @@ export const SettingsApp = () => { useEffect(() => { setSliders((curr) => { if (!curr.length) { - return [ - settings.ringtoneVol, - settings.notificationVol, - settings.TWITTER_notificationVol, - ]; + return [settings.ringtoneVol, settings.notificationVol, settings.TWITTER_notificationVol]; } return curr; }); @@ -74,9 +62,7 @@ export const SettingsApp = () => { const { t } = useTranslation(); const wallpapers = config.wallpapers.map( - MapStringOptions(settings.wallpaper, (val: string) => - handleSettingChange('wallpaper', val), - ), + MapStringOptions(settings.wallpaper, (val: string) => handleSettingChange('wallpaper', val)), ); const frames = config.frames.map( MapStringOptions(settings.frame, (val: string) => handleSettingChange('frame', val)), @@ -88,20 +74,14 @@ export const SettingsApp = () => { MapStringOptions(settings.zoom, (val: string) => handleSettingChange('zoom', val)), ); const ringtones = config.ringtones.map( - MapStringOptions(settings.ringtone, (val: string) => - handleSettingChange('ringtone', val), - ), + MapStringOptions(settings.ringtone, (val: string) => handleSettingChange('ringtone', val)), ); const notifications = config.notifications.map( - MapStringOptions(settings.notification, (val: string) => - handleSettingChange('notification', val), - ), + MapStringOptions(settings.notification, (val: string) => handleSettingChange('notification', val)), ); const twitterNotifications = config.notifications.map( - MapStringOptions(settings.notification, (val: string) => - handleSettingChange('TWITTER_notification', val), - ), + MapStringOptions(settings.notification, (val: string) => handleSettingChange('TWITTER_notification', val)), ); const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu(); @@ -110,11 +90,7 @@ export const SettingsApp = () => { }> - } - /> + } /> { - + { - + { min={0} max={100} onChange={handleSliderChange(1)} - onChangeCommitted={() => - handleSettingChange('notificationVol', sliders[1]) - } + onChangeCommitted={() => handleSettingChange('notificationVol', sliders[1])} /> @@ -226,9 +194,7 @@ export const SettingsApp = () => { min={0} max={100} onChange={handleSliderChange(2)} - onChangeCommitted={() => - handleSettingChange('TWITTER_notificationVol', sliders[2]) - } + onChangeCommitted={() => handleSettingChange('TWITTER_notificationVol', sliders[2])} /> diff --git a/phone/src/apps/settings/utils/getRingtonePath.ts b/phone/src/apps/settings/utils/getRingtonePath.ts index 2bf991c..28b8031 100644 --- a/phone/src/apps/settings/utils/getRingtonePath.ts +++ b/phone/src/apps/settings/utils/getRingtonePath.ts @@ -1,5 +1,3 @@ -export const getRingtonePath = (name?: string) => - `./media/ringtones/${name || 'pixel'}.ogg`; +export const getRingtonePath = (name?: string) => `./media/ringtones/${name || 'pixel'}.ogg`; -export const getNotificationPath = (name?: string) => - `./media/notifications/${name || 'online'}.ogg`; +export const getNotificationPath = (name?: string) => `./media/notifications/${name || 'online'}.ogg`; diff --git a/phone/src/apps/twitter/components/AddTweetModal.tsx b/phone/src/apps/twitter/components/AddTweetModal.tsx index 369209d..394e12b 100644 --- a/phone/src/apps/twitter/components/AddTweetModal.tsx +++ b/phone/src/apps/twitter/components/AddTweetModal.tsx @@ -106,10 +106,7 @@ export const AddTweetModal = () => { const data = { message, - images: - images && images.length > 0 - ? images.map((image) => image.link).join(IMAGE_DELIMITER) - : '', + images: images && images.length > 0 ? images.map((image) => image.link).join(IMAGE_DELIMITER) : '', realUser: 'testUser', }; Nui.send('phone:createTweet', data); @@ -158,27 +155,13 @@ export const AddTweetModal = () => { return ( - - + + - 0} - images={images} - removeImage={removeImage} - /> + 0} images={images} removeImage={removeImage} />
} /> - } - /> - } - /> + } /> + } /> ); } diff --git a/phone/src/apps/twitter/components/TwitterApp.tsx b/phone/src/apps/twitter/components/TwitterApp.tsx index 3fb83cc..ae85b41 100644 --- a/phone/src/apps/twitter/components/TwitterApp.tsx +++ b/phone/src/apps/twitter/components/TwitterApp.tsx @@ -59,8 +59,7 @@ export const TwitterApp = () => { // before any other action can be taken by the user we force // them have a profile name - const promptProfileName = - profile && (!profile.profile_name || !profile.profile_name.trim()); + const promptProfileName = profile && (!profile.profile_name || !profile.profile_name.trim()); const openModal = () => setModalVisible(true); const handlePageChange = (e, page) => setActivePage(page); @@ -83,9 +82,7 @@ export const TwitterApp = () => { )} {showTweetButton && } - {!promptProfileName && ( - - )} + {!promptProfileName && } ); }; diff --git a/phone/src/apps/twitter/components/buttons/ControlButtons.tsx b/phone/src/apps/twitter/components/buttons/ControlButtons.tsx index fb054b0..a3bfffe 100644 --- a/phone/src/apps/twitter/components/buttons/ControlButtons.tsx +++ b/phone/src/apps/twitter/components/buttons/ControlButtons.tsx @@ -16,19 +16,12 @@ const useStyles = makeStyles((theme) => ({ }, })); -export const ControlButtons = ({ - showImagePrompt, - showEmoji, - onCloseClick, - onPrimaryClick, -}) => { +export const ControlButtons = ({ showImagePrompt, showEmoji, onCloseClick, onPrimaryClick }) => { const classes = useStyles(); const { t } = useTranslation(); const imagePromptVisible = showImagePrompt && !showEmoji; - const primaryButtonText = imagePromptVisible - ? t('APPS_TWITTER_SUBMIT_IMAGE') - : t('APPS_TWITTER_TWEET'); + const primaryButtonText = imagePromptVisible ? t('APPS_TWITTER_SUBMIT_IMAGE') : t('APPS_TWITTER_TWEET'); const showCloseButton = showImagePrompt || showEmoji; return ( @@ -37,12 +30,7 @@ export const ControlButtons = ({ {primaryButtonText} {showCloseButton && ( - )} diff --git a/phone/src/apps/twitter/components/buttons/LikeButton.tsx b/phone/src/apps/twitter/components/buttons/LikeButton.tsx index ede5974..d304daf 100644 --- a/phone/src/apps/twitter/components/buttons/LikeButton.tsx +++ b/phone/src/apps/twitter/components/buttons/LikeButton.tsx @@ -28,11 +28,7 @@ function LikeButton({ tweetId, isLiked }) { ); } - return ( - - ); + return ; } export default LikeButton; diff --git a/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx b/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx index 5f90257..e587c7a 100644 --- a/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx +++ b/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx @@ -35,12 +35,7 @@ export function ProfileUpdateButton({ handleClick }) { return (
- +
diff --git a/phone/src/apps/twitter/components/images/Image.tsx b/phone/src/apps/twitter/components/images/Image.tsx index 9de64a9..3c3c606 100644 --- a/phone/src/apps/twitter/components/images/Image.tsx +++ b/phone/src/apps/twitter/components/images/Image.tsx @@ -45,11 +45,7 @@ export const Image = ({ link, handleClick, small }) => { )} - small avatar + small avatar
); }; diff --git a/phone/src/apps/twitter/components/images/ImagePrompt.tsx b/phone/src/apps/twitter/components/images/ImagePrompt.tsx index bcdd2d2..49c973a 100644 --- a/phone/src/apps/twitter/components/images/ImagePrompt.tsx +++ b/phone/src/apps/twitter/components/images/ImagePrompt.tsx @@ -23,9 +23,7 @@ export const ImagePrompt = ({ visible, value, handleChange }) => { textFieldRef.current && textFieldRef.current.focus(); }, [visible]); - const handleImageChange = useCallback((e) => handleChange(e.target.value), [ - handleChange, - ]); + const handleImageChange = useCallback((e) => handleChange(e.target.value), [handleChange]); if (!visible) return null; return ( diff --git a/phone/src/apps/twitter/components/profile/Profile.tsx b/phone/src/apps/twitter/components/profile/Profile.tsx index 326e002..09a67a5 100644 --- a/phone/src/apps/twitter/components/profile/Profile.tsx +++ b/phone/src/apps/twitter/components/profile/Profile.tsx @@ -70,22 +70,13 @@ export function Profile() { handleChange={handleNameChange} allowChange={allowEdtiableProfileName} /> - + - +
); diff --git a/phone/src/apps/twitter/components/tweet/ShowMore.tsx b/phone/src/apps/twitter/components/tweet/ShowMore.tsx index 0b776b1..c4ee835 100644 --- a/phone/src/apps/twitter/components/tweet/ShowMore.tsx +++ b/phone/src/apps/twitter/components/tweet/ShowMore.tsx @@ -76,12 +76,8 @@ export const ShowMore = ({ id, isReported, isMine }) => { horizontal: 'left', }} > - {allowedToDelete && ( - {t('APPS_TWITTER_DELETE')} - )} - {allowedToReport && ( - - )} + {allowedToDelete && {t('APPS_TWITTER_DELETE')}} + {allowedToReport && } ); diff --git a/phone/src/apps/twitter/components/tweet/Tweet.tsx b/phone/src/apps/twitter/components/tweet/Tweet.tsx index d465f50..7aab4a2 100644 --- a/phone/src/apps/twitter/components/tweet/Tweet.tsx +++ b/phone/src/apps/twitter/components/tweet/Tweet.tsx @@ -1,12 +1,7 @@ import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { makeStyles } from '@material-ui/core/styles'; -import { - ListItemAvatar, - Avatar as MuiAvatar, - ListItem, - Typography, -} from '@material-ui/core'; +import { ListItemAvatar, Avatar as MuiAvatar, ListItem, Typography } from '@material-ui/core'; import { secondsToHumanReadable } from '../../utils/time'; import LikeButton from '../buttons/LikeButton'; import ReplyButton from '../buttons/ReplyButton'; @@ -61,17 +56,7 @@ const useStyles = makeStyles(() => ({ })); export const Tweet = (tweet) => { - const { - id, - message, - images, - avatar_url, - profile_name, - seconds_since_tweet, - isLiked, - isMine, - isReported, - } = tweet; + const { id, message, images, avatar_url, profile_name, seconds_since_tweet, isLiked, isMine, isReported } = tweet; const classes = useStyles(); const { t } = useTranslation(); const { config } = usePhone(); @@ -105,12 +90,7 @@ export const Tweet = (tweet) => {
{profileName}
- + {secondsToHumanReadable(t, seconds_since_tweet)}
diff --git a/phone/src/apps/twitter/components/tweet/TweetMessage.tsx b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx index 43e68c4..c22227b 100644 --- a/phone/src/apps/twitter/components/tweet/TweetMessage.tsx +++ b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx @@ -51,14 +51,10 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => { let errorMessage = null; const overCharacterLimit = message.trim().length > characterLimit; - const characterWarningPrompt = `${t( - 'APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT', - )} (${characterLimit})`; + const characterWarningPrompt = `${t('APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT')} (${characterLimit})`; const overNewLineLimit = getNewLineCount(message) > newLineLimit; - const newLineWarningPrompt = `${t( - 'APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT', - )} (${newLineLimit})`; + const newLineWarningPrompt = `${t('APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT')} (${newLineLimit})`; if (overCharacterLimit) { errorMessage = characterWarningPrompt; diff --git a/phone/src/apps/twitter/hooks/useModal.ts b/phone/src/apps/twitter/hooks/useModal.ts index d16c040..3decdcf 100644 --- a/phone/src/apps/twitter/hooks/useModal.ts +++ b/phone/src/apps/twitter/hooks/useModal.ts @@ -2,9 +2,7 @@ import { useRecoilState } from 'recoil'; import { twitterState } from './state'; export const useModal = () => { - const [modalVisible, setModalVisible] = useRecoilState( - twitterState.showCreateTweetModal, - ); + const [modalVisible, setModalVisible] = useRecoilState(twitterState.showCreateTweetModal); const [message, setMessage] = useRecoilState(twitterState.modalMessage); return { modalVisible, setModalVisible, message, setMessage }; }; diff --git a/phone/src/apps/twitter/hooks/useProfile.ts b/phone/src/apps/twitter/hooks/useProfile.ts index b5c6c86..7cd000c 100644 --- a/phone/src/apps/twitter/hooks/useProfile.ts +++ b/phone/src/apps/twitter/hooks/useProfile.ts @@ -19,9 +19,7 @@ interface IUseProfile { export const useProfile = (): IUseProfile => { const profile = useRecoilValue(twitterState.profile); const updateProfileLoading = useRecoilValue(twitterState.updateProfileLoading); - const [updateProfileSuccessful, setUpdateProfileSuccessful] = useRecoilState( - twitterState.updateProfileSuccess, - ); + const [updateProfileSuccessful, setUpdateProfileSuccessful] = useRecoilState(twitterState.updateProfileSuccess); return { profile, updateProfileLoading, diff --git a/phone/src/apps/twitter/hooks/useTweetStatus.ts b/phone/src/apps/twitter/hooks/useTweetStatus.ts index 0dacfa3..4b28012 100644 --- a/phone/src/apps/twitter/hooks/useTweetStatus.ts +++ b/phone/src/apps/twitter/hooks/useTweetStatus.ts @@ -4,9 +4,7 @@ import { twitterState } from './state'; export const useTweetStatus = () => { const createTweetLoading = useRecoilValue(twitterState.createTweetLoading); - const [createTweetSuccessful, setCreateTweetSuccessful] = useRecoilState( - twitterState.createTweetSuccessful, - ); + const [createTweetSuccessful, setCreateTweetSuccessful] = useRecoilState(twitterState.createTweetSuccessful); return { createTweetLoading, createTweetSuccessful, diff --git a/phone/src/apps/twitter/utils/time.ts b/phone/src/apps/twitter/utils/time.ts index 58253df..356238a 100644 --- a/phone/src/apps/twitter/utils/time.ts +++ b/phone/src/apps/twitter/utils/time.ts @@ -12,10 +12,7 @@ const DAYS = 'APPS_TWITTER_TIME_DAYS'; * @param {function} t - translation object passed from a component implementing the hook * @param {number} seconds - seconds to translate to a string */ -export function secondsToHumanReadable( - t: (input: string) => string, - seconds: number, -): string { +export function secondsToHumanReadable(t: (input: string) => string, seconds: number): string { if (seconds < 60) { return t(JUST_NOW); } else if (seconds < ONE_HOUR) { diff --git a/phone/src/common/utils/deleteQueryFromLocation.ts b/phone/src/common/utils/deleteQueryFromLocation.ts index c88662d..e41f638 100644 --- a/phone/src/common/utils/deleteQueryFromLocation.ts +++ b/phone/src/common/utils/deleteQueryFromLocation.ts @@ -6,10 +6,7 @@ interface IRouterLocation { search: any; } -export const deleteQueryFromLocation = ( - location: Record & IRouterLocation, - key = '', -) => { +export const deleteQueryFromLocation = (location: Record & IRouterLocation, key = '') => { const { query } = url(location.pathname + location.search); return `${location.pathname}/?${qs.stringify({ ...query, diff --git a/phone/src/config/default.json b/phone/src/config/default.json index 46f4a48..b96e253 100644 --- a/phone/src/config/default.json +++ b/phone/src/config/default.json @@ -19,15 +19,7 @@ "printDebugLogs": true, "logLevel": 1 }, - "frames": [ - "default.png", - "blue.png", - "gold.png", - "kawaii.png", - "minimal.png", - "pink.png", - "white.png" - ], + "frames": ["default.png", "blue.png", "gold.png", "kawaii.png", "minimal.png", "pink.png", "white.png"], "zoomOptions": [1, 0.9, 0.8], "ringtones": ["marimba", "pixel"], "notifications": ["online", "99kr"], diff --git a/phone/src/main.css b/phone/src/main.css index 3048d73..dff0f1a 100644 --- a/phone/src/main.css +++ b/phone/src/main.css @@ -1,6 +1,6 @@ body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', - 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', + 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 20px; diff --git a/phone/src/os/apps/config/apps.tsx b/phone/src/os/apps/config/apps.tsx index feb781a..25dafbb 100644 --- a/phone/src/os/apps/config/apps.tsx +++ b/phone/src/os/apps/config/apps.tsx @@ -1,13 +1,7 @@ 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 { 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'; @@ -28,26 +22,11 @@ import { NotesApp } from '../../../apps/notes/NotesApp'; import CameraApp from '../../../apps/camera/components/CameraApp'; import { AppRoute } from '../components/AppRoute'; -import { - MESSAGES_APP_PRIMARY_COLOR, - MESSAGES_APP_TEXT_COLOR, -} from '../../../apps/messages/messages.theme'; -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 { MESSAGES_APP_PRIMARY_COLOR, MESSAGES_APP_TEXT_COLOR } from '../../../apps/messages/messages.theme'; +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'; export interface IAppConfig { id: string; @@ -99,9 +78,7 @@ export const APPS: IAppConfig[] = [ backgroundColor: purple[500], color: grey[50], path: '/calculator', - Route: () => ( - - ), + Route: () => , }, { id: 'SETTINGS', diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index 687bf87..1d9b587 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -12,10 +12,7 @@ export const useApps = () => { })), [icons], ); - const getApp = useCallback( - (id: string): IAppConfig => apps.find((a) => a.id === id) || null, - [apps], - ); + const getApp = useCallback((id: string): IAppConfig => apps.find((a) => a.id === id) || null, [apps]); return { apps, getApp }; }; diff --git a/phone/src/os/call/hooks/useDuration.ts b/phone/src/os/call/hooks/useDuration.ts index f6a556d..706143e 100644 --- a/phone/src/os/call/hooks/useDuration.ts +++ b/phone/src/os/call/hooks/useDuration.ts @@ -5,9 +5,7 @@ import { callerState } from './state'; export const useDuration = () => { const [duration, setDuration] = useRecoilState(callerState.callDuration); - const resetDuration = useCallback(() => setDuration({ ms: 0, s: 0, m: 0, h: 0 }), [ - setDuration, - ]); + const resetDuration = useCallback(() => setDuration({ ms: 0, s: 0, m: 0, h: 0 }), [setDuration]); return { duration, setDuration, resetDuration }; }; diff --git a/phone/src/os/keyboard/hooks/useKeyboardService.ts b/phone/src/os/keyboard/hooks/useKeyboardService.ts index 7834a15..782f728 100644 --- a/phone/src/os/keyboard/hooks/useKeyboardService.ts +++ b/phone/src/os/keyboard/hooks/useKeyboardService.ts @@ -34,15 +34,7 @@ const keyboardState = { }), }; -const validKeys = [ - 'ArrowRight', - 'ArrowLeft', - 'ArrowUp', - 'ArrowDown', - 'Backspace', - 'Enter', - 'Escape', -]; +const validKeys = ['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown', 'Backspace', 'Enter', 'Escape']; const isKeyValid = (key) => validKeys.indexOf(key) !== -1; diff --git a/phone/src/os/navigation-bar/components/Navigation.tsx b/phone/src/os/navigation-bar/components/Navigation.tsx index 6b6a800..7e31fd9 100644 --- a/phone/src/os/navigation-bar/components/Navigation.tsx +++ b/phone/src/os/navigation-bar/components/Navigation.tsx @@ -28,16 +28,8 @@ export const Navigation = () => { value(); }} > - history.push('/')} - icon={} - /> - } - /> + history.push('/')} icon={} /> + } /> !isExact && history.goBack()} diff --git a/phone/src/os/notifications/components/NotificationBar.tsx b/phone/src/os/notifications/components/NotificationBar.tsx index 53c0483..d10f002 100644 --- a/phone/src/os/notifications/components/NotificationBar.tsx +++ b/phone/src/os/notifications/components/NotificationBar.tsx @@ -1,15 +1,5 @@ import React from 'react'; -import { - makeStyles, - Typography, - Grid, - IconButton, - Slide, - Paper, - Box, - List, - Divider, -} from '@material-ui/core'; +import { makeStyles, Typography, Grid, IconButton, Slide, Paper, Box, List, Divider } from '@material-ui/core'; import SignalIcon from '@material-ui/icons/SignalCellular3Bar'; import Battery90Icon from '@material-ui/icons/Battery90'; import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp'; @@ -66,13 +56,7 @@ const useStyles = makeStyles((theme) => ({ export const NotificationBar = () => { const classes = useStyles(); - const { - icons, - notifications, - removeNotification, - barUncollapsed, - setBarUncollapsed, - } = useNotifications(); + const { icons, notifications, removeNotification, barUncollapsed, setBarUncollapsed } = useNotifications(); return ( <> @@ -87,12 +71,7 @@ export const NotificationBar = () => { > {icons.map((notifIcon) => ( - + {notifIcon.icon} ))} @@ -139,11 +118,7 @@ export const NotificationBar = () => { - setBarUncollapsed(false)} - > + setBarUncollapsed(false)}> diff --git a/phone/src/os/notifications/components/NotificationItem.tsx b/phone/src/os/notifications/components/NotificationItem.tsx index 5d5a28c..67fea08 100644 --- a/phone/src/os/notifications/components/NotificationItem.tsx +++ b/phone/src/os/notifications/components/NotificationItem.tsx @@ -1,13 +1,6 @@ import React from 'react'; import CloseIcon from '@material-ui/icons/Close'; -import { - IconButton, - ListItem, - ListItemAvatar, - ListItemText, - makeStyles, - Theme, -} from '@material-ui/core'; +import { IconButton, ListItem, ListItemAvatar, ListItemText, makeStyles, Theme } from '@material-ui/core'; import { INotification } from '../providers/NotificationsProvider'; const useStyles = makeStyles((theme) => ({ diff --git a/phone/src/os/notifications/hooks/useQuickAccess.tsx b/phone/src/os/notifications/hooks/useQuickAccess.tsx index 7ec327d..1f96350 100644 --- a/phone/src/os/notifications/hooks/useQuickAccess.tsx +++ b/phone/src/os/notifications/hooks/useQuickAccess.tsx @@ -25,9 +25,7 @@ const unshiftApp = (arr: IAppConfig[], app) => { export const useQuickAccess = () => { const history = useHistory(); const { apps, getApp } = useApps(); - const [recentlyUsed, setRecentlyUsed] = useRecoilState( - state.recentlyUsed, - ); + const [recentlyUsed, setRecentlyUsed] = useRecoilState(state.recentlyUsed); useEffect(() => { setRecentlyUsed([getApp('SETTINGS')]); diff --git a/phone/src/os/notifications/providers/NotificationsProvider.tsx b/phone/src/os/notifications/providers/NotificationsProvider.tsx index 845ef37..30389a7 100644 --- a/phone/src/os/notifications/providers/NotificationsProvider.tsx +++ b/phone/src/os/notifications/providers/NotificationsProvider.tsx @@ -1,11 +1,4 @@ -import React, { - createContext, - useState, - useCallback, - useMemo, - useRef, - useEffect, -} from 'react'; +import React, { createContext, useState, useCallback, useMemo, useRef, useEffect } from 'react'; import { useRecoilValue } from 'recoil'; import { useSettings } from '../../../apps/settings/hooks/useSettings'; import { phoneState } from '../../phone/hooks/state'; @@ -53,11 +46,7 @@ export const NotificationsContext = createContext<{ updateId(id: string, value: Partial): void; removeId(id: string): void; hasNotification(app: string): number; - addNotificationAlert( - n: INotification, - persist: boolean, - update?: Partial, - ); + addNotificationAlert(n: INotification, persist: boolean, update?: Partial); }>(null); export function NotificationsProvider({ children }) { @@ -72,9 +61,7 @@ export function NotificationsProvider({ children }) { const { mount, play } = useSoundProvider(); const alertTimeout = useRef(); - const [alerts, setAlerts] = useState< - Array<[INotification, boolean, Partial, string | undefined]> - >([]); + const [alerts, setAlerts] = useState, string | undefined]>>([]); const [currentAlert, setCurrentAlert] = useState(); useEffect(() => { @@ -127,12 +114,7 @@ export function NotificationsProvider({ children }) { ); const _showAlert = useCallback( - ( - n: INotification, - persist: boolean, - update: Partial, - soundUrl: string, - ) => { + (n: INotification, persist: boolean, update: Partial, soundUrl: string) => { return new Promise((res) => { const resolve = () => { if (persist) { @@ -172,16 +154,10 @@ export function NotificationsProvider({ children }) { [addOrUpdateNotification, play], ); - const addNotificationAlert = ( - n: INotification, - persist?: boolean, - update?: Partial, - ) => { + const addNotificationAlert = (n: INotification, persist?: boolean, update?: Partial) => { if (n.sound) { const { sound, volume } = getSoundSettings('notification', settings, n.app); - mount(sound, volume, false).then(({ url }) => - setAlerts((curr) => [...curr, [n, persist, update, url]]), - ); + mount(sound, volume, false).then(({ url }) => setAlerts((curr) => [...curr, [n, persist, update, url]])); return; } setAlerts((curr) => [...curr, [n, persist, update, undefined]]); diff --git a/phone/src/os/sound/hooks/useSound.ts b/phone/src/os/sound/hooks/useSound.ts index 742c55d..33e449f 100644 --- a/phone/src/os/sound/hooks/useSound.ts +++ b/phone/src/os/sound/hooks/useSound.ts @@ -21,16 +21,7 @@ const useSound = (url: string, options: ISoundOptions = DEFAULT_OPTIONS) => { const [isPlaying, setPlaying] = useState(false); - const { - mount, - play, - stop, - playing, - volume, - loop, - remove, - isMounted, - } = useSoundProvider(); + const { mount, play, stop, playing, volume, loop, remove, isMounted } = useSoundProvider(); const previousInterrupt = usePreviousState(interrupt); const previousUrl = usePreviousState(url); @@ -50,20 +41,7 @@ const useSound = (url: string, options: ISoundOptions = DEFAULT_OPTIONS) => { } volume(url, vol); loop(url, isLoop); - }, [ - url, - vol, - isLoop, - isMounted, - volume, - loop, - mount, - previousUrl, - stop, - remove, - isPlaying, - play, - ]); + }, [url, vol, isLoop, isMounted, volume, loop, mount, previousUrl, stop, remove, isPlaying, play]); useEffect(() => { if (interrupt) { diff --git a/phone/src/os/sound/providers/SoundProvider.tsx b/phone/src/os/sound/providers/SoundProvider.tsx index 3cdf3b9..9c20b16 100644 --- a/phone/src/os/sound/providers/SoundProvider.tsx +++ b/phone/src/os/sound/providers/SoundProvider.tsx @@ -7,12 +7,7 @@ interface IMountResponse { } interface ISoundContext { - mount( - url: string, - volume?: number, - loop?: boolean, - autoplay?: boolean, - ): Promise; + mount(url: string, volume?: number, loop?: boolean, autoplay?: boolean): Promise; play(url?: string, volume?: number, loop?: boolean): void; stop(url: string): void; remove(url: string): boolean; @@ -31,55 +26,47 @@ export const SoundProvider = ({ children }: { children: React.ReactNode }) => { soundRefs.current = new Map(); }, []); - const mount = useCallback( - ( - url: string, - volume: number = 1, - loop: boolean = false, - autoplay: boolean = false, - ) => { - return new Promise((res) => { - if (!soundRefs.current) { - soundRefs.current = new Map(); + const mount = useCallback((url: string, volume: number = 1, loop: boolean = false, autoplay: boolean = false) => { + return new Promise((res) => { + if (!soundRefs.current) { + soundRefs.current = new Map(); + } + + const find = soundRefs.current.get(url); + + if (find) { + find.howl.volume(volume); + find.howl.loop(loop); + if (autoplay) { + find.howl.play(); } + return res({ howl: find.howl, url }); + } - const find = soundRefs.current.get(url); - - if (find) { - find.howl.volume(volume); - find.howl.loop(loop); - if (autoplay) { - find.howl.play(); - } - return res({ howl: find.howl, url }); - } - - const instance = new Howl({ - src: url, - loop, - volume, - autoplay, - }); - - soundRefs.current.set(url, { howl: instance, volume }); - - instance.once('load', () => { - console.log('ready', instance); - res({ howl: instance, url }); - }); - - const onError = (_id, e) => { - res(null); - console.error('Howler Error \n', e, '\nid: ', _id, '\nsrc: ', url); - }; - - instance.once('loaderror', onError); - - instance.once('playerror', onError); + const instance = new Howl({ + src: url, + loop, + volume, + autoplay, }); - }, - [], - ); + + soundRefs.current.set(url, { howl: instance, volume }); + + instance.once('load', () => { + console.log('ready', instance); + res({ howl: instance, url }); + }); + + const onError = (_id, e) => { + res(null); + console.error('Howler Error \n', e, '\nid: ', _id, '\nsrc: ', url); + }; + + instance.once('loaderror', onError); + + instance.once('playerror', onError); + }); + }, []); const play = useCallback( (url: string, volume: number, loop: boolean) => { @@ -167,9 +154,7 @@ export const SoundProvider = ({ children }: { children: React.ReactNode }) => { }, []); return ( - + {children} ); diff --git a/phone/src/os/sound/utils/getSoundSettings.ts b/phone/src/os/sound/utils/getSoundSettings.ts index c94d443..6493bf4 100644 --- a/phone/src/os/sound/utils/getSoundSettings.ts +++ b/phone/src/os/sound/utils/getSoundSettings.ts @@ -1,8 +1,5 @@ import { IPhoneSettings } from '../../../apps/settings/hooks/useSettings'; -import { - getNotificationPath, - getRingtonePath, -} from '../../../apps/settings/utils/getRingtonePath'; +import { getNotificationPath, getRingtonePath } from '../../../apps/settings/utils/getRingtonePath'; const getPath = { ringtone: getRingtonePath, @@ -12,11 +9,7 @@ const getPath = { /** * Gets the configuration for SoundProvider based on settings and apps */ -export const getSoundSettings = ( - type: 'ringtone' | 'notification', - settings: IPhoneSettings, - app?: string, -) => { +export const getSoundSettings = (type: 'ringtone' | 'notification', settings: IPhoneSettings, app?: string) => { try { return app ? { diff --git a/phone/src/ui/components/AppContent.tsx b/phone/src/ui/components/AppContent.tsx index 579c2f3..ac668b8 100644 --- a/phone/src/ui/components/AppContent.tsx +++ b/phone/src/ui/components/AppContent.tsx @@ -23,23 +23,13 @@ const useStyles = makeStyles(() => ({ }, })); -export const AppContent = ({ - children, - style, - backdrop, - onClickBackdrop, - ...props -}: AppContentTypes & BoxProps) => { +export const AppContent = ({ children, style, backdrop, onClickBackdrop, ...props }: AppContentTypes & BoxProps) => { const classes = useStyles(); return ( - + {children} diff --git a/phone/src/ui/components/AppIcon.tsx b/phone/src/ui/components/AppIcon.tsx index 2e92c55..085720e 100644 --- a/phone/src/ui/components/AppIcon.tsx +++ b/phone/src/ui/components/AppIcon.tsx @@ -5,38 +5,28 @@ import { green } from '@material-ui/core/colors'; import { Badge, Button, Tooltip, Zoom } from '@material-ui/core'; import { useTranslation } from 'react-i18next'; -const useStyles = makeStyles( - (theme) => ({ - root: { - padding: 0, - marginTop: theme.spacing(3), +const useStyles = makeStyles((theme) => ({ + root: { + padding: 0, + marginTop: theme.spacing(3), + }, + avatar: { + '&:hover': { + backgroundColor: ({ backgroundColor }) => darken(backgroundColor, 0.1), }, - avatar: { - '&:hover': { - backgroundColor: ({ backgroundColor }) => darken(backgroundColor, 0.1), - }, - backgroundColor: ({ backgroundColor }) => backgroundColor, - color: ({ color }) => color, - boxShadow: theme.shadows[2], - width: theme.spacing(8), - height: theme.spacing(8), - fontSize: theme.typography.h4.fontSize, - }, - tooltip: { - fontSize: 12, - }, - }), -); + backgroundColor: ({ backgroundColor }) => backgroundColor, + color: ({ color }) => color, + boxShadow: theme.shadows[2], + width: theme.spacing(8), + height: theme.spacing(8), + fontSize: theme.typography.h4.fontSize, + }, + 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], @@ -53,11 +43,7 @@ export const AppIcon = ({ TransitionComponent={Zoom} > diff --git a/phone/src/ui/components/AppTitle.tsx b/phone/src/ui/components/AppTitle.tsx index 975a2d4..f3274ef 100644 --- a/phone/src/ui/components/AppTitle.tsx +++ b/phone/src/ui/components/AppTitle.tsx @@ -28,11 +28,7 @@ const useStyle = makeStyles( ); // Taso: Maybe we should pass an icon (maybe fa?) as a prop as well at somepoint // but need to think about the best way to do that for standardization sake. -export const AppTitle = ({ - app: { backgroundColor, color, nameLocale }, - variant = 'h5', - ...props -}: IProps) => { +export const AppTitle = ({ app: { backgroundColor, color, nameLocale }, variant = 'h5', ...props }: IProps) => { const classes = useStyle({ color, backgroundColor }); const { t } = useTranslation(); return ( diff --git a/phone/src/ui/components/AppWrapper.tsx b/phone/src/ui/components/AppWrapper.tsx index 7b9b84d..82fb7bd 100644 --- a/phone/src/ui/components/AppWrapper.tsx +++ b/phone/src/ui/components/AppWrapper.tsx @@ -1,12 +1,7 @@ import React from 'react'; import { AppWrapperTypes } from '../interface/InterfaceUI'; -export const AppWrapper = ({ - children, - style, - handleClickAway, - ...props -}: AppWrapperTypes) => { +export const AppWrapper = ({ children, style, handleClickAway, ...props }: AppWrapperTypes) => { return (
- `1px solid ${fade(theme.palette[color].main, 0.5)}`, + border: ({ color }: IStatusButtonStyleProps) => `1px solid ${fade(theme.palette[color].main, 0.5)}`, '&:hover': { - border: ({ color }: IStatusButtonStyleProps) => - `1px solid ${theme.palette[color].main}`, + border: ({ color }: IStatusButtonStyleProps) => `1px solid ${theme.palette[color].main}`, }, '&$disabled': { border: `1px solid ${theme.palette.action.disabled}`, @@ -31,8 +29,7 @@ const useStyles = makeStyles( color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText, backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main, '&:hover': { - backgroundColor: ({ color }: IStatusButtonStyleProps) => - theme.palette[color].dark, + backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].dark, }, }, }), @@ -46,11 +43,5 @@ export const StatusButton = ({ ...props }: Omit & { color: StatusButtonStyleColor }) => { const classes = useStyles({ color }); - return ( -