mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 14:38:46 +00:00
tweak(listing/nui): tweak on form modal
This commit is contained in:
1 parent
c9f24e3ce2
commit
bcc2e45697
1 file changed
+54
-16
@@ -1,23 +1,48 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles, Button, TextField } from "@material-ui/core";
|
||||
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";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
position: 'absolute',
|
||||
width: "100%",
|
||||
backgroundColor: '#F9F9F9',
|
||||
height: '100%',
|
||||
margin: "auto",
|
||||
textAlign: "center",
|
||||
fontFamily: "'Libre Franklin', sans-serif"
|
||||
},
|
||||
hidden: {
|
||||
display: 'none'
|
||||
},
|
||||
input: {
|
||||
marginBottom: 25,
|
||||
fontFamily: "'Libre Franklin', sans-serif"
|
||||
},
|
||||
textFieldInput: {
|
||||
fontSize: 22,
|
||||
fontSize: 18,
|
||||
background: "#EBEBEB",
|
||||
color: '#272727',
|
||||
fontWeight: 600,
|
||||
textIndent: 3,
|
||||
borderRadius: 15,
|
||||
padding: 15,
|
||||
fontFamily: "'Libre Franklin', sans-serif"
|
||||
},
|
||||
multilineFieldInput: {
|
||||
fontSize: 20,
|
||||
fontSize: 18,
|
||||
background: "#EBEBEB",
|
||||
borderRadius: 15,
|
||||
fontFamily: "'Libre Franklin', sans-serif",
|
||||
color: '#272727',
|
||||
textIndent: 3,
|
||||
fontWeight: 600,
|
||||
padding: 15
|
||||
},
|
||||
postButton: {
|
||||
display: "block",
|
||||
@@ -31,6 +56,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
export const ListingForm = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const { modal, setModal } = useListingModal()
|
||||
|
||||
const [ title, setTitle ] = useState('');
|
||||
const [ url, setUrl ] = useState('');
|
||||
const [ description, setDescription ] = useState('');
|
||||
@@ -43,41 +70,52 @@ export const ListingForm = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const closeModal = () => {
|
||||
setModal(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<h1>New Listing</h1>
|
||||
<TextField
|
||||
<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 on listing.."
|
||||
placeholder="Title"
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: "80%" }}
|
||||
size="medium"
|
||||
/>
|
||||
|
||||
<TextField
|
||||
<InputBase
|
||||
className={classes.input}
|
||||
placeholder="Image URL"
|
||||
placeholder="Image or URL link"
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: "80%" }}
|
||||
/>
|
||||
|
||||
<InputBase
|
||||
className={classes.input}
|
||||
placeholder="Price"
|
||||
onChange={e => setUrl(e.target.value)}
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: "80%" }}
|
||||
size="medium"
|
||||
variant="outlined"
|
||||
/>
|
||||
|
||||
<TextField
|
||||
<InputBase
|
||||
className={classes.input}
|
||||
onChange={e => setDescription(e.target.value)}
|
||||
placeholder="Description"
|
||||
inputProps={{ className: classes.multilineFieldInput }}
|
||||
style={{ width: "80%" }}
|
||||
size="medium"
|
||||
multiline
|
||||
rows={4}
|
||||
variant="outlined"
|
||||
rows={7}
|
||||
/>
|
||||
|
||||
<Button onClick={addListing} className={classes.postButton}>Post</Button>
|
||||
<div>
|
||||
<Button onClick={closeModal}>
|
||||
<h3 style={{ color: '#272727' }}>Cancel</h3>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user