From bdadf052c571d78771f9191c30a6bf69a60884bb Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Sun, 24 Jan 2021 13:26:34 -0500 Subject: [PATCH 1/3] Housekeeping :D --- phone/src/apps/settings/components/SettingItem.tsx | 5 +---- phone/src/apps/settings/components/SettingsApp.tsx | 2 +- phone/src/ui/components/Notification.tsx | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/phone/src/apps/settings/components/SettingItem.tsx b/phone/src/apps/settings/components/SettingItem.tsx index 81a00ef..c76d834 100644 --- a/phone/src/apps/settings/components/SettingItem.tsx +++ b/phone/src/apps/settings/components/SettingItem.tsx @@ -5,7 +5,6 @@ import { Divider, ListItemIcon, } from '@material-ui/core'; -import { SvgIconProps } from '@material-ui/core'; interface IProps { options?: any; @@ -13,7 +12,6 @@ interface IProps { value?: string | null; onClick?: any; icon: JSX.Element; - disabled?: boolean; } export const SettingItem = ({ @@ -21,8 +19,7 @@ export const SettingItem = ({ label, value, onClick, - icon, - disabled, + icon }: IProps) => { if (!onClick) return ( diff --git a/phone/src/apps/settings/components/SettingsApp.tsx b/phone/src/apps/settings/components/SettingsApp.tsx index 3c8fe0a..7cef04b 100644 --- a/phone/src/apps/settings/components/SettingsApp.tsx +++ b/phone/src/apps/settings/components/SettingsApp.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import { AppWrapper } from '../../../ui/components'; import { AppTitle } from '../../../ui/components/AppTitle'; import { AppContent } from '../../../ui/components/AppContent'; diff --git a/phone/src/ui/components/Notification.tsx b/phone/src/ui/components/Notification.tsx index e22689c..12775ab 100644 --- a/phone/src/ui/components/Notification.tsx +++ b/phone/src/ui/components/Notification.tsx @@ -3,7 +3,6 @@ import Paper from '@material-ui/core/Paper'; import Snackbar from '@material-ui/core/Snackbar'; import Fade from '@material-ui/core/Fade'; import { makeStyles } from '@material-ui/core/styles'; -import { useSettings } from '../../apps/settings/hooks/useSettings'; import { usePhone } from '../../os/phone/hooks/usePhone'; const useStyles = makeStyles({ @@ -19,7 +18,6 @@ const useStyles = makeStyles({ function Notification({ children, handleClose, open }) { const classes = useStyles(); - const [settings] = useSettings(); const { config } = usePhone(); if (!config) return null; From 6de92e3a7a983fb84c3fd99036c61d69fe8a4039 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Sun, 24 Jan 2021 14:42:15 -0500 Subject: [PATCH 2/3] Create shared Picture components and use them in sellout app --- .../components/SelloutList/SelloutItem.tsx | 7 ++++-- .../components/images/ImageDisplay.tsx | 11 -------- phone/src/ui/components/Picture.tsx | 25 +++++++++++++++++++ phone/src/ui/components/PictureResponsive.tsx | 18 +++++++++++++ phone/src/ui/components/PictureThumbnail.tsx | 23 +++++++++++++++++ 5 files changed, 71 insertions(+), 13 deletions(-) delete mode 100644 phone/src/apps/sellout/components/images/ImageDisplay.tsx create mode 100644 phone/src/ui/components/Picture.tsx create mode 100644 phone/src/ui/components/PictureResponsive.tsx create mode 100644 phone/src/ui/components/PictureThumbnail.tsx diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx index 2407704..da8a857 100644 --- a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx +++ b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import { Button, Typography, Paper } from '@material-ui/core'; -import { ImageDisplay } from '../images/ImageDisplay'; import { ListItem } from '../../../../ui/components/ListItem'; import ChatIcon from '@material-ui/icons/Chat'; import PhoneIcon from '@material-ui/icons/Phone'; +import { PictureResponsive } from '../../../../ui/components/PictureResponsive'; const useStyles = makeStyles((theme) => ({ root: { @@ -62,7 +62,10 @@ export const SelloutItem = (listing) => { {listing.url ? ( - + ) : ( No image provided{' '} diff --git a/phone/src/apps/sellout/components/images/ImageDisplay.tsx b/phone/src/apps/sellout/components/images/ImageDisplay.tsx deleted file mode 100644 index d8c0fa8..0000000 --- a/phone/src/apps/sellout/components/images/ImageDisplay.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -export const ImageDisplay = ({ imgURL }) => { - return ( - twitter display - ); -}; diff --git a/phone/src/ui/components/Picture.tsx b/phone/src/ui/components/Picture.tsx new file mode 100644 index 0000000..6fa45fd --- /dev/null +++ b/phone/src/ui/components/Picture.tsx @@ -0,0 +1,25 @@ +import React, { useState } from 'react'; +import { Button } from '@material-ui/core'; +import { PictureThumbnail } from './PictureThumbnail'; +import { PictureResponsive } from './PictureResponsive'; +import Modal from './Modal'; + +interface IProps { + src: string; + alt: string; + size?: string; +} + +export const Picture = ({ src, alt, size }: IProps) => { + const [visible, setVisible] = useState(false); + return ( + <> + + setVisible(false)}> + + + + ); +}; diff --git a/phone/src/ui/components/PictureResponsive.tsx b/phone/src/ui/components/PictureResponsive.tsx new file mode 100644 index 0000000..d25ee0d --- /dev/null +++ b/phone/src/ui/components/PictureResponsive.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core'; + +interface IProps { + src: string, + alt: string +} + +const useStyles = makeStyles({ + root: { + width: '100%', + objectFit: 'contain' + } +}); + +export const PictureResponsive = ({ src, alt }: IProps) => { + return {alt}; +}; diff --git a/phone/src/ui/components/PictureThumbnail.tsx b/phone/src/ui/components/PictureThumbnail.tsx new file mode 100644 index 0000000..0d7a90b --- /dev/null +++ b/phone/src/ui/components/PictureThumbnail.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +import { makeStyles, Theme } from '@material-ui/core'; + +interface IStyleProps { + size: string; +} + +interface IProps { + src: string, + alt: string, + size?: string +} + +const useStyles = makeStyles({ + root: ({ size }) => ({ + objectFit: 'contain', + width: size, + }), +}); + +export const PictureThumbnail = ({ src, alt, size = '3em' }: IProps) => { + return {alt}; +}; From e0f9cc193b5ba1bc0efecf7c080faf56c7ff76ad Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Sun, 24 Jan 2021 14:45:00 -0500 Subject: [PATCH 3/3] Fix shit --- phone/src/ui/components/Picture.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phone/src/ui/components/Picture.tsx b/phone/src/ui/components/Picture.tsx index 6fa45fd..26cc9a7 100644 --- a/phone/src/ui/components/Picture.tsx +++ b/phone/src/ui/components/Picture.tsx @@ -15,7 +15,7 @@ export const Picture = ({ src, alt, size }: IProps) => { return ( <> setVisible(false)}>