mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Feat(Sellout:ListingForm): NUI.send done | some styling
This commit is contained in:
1 parent
48642083a5
commit
a18ae8d839
1 file changed
+21
-2
@@ -1,5 +1,8 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import { makeStyles, Button, TextField } from "@material-ui/core";
|
import { makeStyles, Button, TextField } from "@material-ui/core";
|
||||||
|
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
|
import "../Sellout.css"
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -27,11 +30,25 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
|
|
||||||
export const ListingForm = () => {
|
export const ListingForm = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
|
const [ title, setTitle ] = useState('');
|
||||||
|
const [ url, setUrl ] = useState('');
|
||||||
|
const [ desc, setDesc ] = useState('');
|
||||||
|
|
||||||
|
const addListing = () => {
|
||||||
|
Nui.send('phone:addListing', {
|
||||||
|
title,
|
||||||
|
url,
|
||||||
|
desc
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<h1>New Listing</h1>
|
<h1>New Listing</h1>
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
|
onChange={e => setTitle(e.target.value)}
|
||||||
placeholder="Title on listing.."
|
placeholder="Title on listing.."
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: "80%" }}
|
||||||
@@ -41,6 +58,7 @@ export const ListingForm = () => {
|
|||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Image URL"
|
placeholder="Image URL"
|
||||||
|
onChange={e => setUrl(e.target.value)}
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: "80%" }}
|
||||||
size="medium"
|
size="medium"
|
||||||
@@ -49,6 +67,7 @@ export const ListingForm = () => {
|
|||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
|
onChange={e => setDesc(e.target.value)}
|
||||||
placeholder="Description"
|
placeholder="Description"
|
||||||
inputProps={{ className: classes.multilineFieldInput }}
|
inputProps={{ className: classes.multilineFieldInput }}
|
||||||
style={{ width: "80%" }}
|
style={{ width: "80%" }}
|
||||||
@@ -58,7 +77,7 @@ export const ListingForm = () => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button className={classes.postButton}>Post</Button>
|
<Button onClick={addListing} className={classes.postButton}>Post</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user