mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Prettified Code!
This commit is contained in:
1 parent
361a8ac6eb
commit
d443b794c3
15 files changed
+204
-192
No files matched your search
+3
-2
@@ -227,14 +227,15 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
description: 'Selling this cool car',
|
description: 'Selling this cool car',
|
||||||
url: 'https://i.imgur.com/ROmGTwi.jpeg',
|
url: 'https://i.imgur.com/ROmGTwi.jpeg',
|
||||||
price: 400,
|
price: 400,
|
||||||
posted: '1/9/2021'
|
posted: '1/9/2021',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'Some other dude',
|
name: 'Some other dude',
|
||||||
number: '666-6666',
|
number: '666-6666',
|
||||||
title: 'Material',
|
title: 'Material',
|
||||||
description: 'Selling my wife olsdfjsdfk jfksdaj kasjfksf jdkasf jklasf jasklf jaskf',
|
description:
|
||||||
|
'Selling my wife olsdfjsdfk jfksdaj kasjfksf jdkasf jklasf jasklf jaskf',
|
||||||
url: '',
|
url: '',
|
||||||
price: 30,
|
price: 30,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { AppWrapper } from "../../../ui/components/AppWrapper";
|
import { AppWrapper } from '../../../ui/components/AppWrapper';
|
||||||
import { AppContent } from "../../../ui/components/AppContent";
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
import { SelloutTitle } from "./SelloutTitle";
|
import { SelloutTitle } from './SelloutTitle';
|
||||||
import { SelloutListContainer } from "./SelloutList/SelloutListContainer";
|
import { SelloutListContainer } from './SelloutList/SelloutListContainer';
|
||||||
|
|
||||||
import "./Sellout.css";
|
import './Sellout.css';
|
||||||
import {ListingForm} from "./form/ListingForm";
|
import { ListingForm } from './form/ListingForm';
|
||||||
import ItemModal from "./modal/ItemModal";
|
import ItemModal from './modal/ItemModal';
|
||||||
|
|
||||||
export const SelloutApp = () => {
|
export const SelloutApp = () => {
|
||||||
return (
|
return (
|
||||||
<AppWrapper id="sellout-app">
|
<AppWrapper id='sellout-app'>
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<ListingForm />
|
<ListingForm />
|
||||||
<SelloutListContainer />
|
<SelloutListContainer />
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { Button, Typography, Paper } from "@material-ui/core";
|
import { Button, Typography, Paper } from '@material-ui/core';
|
||||||
import { ListItem } from "../../../../ui/components/ListItem";
|
import { ListItem } from '../../../../ui/components/ListItem';
|
||||||
import { useItemModal } from "../../hooks/useItemModal";
|
import { useItemModal } from '../../hooks/useItemModal';
|
||||||
import { useListingDetails } from "../../hooks/useListingDetails";
|
import { useListingDetails } from '../../hooks/useListingDetails';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
overflowX: "hidden",
|
overflowX: 'hidden',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexFlow: "row nowrap",
|
flexFlow: 'row nowrap',
|
||||||
alignItems: "flex-start",
|
alignItems: 'flex-start',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
marginTop: "5px",
|
marginTop: '5px',
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
marginTop: "-5px",
|
marginTop: '-5px',
|
||||||
flexFlow: "column nowrap",
|
flexFlow: 'column nowrap',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
borderRadius: 15,
|
borderRadius: 15,
|
||||||
overflow: "auto",
|
overflow: 'auto',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
color: '#292929',
|
color: '#292929',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
height: "auto",
|
height: 'auto',
|
||||||
background: "#fff",
|
background: '#fff',
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
boxShadow: '0px 0px 5px 0px rgba(0,0,0,0.75)'
|
boxShadow: '0px 0px 5px 0px rgba(0,0,0,0.75)',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
margin: 5,
|
margin: 5,
|
||||||
@@ -47,62 +47,65 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
imageSection: {
|
imageSection: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
},
|
},
|
||||||
listingImage: {
|
listingImage: {},
|
||||||
|
|
||||||
},
|
|
||||||
price: {
|
price: {
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
paddingLeft: '10px',
|
paddingLeft: '10px',
|
||||||
fontFamily: "'Libre Franklin', sans-serif",
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
|
|
||||||
},
|
},
|
||||||
readMoreBtn: {
|
readMoreBtn: {
|
||||||
background: '#FF9472',
|
background: '#FF9472',
|
||||||
paddingLeft: '10px',
|
paddingLeft: '10px',
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
background: '#FE9485'
|
background: '#FE9485',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SelloutItem = (listing) => {
|
export const SelloutItem = (listing) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const { setItemModal } = useItemModal()
|
const { setItemModal } = useItemModal();
|
||||||
const { setDetails } = useListingDetails();
|
const { setDetails } = useListingDetails();
|
||||||
|
|
||||||
const handleOpenListing = (listing) => {
|
const handleOpenListing = (listing) => {
|
||||||
setDetails(listing)
|
setDetails(listing);
|
||||||
setItemModal(true)
|
setItemModal(true);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem className={classes.root}>
|
<ListItem className={classes.root}>
|
||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<Paper elevation={2} className={classes.paper}>
|
<Paper elevation={2} className={classes.paper}>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
<Typography variant="h5" style={{ padding: '5px 0px 0px 10px', }}>
|
<Typography variant='h5' style={{ padding: '5px 0px 0px 10px' }}>
|
||||||
{listing.title}
|
{listing.title}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="h6" className={classes.desc}>
|
<Typography variant='h6' className={classes.desc}>
|
||||||
{listing.description.slice(0, 30)}...
|
{listing.description.slice(0, 30)}...
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="h6" className={classes.price}>
|
<Typography variant='h6' className={classes.price}>
|
||||||
${listing.price}
|
${listing.price}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button className={classes.readMoreBtn} onClick={() => handleOpenListing(listing)}>
|
<Button
|
||||||
|
className={classes.readMoreBtn}
|
||||||
|
onClick={() => handleOpenListing(listing)}
|
||||||
|
>
|
||||||
Read more
|
Read more
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.imageSection}>
|
<div className={classes.imageSection}>
|
||||||
<div className={classes.listingImage} style={{
|
<div
|
||||||
|
className={classes.listingImage}
|
||||||
|
style={{
|
||||||
backgroundImage: `url(${listing.url})`,
|
backgroundImage: `url(${listing.url})`,
|
||||||
backgroundPosition: 'center',
|
backgroundPosition: 'center',
|
||||||
backgroundSize: 'cover',
|
backgroundSize: 'cover',
|
||||||
backgroundRepeat: 'no-repeat',
|
backgroundRepeat: 'no-repeat',
|
||||||
width: '150px',
|
width: '150px',
|
||||||
height: '150px'
|
height: '150px',
|
||||||
}} />
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Paper>
|
</Paper>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { List } from "../../../../ui/components/List";
|
import { List } from '../../../../ui/components/List';
|
||||||
import SelloutSearch from "../search/SelloutSearch";
|
import SelloutSearch from '../search/SelloutSearch';
|
||||||
import { SelloutItem } from "./SelloutItem";
|
import { SelloutItem } from './SelloutItem';
|
||||||
|
|
||||||
export const SelloutList = ({ listings }) => {
|
export const SelloutList = ({ listings }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,35 +1,31 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { useListing } from "../../hooks/useListing";
|
import { useListing } from '../../hooks/useListing';
|
||||||
import { SelloutList } from "./SelloutList";
|
import { SelloutList } from './SelloutList';
|
||||||
import SelloutSearch from "../search/SelloutSearch"
|
import SelloutSearch from '../search/SelloutSearch';
|
||||||
import {useListingModal} from "../../hooks/useListingModal";
|
import { useListingModal } from '../../hooks/useListingModal';
|
||||||
|
|
||||||
import { makeStyles, Theme } from "@material-ui/core/styles";
|
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||||
import { useItemModal } from "../../hooks/useItemModal";
|
import { useItemModal } from '../../hooks/useItemModal';
|
||||||
import ItemModal from "../modal/ItemModal";
|
import ItemModal from '../modal/ItemModal';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
hidden: {
|
hidden: {
|
||||||
display: 'none'
|
display: 'none',
|
||||||
},
|
},
|
||||||
show: {
|
show: {
|
||||||
display: 'block'
|
display: 'block',
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
export const SelloutListContainer = () => {
|
export const SelloutListContainer = () => {
|
||||||
const { modal } = useListingModal()
|
const { modal } = useListingModal();
|
||||||
const { itemModal } = useItemModal();
|
const { itemModal } = useItemModal();
|
||||||
const listing = useListing();
|
const listing = useListing();
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<div className={modal ? classes.hidden : classes.show}>
|
<div className={modal ? classes.hidden : classes.show}>
|
||||||
{itemModal ? (
|
{itemModal ? <ItemModal /> : <SelloutList listings={listing} />}
|
||||||
<ItemModal />
|
|
||||||
): (
|
|
||||||
<SelloutList listings={listing} />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
};
|
};
|
||||||
@@ -2,29 +2,29 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
|
|||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
root: {
|
root: {
|
||||||
overflowX: "hidden",
|
overflowX: 'hidden',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexFlow: "row nowrap",
|
flexFlow: 'row nowrap',
|
||||||
alignItems: "flex-start",
|
alignItems: 'flex-start',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
marginTop: "5px",
|
marginTop: '5px',
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
marginTop: "-5px",
|
marginTop: '-5px',
|
||||||
flexFlow: "column nowrap",
|
flexFlow: 'column nowrap',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
borderRadius: 15,
|
borderRadius: 15,
|
||||||
overflow: "auto",
|
overflow: 'auto',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
color: '#292929',
|
color: '#292929',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
height: "auto",
|
height: 'auto',
|
||||||
background: "#fff",
|
background: '#fff',
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
boxShadow: '0px 0px 5px 0px rgba(0,0,0,0.75)'
|
boxShadow: '0px 0px 5px 0px rgba(0,0,0,0.75)',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
margin: 5,
|
margin: 5,
|
||||||
@@ -42,9 +42,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
imageSection: {
|
imageSection: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
},
|
},
|
||||||
listingImage: {
|
listingImage: {},
|
||||||
|
}));
|
||||||
},
|
|
||||||
}))
|
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
@@ -1,54 +1,54 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from 'react';
|
||||||
import { makeStyles, Button, TextField, InputBase } from "@material-ui/core";
|
import { makeStyles, Button, TextField, InputBase } from '@material-ui/core';
|
||||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
import CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
|
|
||||||
import "../Sellout.css"
|
import '../Sellout.css';
|
||||||
import {useListingModal} from "../../hooks/useListingModal";
|
import { useListingModal } from '../../hooks/useListingModal';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
backgroundColor: '#F9F9F9',
|
backgroundColor: '#F9F9F9',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
textAlign: "center",
|
textAlign: 'center',
|
||||||
fontFamily: "'Libre Franklin', sans-serif"
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
},
|
},
|
||||||
hidden: {
|
hidden: {
|
||||||
display: 'none'
|
display: 'none',
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
fontFamily: "'Libre Franklin', sans-serif"
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
},
|
},
|
||||||
textFieldInput: {
|
textFieldInput: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
background: "#EBEBEB",
|
background: '#EBEBEB',
|
||||||
color: '#272727',
|
color: '#272727',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
textIndent: 3,
|
textIndent: 3,
|
||||||
borderRadius: 15,
|
borderRadius: 15,
|
||||||
padding: 15,
|
padding: 15,
|
||||||
fontFamily: "'Libre Franklin', sans-serif"
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
},
|
},
|
||||||
multilineFieldInput: {
|
multilineFieldInput: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
background: "#EBEBEB",
|
background: '#EBEBEB',
|
||||||
borderRadius: 15,
|
borderRadius: 15,
|
||||||
fontFamily: "'Libre Franklin', sans-serif",
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
color: '#272727',
|
color: '#272727',
|
||||||
textIndent: 3,
|
textIndent: 3,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
padding: 15
|
padding: 15,
|
||||||
},
|
},
|
||||||
postButton: {
|
postButton: {
|
||||||
display: "block",
|
display: 'block',
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
background: "#f44336",
|
background: '#f44336',
|
||||||
width: "80%",
|
width: '80%',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@@ -56,68 +56,70 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const ListingForm = () => {
|
export const ListingForm = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const { modal, setModal } = useListingModal()
|
const { modal, setModal } = useListingModal();
|
||||||
|
|
||||||
const [ title, setTitle ] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
const [ url, setUrl ] = useState('');
|
const [url, setUrl] = useState('');
|
||||||
const [ description, setDescription ] = useState('');
|
const [description, setDescription] = useState('');
|
||||||
|
|
||||||
const addListing = () => {
|
const addListing = () => {
|
||||||
Nui.send('phone:addListing', {
|
Nui.send('phone:addListing', {
|
||||||
title,
|
title,
|
||||||
url,
|
url,
|
||||||
description
|
description,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setModal(false)
|
setModal(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={modal ? classes.root : classes.hidden}>
|
<div className={modal ? classes.root : classes.hidden}>
|
||||||
<h1 style={{ color: '#272727' }}>New Listing</h1>
|
<h1 style={{ color: '#272727' }}>New Listing</h1>
|
||||||
<InputBase
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
onChange={e => setTitle(e.target.value)}
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
placeholder="Title"
|
placeholder='Title'
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputBase
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Category"
|
placeholder='Category'
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputBase
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Image or URL link"
|
placeholder='Image or URL link'
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputBase
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Price"
|
placeholder='Price'
|
||||||
onChange={e => setUrl(e.target.value)}
|
onChange={(e) => setUrl(e.target.value)}
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputBase
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
onChange={e => setDescription(e.target.value)}
|
onChange={(e) => setDescription(e.target.value)}
|
||||||
placeholder="Description"
|
placeholder='Description'
|
||||||
inputProps={{ className: classes.multilineFieldInput }}
|
inputProps={{ className: classes.multilineFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
multiline
|
multiline
|
||||||
rows={3}
|
rows={3}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button onClick={addListing} className={classes.postButton}>Post</Button>
|
<Button onClick={addListing} className={classes.postButton}>
|
||||||
|
Post
|
||||||
|
</Button>
|
||||||
<div>
|
<div>
|
||||||
<Button onClick={closeModal}>
|
<Button onClick={closeModal}>
|
||||||
<h3 style={{ color: '#272727' }}>Cancel</h3>
|
<h3 style={{ color: '#272727' }}>Cancel</h3>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react';
|
||||||
import { Button, Typography } from '@material-ui/core';
|
import { Button, Typography } from '@material-ui/core';
|
||||||
import { useItemModal } from '../../hooks/useItemModal';
|
import { useItemModal } from '../../hooks/useItemModal';
|
||||||
import { useListingDetails } from '../../hooks/useListingDetails'
|
import { useListingDetails } from '../../hooks/useListingDetails';
|
||||||
import useStyles from './modal.styles';
|
import useStyles from './modal.styles';
|
||||||
import CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
||||||
@@ -11,12 +11,12 @@ export default function ItemModal() {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const { details, setDetails } = useListingDetails();
|
const { details, setDetails } = useListingDetails();
|
||||||
const { itemModal, setItemModal} = useItemModal();
|
const { itemModal, setItemModal } = useItemModal();
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setDetails(null);
|
setDetails(null);
|
||||||
setItemModal(false);
|
setItemModal(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={itemModal ? classes.root : classes.hidden}>
|
<div className={itemModal ? classes.root : classes.hidden}>
|
||||||
@@ -26,39 +26,52 @@ export default function ItemModal() {
|
|||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${details.url})`,
|
backgroundImage: `url(${details.url})`,
|
||||||
backgroundSize: 'cover',
|
backgroundSize: 'cover',
|
||||||
backgroundPosition: 'center'
|
backgroundPosition: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<button onClick={handleClose} className={classes.closeButton}>{<CloseIcon />}</button>
|
<button onClick={handleClose} className={classes.closeButton}>
|
||||||
|
{<CloseIcon />}
|
||||||
|
</button>
|
||||||
<div>
|
<div>
|
||||||
<button className={classes.editButton}>EDIT {<ExpandMoreIcon />}</button>
|
<button className={classes.editButton}>
|
||||||
|
EDIT {<ExpandMoreIcon />}
|
||||||
|
</button>
|
||||||
<span className={classes.category}>{details.category}</span>
|
<span className={classes.category}>{details.category}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<div className={classes.titleSection}>
|
<div className={classes.titleSection}>
|
||||||
<Typography className={classes.listingTitle}>{details.title}</Typography>
|
<Typography className={classes.listingTitle}>
|
||||||
|
{details.title}
|
||||||
|
</Typography>
|
||||||
<span className={classes.priceContainer}>${details.price}</span>
|
<span className={classes.priceContainer}>${details.price}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={classes.metaContainer}>
|
<div className={classes.metaContainer}>
|
||||||
<div className={classes.metaSection}>
|
<div className={classes.metaSection}>
|
||||||
<Typography className={classes.metaDetail}><span style={{ color: '#504F4F' }}>Author:</span> {details.name}</Typography>
|
<Typography className={classes.metaDetail}>
|
||||||
|
<span style={{ color: '#504F4F' }}>Author:</span> {details.name}
|
||||||
|
</Typography>
|
||||||
|
|
||||||
<Typography className={classes.metaDetail}><span style={{ color: '#504F4F' }}>Category:</span> {details.category}</Typography>
|
<Typography className={classes.metaDetail}>
|
||||||
|
<span style={{ color: '#504F4F' }}>Category:</span>{' '}
|
||||||
|
{details.category}
|
||||||
|
</Typography>
|
||||||
|
|
||||||
<Typography className={classes.metaDetail}><span style={{ color: '#504F4F' }}>Posted:</span> {details.posted}</Typography>
|
<Typography className={classes.metaDetail}>
|
||||||
|
<span style={{ color: '#504F4F' }}>Posted:</span> {details.posted}
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={classes.descContianer}>
|
<div className={classes.descContianer}>
|
||||||
<h2 style={{ color: '#000', fontWeight: 500 }}>Listing Description</h2>
|
<h2 style={{ color: '#000', fontWeight: 500 }}>
|
||||||
|
Listing Description
|
||||||
|
</h2>
|
||||||
<p style={{ float: 'left' }}>{details.description}</p>
|
<p style={{ float: 'left' }}>{details.description}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme ) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
root: {
|
root: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
backgroundColor: '#F9F9F9',
|
backgroundColor: '#F9F9F9',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
textAlign: "center",
|
textAlign: 'center',
|
||||||
fontFamily: "'Libre Franklin', sans-serif"
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
},
|
},
|
||||||
hidden: {
|
hidden: {
|
||||||
display: 'none'
|
display: 'none',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
background: 'red',
|
background: 'red',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '30%'
|
height: '30%',
|
||||||
},
|
},
|
||||||
closeButton: {
|
closeButton: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@@ -32,9 +32,8 @@ const useStyles = makeStyles((theme: Theme ) => ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
borderRadius: 50,
|
borderRadius: 50,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
background: '#fff'
|
background: '#fff',
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
editButton: {
|
editButton: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@@ -96,17 +95,17 @@ const useStyles = makeStyles((theme: Theme ) => ({
|
|||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontFamily: "'Libre Franklin', sans-serif",
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
marginTop: 35,
|
marginTop: 35,
|
||||||
padding: 5
|
padding: 5,
|
||||||
},
|
},
|
||||||
metaContainer: {
|
metaContainer: {
|
||||||
width: '90%',
|
width: '90%',
|
||||||
marginTop: '3em'
|
marginTop: '3em',
|
||||||
},
|
},
|
||||||
metaSection: {
|
metaSection: {
|
||||||
display: 'block',
|
display: 'block',
|
||||||
width: '90%',
|
width: '90%',
|
||||||
paddingBottom: 5,
|
paddingBottom: 5,
|
||||||
borderBottom: '2px solid #838383'
|
borderBottom: '2px solid #838383',
|
||||||
},
|
},
|
||||||
metaDetail: {
|
metaDetail: {
|
||||||
color: '#000',
|
color: '#000',
|
||||||
@@ -117,8 +116,8 @@ const useStyles = makeStyles((theme: Theme ) => ({
|
|||||||
descContianer: {
|
descContianer: {
|
||||||
float: 'left',
|
float: 'left',
|
||||||
fontSize: '18',
|
fontSize: '18',
|
||||||
color: '#504F4F'
|
color: '#504F4F',
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
import React, {useState} from 'react';
|
import React, { useState } from 'react';
|
||||||
import {TextField, Button, InputBase} from '@material-ui/core';
|
import { TextField, Button, InputBase } from '@material-ui/core';
|
||||||
import useStyles from './search.styles';
|
import useStyles from './search.styles';
|
||||||
|
|
||||||
import AddIcon from '@material-ui/icons/Add';
|
import AddIcon from '@material-ui/icons/Add';
|
||||||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
||||||
import SearchIcon from "@material-ui/icons/Search";
|
import SearchIcon from '@material-ui/icons/Search';
|
||||||
import {useListingModal} from "../../hooks/useListingModal";
|
import { useListingModal } from '../../hooks/useListingModal';
|
||||||
|
|
||||||
const SelloutSearch = () => {
|
const SelloutSearch = () => {
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('');
|
||||||
|
|
||||||
const { modal, setModal } = useListingModal();
|
const { modal, setModal } = useListingModal();
|
||||||
|
|
||||||
const handleModal = () => {
|
const handleModal = () => {
|
||||||
setModal(true)
|
setModal(true);
|
||||||
}
|
};
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
@@ -45,7 +45,7 @@ const SelloutSearch = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default SelloutSearch;
|
export default SelloutSearch;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import {fade, makeStyles, Theme} from '@material-ui/core/styles';
|
import { fade, makeStyles, Theme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
headerTitle: {
|
headerTitle: {
|
||||||
@@ -11,13 +11,14 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
searchContainer: {
|
searchContainer: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
textAlign: "center",
|
textAlign: 'center',
|
||||||
height: 250,
|
height: 250,
|
||||||
background: 'linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(242,112,156,1) 0%, rgba(255,148,114,1) 46%)'
|
background:
|
||||||
|
'linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(242,112,156,1) 0%, rgba(255,148,114,1) 46%)',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
width: '100%'
|
width: '100%',
|
||||||
},
|
},
|
||||||
searchInput: {
|
searchInput: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -27,7 +28,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
borderRadius: 20,
|
borderRadius: 20,
|
||||||
height: 25,
|
height: 25,
|
||||||
fontFamily: "'Libre Franklin', sans-serif"
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
},
|
},
|
||||||
subMenu: {
|
subMenu: {
|
||||||
marginTop: 40,
|
marginTop: 40,
|
||||||
@@ -46,8 +47,8 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
height: 30,
|
height: 30,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
background: '#ddd'
|
background: '#ddd',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
textFieldInput: {
|
textFieldInput: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
@@ -86,7 +87,6 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
}));
|
||||||
}))
|
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import { atom } from "recoil";
|
import { atom } from 'recoil';
|
||||||
|
|
||||||
export const selloutState = {
|
export const selloutState = {
|
||||||
listing: atom({
|
listing: atom({
|
||||||
key: "listing",
|
key: 'listing',
|
||||||
default: [],
|
default: [],
|
||||||
}),
|
}),
|
||||||
listingModal: atom({
|
listingModal: atom({
|
||||||
key: 'listingModal',
|
key: 'listingModal',
|
||||||
default: false
|
default: false,
|
||||||
}),
|
}),
|
||||||
listingDetails: atom({
|
listingDetails: atom({
|
||||||
key: 'listingDetails',
|
key: 'listingDetails',
|
||||||
@@ -15,6 +15,6 @@ export const selloutState = {
|
|||||||
}),
|
}),
|
||||||
itemModal: atom({
|
itemModal: atom({
|
||||||
key: 'itemModal',
|
key: 'itemModal',
|
||||||
default: false
|
default: false,
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
@@ -3,5 +3,5 @@ import { selloutState } from './state';
|
|||||||
|
|
||||||
export const useItemModal = () => {
|
export const useItemModal = () => {
|
||||||
const [itemModal, setItemModal] = useRecoilState(selloutState.itemModal);
|
const [itemModal, setItemModal] = useRecoilState(selloutState.itemModal);
|
||||||
return { itemModal, setItemModal};
|
return { itemModal, setItemModal };
|
||||||
}
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useRecoilValue } from "recoil";
|
import { useRecoilValue } from 'recoil';
|
||||||
import { selloutState } from "./state";
|
import { selloutState } from './state';
|
||||||
|
|
||||||
import { Listings } from '../../../common/typings/listings';
|
import { Listings } from '../../../common/typings/listings';
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ import { selloutState } from './state';
|
|||||||
export const useListingDetails = () => {
|
export const useListingDetails = () => {
|
||||||
const [details, setDetails] = useRecoilState(selloutState.listingDetails);
|
const [details, setDetails] = useRecoilState(selloutState.listingDetails);
|
||||||
return { details, setDetails };
|
return { details, setDetails };
|
||||||
}
|
};
|
||||||
Reference in new issue
Block a user