diff --git a/phone/src/apps/sellout/components/Sellout.css b/phone/src/apps/sellout/components/Sellout.css new file mode 100644 index 0000000..e69de29 diff --git a/phone/src/apps/sellout/components/SelloutApp.js b/phone/src/apps/sellout/components/SelloutApp.js new file mode 100644 index 0000000..da0a277 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutApp.js @@ -0,0 +1,25 @@ +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 { NavigationBar } from "./navigation/NavigationBar"; +import { Switch, Route } from "react-router-dom"; + +import "./Sellout.css"; +import { ListingFormContainer } from "./form/ListingFormContainer"; + +export const SelloutApp = () => { + return ( + + + + + + + + + + + ); +}; diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutItem.js b/phone/src/apps/sellout/components/SelloutList/SelloutItem.js new file mode 100644 index 0000000..37869bd --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutList/SelloutItem.js @@ -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 ( + +
+ +
+ + {listing.name} + + + {listing.number} + +
+ + + {listing.description} + +
+ + +
+
+
+
+ ); +}; diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutList.js b/phone/src/apps/sellout/components/SelloutList/SelloutList.js new file mode 100644 index 0000000..9c7df00 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutList/SelloutList.js @@ -0,0 +1,13 @@ +import React from "react"; +import { List } from "../../../../ui/components/List"; +import { SelloutItem } from "./SelloutItem"; + +export const SelloutList = ({ listings }) => { + return ( + + {listings.map((listing) => ( + + ))} + + ); +}; diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js new file mode 100644 index 0000000..4117b89 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js @@ -0,0 +1,8 @@ +import React from "react"; +import { useListing } from "../../hooks/useListing"; +import { SelloutList } from "./SelloutList"; + +export const SelloutListContainer = () => { + const { listing } = useListing(); + return ; +}; diff --git a/phone/src/apps/sellout/components/SelloutTitle.js b/phone/src/apps/sellout/components/SelloutTitle.js new file mode 100644 index 0000000..e16b4d1 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutTitle.js @@ -0,0 +1,29 @@ +import React from "react"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core"; +import LinkedInIcon from "@material-ui/icons/LinkedIn"; + +const useStyles = makeStyles((theme) => ({ + root: { + height: "60px", + width: "100%", + display: "flex", + flexFlow: "row nowrap", + justifyContent: "center", + alignItems: "center", + background: "#424242", + }, + icon: { + color: "#f44336", + fontSize: 40, + }, +})); + +export const SelloutTitle = () => { + const classes = useStyles(); + return ( + + + + ); +}; diff --git a/phone/src/apps/sellout/components/form/ListingForm.js b/phone/src/apps/sellout/components/form/ListingForm.js new file mode 100644 index 0000000..669a91f --- /dev/null +++ b/phone/src/apps/sellout/components/form/ListingForm.js @@ -0,0 +1,64 @@ +import React from "react"; +import { makeStyles, Button, TextField } from "@material-ui/core"; + +const useStyles = makeStyles((theme) => ({ + root: { + width: "100%", + margin: "auto", + textAlign: "center", + }, + input: { + marginBottom: 25, + }, + textFieldInput: { + fontSize: 22, + }, + multilineFieldInput: { + fontSize: 20, + }, + postButton: { + display: "block", + margin: "auto", + background: "#f44336", + width: "80%", + fontSize: 20, + }, +})); + +export const ListingForm = () => { + const classes = useStyles(); + return ( +
+

New Listing

+ + + + + + + +
+ ); +}; diff --git a/phone/src/apps/sellout/components/form/ListingFormContainer.js b/phone/src/apps/sellout/components/form/ListingFormContainer.js new file mode 100644 index 0000000..de5cb54 --- /dev/null +++ b/phone/src/apps/sellout/components/form/ListingFormContainer.js @@ -0,0 +1,10 @@ +import React from 'react' +import { ListingForm } from './ListingForm'; + +export const ListingFormContainer = () => { + return ( +
+ +
+ ) +} diff --git a/phone/src/apps/sellout/components/images/ImageDisplay.js b/phone/src/apps/sellout/components/images/ImageDisplay.js new file mode 100644 index 0000000..d8a0b27 --- /dev/null +++ b/phone/src/apps/sellout/components/images/ImageDisplay.js @@ -0,0 +1,5 @@ +import React from 'react' + +export const ImageDisplay = ({ imgURL }) => { + return Image +} diff --git a/phone/src/apps/sellout/components/navigation/NavigationBar.js b/phone/src/apps/sellout/components/navigation/NavigationBar.js new file mode 100644 index 0000000..3763989 --- /dev/null +++ b/phone/src/apps/sellout/components/navigation/NavigationBar.js @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import { Link } from "react-router-dom"; +import { BottomNavigation, BottomNavigationAction } from "@material-ui/core"; +import HomeIcon from '@material-ui/icons/Home'; +import AddCircleIcon from '@material-ui/icons/AddCircle'; +import FaceIcon from '@material-ui/icons/Face'; + +const useStyles = makeStyles((theme) => ({ + root: { + width: '100%' + }, + icon: { + color: "#f44336" + } +})) + +export const NavigationBar = () => { + const classes = useStyles(); + const [activePage, setActivePage] = useState(0); + return ( + { + setActivePage(newPage) + }} + showLabels + className={classes.root} + > + } + to="/sellout" + /> + } + to="/sellout/new" + /> + } + to="/sellout/profile" + /> + + ) +} diff --git a/phone/src/apps/sellout/hooks/state.js b/phone/src/apps/sellout/hooks/state.js new file mode 100644 index 0000000..a7b02f7 --- /dev/null +++ b/phone/src/apps/sellout/hooks/state.js @@ -0,0 +1,8 @@ +import { atom } from 'recoil'; + +export const selloutState = { + listing: atom({ + key: 'listing', + default: null + }) +} \ No newline at end of file diff --git a/phone/src/apps/sellout/hooks/useListing.js b/phone/src/apps/sellout/hooks/useListing.js new file mode 100644 index 0000000..a090de0 --- /dev/null +++ b/phone/src/apps/sellout/hooks/useListing.js @@ -0,0 +1,7 @@ +import { useRecoilValue } from 'recoil'; +import { selloutState } from './state'; + +export const useListing = () => { + const listing = useRecoilValue(selloutState.listing); + return { listing }; +} diff --git a/phone/src/apps/sellout/hooks/useSelloutService.js b/phone/src/apps/sellout/hooks/useSelloutService.js new file mode 100644 index 0000000..e191e51 --- /dev/null +++ b/phone/src/apps/sellout/hooks/useSelloutService.js @@ -0,0 +1,10 @@ +import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent'; +import { selloutState } from './state'; +import { useListing } from './useListing'; +import { useSetRecoilState } from 'recoil'; + +export const useSelloutService = () => { + const setSellout = useSetRecoilState(selloutState.listing); + useNuiEvent('SELLOUT', 'setListings', setSellout); + return useListing() +} \ No newline at end of file