diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index cdc4ec8..3af3b47 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -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, }, diff --git a/phone/src/apps/sellout/components/SelloutApp.tsx b/phone/src/apps/sellout/components/SelloutApp.tsx index 92e5262..68e8594 100644 --- a/phone/src/apps/sellout/components/SelloutApp.tsx +++ b/phone/src/apps/sellout/components/SelloutApp.tsx @@ -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 ( - + diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx index d580d17..94e16c2 100644 --- a/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx +++ b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx @@ -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 (
- + {listing.title} - + {listing.description.slice(0, 30)}... - + ${listing.price} -
-
+
diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutList.tsx b/phone/src/apps/sellout/components/SelloutList/SelloutList.tsx index 7629153..209b5cd 100644 --- a/phone/src/apps/sellout/components/SelloutList/SelloutList.tsx +++ b/phone/src/apps/sellout/components/SelloutList/SelloutList.tsx @@ -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 ( diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx index 2856a10..db7f0b4 100644 --- a/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx +++ b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx @@ -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 (
- {itemModal ? ( - - ): ( - - )} + {itemModal ? : }
- ) + ); }; diff --git a/phone/src/apps/sellout/components/SelloutList/item.styles.ts b/phone/src/apps/sellout/components/SelloutList/item.styles.ts index d3e50c1..cfdc77f 100644 --- a/phone/src/apps/sellout/components/SelloutList/item.styles.ts +++ b/phone/src/apps/sellout/components/SelloutList/item.styles.ts @@ -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; \ No newline at end of file +export default useStyles; diff --git a/phone/src/apps/sellout/components/form/ListingForm.tsx b/phone/src/apps/sellout/components/form/ListingForm.tsx index 4c22654..6f600ea 100644 --- a/phone/src/apps/sellout/components/form/ListingForm.tsx +++ b/phone/src/apps/sellout/components/form/ListingForm.tsx @@ -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 (

New Listing

setTitle(e.target.value)} - placeholder="Title" + onChange={(e) => setTitle(e.target.value)} + placeholder='Title' inputProps={{ className: classes.textFieldInput }} - style={{ width: "80%" }} + style={{ width: '80%' }} /> setUrl(e.target.value)} + placeholder='Price' + onChange={(e) => setUrl(e.target.value)} inputProps={{ className: classes.textFieldInput }} - style={{ width: "80%" }} + style={{ width: '80%' }} /> 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} /> - +
+
- + {details.category}
- {details.title} + + {details.title} + ${details.price}
- Author: {details.name} + + Author: {details.name} + - Category: {details.category} + + Category:{' '} + {details.category} + - Posted: {details.posted} + + Posted: {details.posted} +
- +
-

Listing Description

+

+ Listing Description +

{details.description}

-
-
- ) + ); } diff --git a/phone/src/apps/sellout/components/modal/modal.styles.ts b/phone/src/apps/sellout/components/modal/modal.styles.ts index 87629b6..18a721d 100644 --- a/phone/src/apps/sellout/components/modal/modal.styles.ts +++ b/phone/src/apps/sellout/components/modal/modal.styles.ts @@ -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; \ No newline at end of file +export default useStyles; diff --git a/phone/src/apps/sellout/components/search/SelloutSearch.tsx b/phone/src/apps/sellout/components/search/SelloutSearch.tsx index 7cfd0d5..700aa22 100644 --- a/phone/src/apps/sellout/components/search/SelloutSearch.tsx +++ b/phone/src/apps/sellout/components/search/SelloutSearch.tsx @@ -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 ( -
-
+ const classes = useStyles(); + return ( +
+

Marketplace

-
-
- -
- -
+
+
+ +
+ +
-
- - -
-
-
- ) -} +
+ + +
+
+
+ ); +}; -export default SelloutSearch; \ No newline at end of file +export default SelloutSearch; diff --git a/phone/src/apps/sellout/components/search/search.styles.ts b/phone/src/apps/sellout/components/search/search.styles.ts index 93b038c..d2d41df 100644 --- a/phone/src/apps/sellout/components/search/search.styles.ts +++ b/phone/src/apps/sellout/components/search/search.styles.ts @@ -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; \ No newline at end of file +export default useStyles; diff --git a/phone/src/apps/sellout/hooks/state.ts b/phone/src/apps/sellout/hooks/state.ts index 730bae3..fb1cb8d 100644 --- a/phone/src/apps/sellout/hooks/state.ts +++ b/phone/src/apps/sellout/hooks/state.ts @@ -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, + }), }; diff --git a/phone/src/apps/sellout/hooks/useItemModal.ts b/phone/src/apps/sellout/hooks/useItemModal.ts index 9c8bfb7..082c904 100644 --- a/phone/src/apps/sellout/hooks/useItemModal.ts +++ b/phone/src/apps/sellout/hooks/useItemModal.ts @@ -3,5 +3,5 @@ import { selloutState } from './state'; export const useItemModal = () => { const [itemModal, setItemModal] = useRecoilState(selloutState.itemModal); - return { itemModal, setItemModal}; -} \ No newline at end of file + return { itemModal, setItemModal }; +}; diff --git a/phone/src/apps/sellout/hooks/useListing.ts b/phone/src/apps/sellout/hooks/useListing.ts index a6872d8..0e93885 100644 --- a/phone/src/apps/sellout/hooks/useListing.ts +++ b/phone/src/apps/sellout/hooks/useListing.ts @@ -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'; diff --git a/phone/src/apps/sellout/hooks/useListingDetails.ts b/phone/src/apps/sellout/hooks/useListingDetails.ts index b7f2458..86e26f5 100644 --- a/phone/src/apps/sellout/hooks/useListingDetails.ts +++ b/phone/src/apps/sellout/hooks/useListingDetails.ts @@ -4,4 +4,4 @@ import { selloutState } from './state'; export const useListingDetails = () => { const [details, setDetails] = useRecoilState(selloutState.listingDetails); return { details, setDetails }; -} \ No newline at end of file +}; diff --git a/phone/src/common/typings/listings.ts b/phone/src/common/typings/listings.ts index fb053af..0722bb2 100644 --- a/phone/src/common/typings/listings.ts +++ b/phone/src/common/typings/listings.ts @@ -5,4 +5,4 @@ export interface Listings { url: string; description: string; price: number; -} \ No newline at end of file +}