Create shared Picture components and use them in sellout app

This commit is contained in:
J Francisco Rader committed 2021-01-24 14:42:15 -05:00
1 parent bdadf052c5
commit 6de92e3a7a
5 files changed
+71 -13

No files matched your search

@@ -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) => {
</Typography>
</div>
{listing.url ? (
<ImageDisplay imgURL={listing.url} />
<PictureResponsive
src={listing.url}
alt={`${listing.name} image`}
/>
) : (
<Typography style={{ margin: 10 }}>
No image provided{' '}
@@ -1,11 +0,0 @@
import React from 'react';
export const ImageDisplay = ({ imgURL }) => {
return (
<img
src={imgURL}
alt='twitter display'
style={{ height: 200, width: 350, margin: 'auto' }}
/>
);
};