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