Feat(Sellout): Base app

This commit is contained in:
chip committed 2020-10-10 22:20:03 +02:00
1 parent 9e09ce8879
commit 2112bb5555
13 files changed
+307

No files matched your search

@@ -0,0 +1,81 @@
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";
const useStyles = makeStyles((theme) => ({
root: {
overflowX: "hidden",
display: "flex",
flexFlow: "row nowrap",
alignItems: "flex-start",
width: "100%",
marginTop: "3px",
},
content: {
display: "flex",
marginTop: "-10px",
flexFlow: "column nowrap",
width: "100%",
},
paper: {
overflow: "auto",
display: "flex",
flexFlow: "column",
alignItems: "flex",
height: "auto",
background: "#232323",
marginBottom: 20,
},
header: {
margin: 10,
},
headerTypo: {
margin: 5,
},
desc: {
padding: 10,
},
}));
export const SelloutItem = (listing) => {
const classes = useStyles();
return (
<ListItem className={classes.root}>
<div className={classes.content}>
<Paper elevation={2} className={classes.paper}>
<div className={classes.header}>
<Typography className={classes.headerTypo} variant="h5">
{listing.name}
</Typography>
<Typography
className={classes.headerTypo}
style={{ borderBottom: "1px solid #f44336" }}
>
{listing.number}
</Typography>
</div>
<ImageDisplay imgURL={listing.img} />
<Typography variant="h7" className={classes.desc}>
{listing.description}
</Typography>
<div className={classes.postActions}>
<Button>
<ChatIcon style={{ color: "#f44336" }} />
</Button>
<Button>
<PhoneIcon style={{ color: "#f44336" }} />
</Button>
</div>
</Paper>
</div>
</ListItem>
);
};
@@ -0,0 +1,13 @@
import React from "react";
import { List } from "../../../../ui/components/List";
import { SelloutItem } from "./SelloutItem";
export const SelloutList = ({ listings }) => {
return (
<List>
{listings.map((listing) => (
<SelloutItem key={listing.id} {...listing} />
))}
</List>
);
};
@@ -0,0 +1,8 @@
import React from "react";
import { useListing } from "../../hooks/useListing";
import { SelloutList } from "./SelloutList";
export const SelloutListContainer = () => {
const { listing } = useListing();
return <SelloutList listings={listing} />;
};