mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +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 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 Nui from "../../../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
|
|
||||||
import "../Sellout.css"
|
import "../Sellout.css"
|
||||||
|
import {useListingModal} from "../../hooks/useListingModal";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
|
position: 'absolute',
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
backgroundColor: '#F9F9F9',
|
||||||
|
height: '100%',
|
||||||
margin: "auto",
|
margin: "auto",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
|
fontFamily: "'Libre Franklin', sans-serif"
|
||||||
|
},
|
||||||
|
hidden: {
|
||||||
|
display: 'none'
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
marginBottom: 25,
|
marginBottom: 25,
|
||||||
|
fontFamily: "'Libre Franklin', sans-serif"
|
||||||
},
|
},
|
||||||
textFieldInput: {
|
textFieldInput: {
|
||||||
fontSize: 22,
|
fontSize: 18,
|
||||||
|
background: "#EBEBEB",
|
||||||
|
color: '#272727',
|
||||||
|
fontWeight: 600,
|
||||||
|
textIndent: 3,
|
||||||
|
borderRadius: 15,
|
||||||
|
padding: 15,
|
||||||
|
fontFamily: "'Libre Franklin', sans-serif"
|
||||||
},
|
},
|
||||||
multilineFieldInput: {
|
multilineFieldInput: {
|
||||||
fontSize: 20,
|
fontSize: 18,
|
||||||
|
background: "#EBEBEB",
|
||||||
|
borderRadius: 15,
|
||||||
|
fontFamily: "'Libre Franklin', sans-serif",
|
||||||
|
color: '#272727',
|
||||||
|
textIndent: 3,
|
||||||
|
fontWeight: 600,
|
||||||
|
padding: 15
|
||||||
},
|
},
|
||||||
postButton: {
|
postButton: {
|
||||||
display: "block",
|
display: "block",
|
||||||
@@ -31,6 +56,8 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const ListingForm = () => {
|
export const ListingForm = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
|
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('');
|
||||||
@@ -43,41 +70,52 @@ export const ListingForm = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeModal = () => {
|
||||||
|
setModal(false)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={modal ? classes.root : classes.hidden}>
|
||||||
<h1>New Listing</h1>
|
<h1 style={{ color: '#272727' }}>New Listing</h1>
|
||||||
<TextField
|
<InputBase
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
onChange={e => setTitle(e.target.value)}
|
onChange={e => setTitle(e.target.value)}
|
||||||
placeholder="Title on listing.."
|
placeholder="Title"
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: "80%" }}
|
||||||
size="medium"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextField
|
<InputBase
|
||||||
className={classes.input}
|
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)}
|
onChange={e => setUrl(e.target.value)}
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: "80%" }}
|
||||||
size="medium"
|
|
||||||
variant="outlined"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextField
|
<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%" }}
|
||||||
size="medium"
|
|
||||||
multiline
|
multiline
|
||||||
rows={4}
|
rows={7}
|
||||||
variant="outlined"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<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>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user