Make descriptions optional
This commit is contained in:
parent
aab735cd8b
commit
c64289af86
|
@ -22,8 +22,8 @@ export default function NewContract() {
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
// TODO: add more rigorous error handling for question, description
|
// TODO: add more rigorous error handling for question
|
||||||
if (!creator || !question || !description) return
|
if (!creator || !question) return
|
||||||
|
|
||||||
setIsSubmitting(true)
|
setIsSubmitting(true)
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ export default function NewContract() {
|
||||||
|
|
||||||
<div className="form-control">
|
<div className="form-control">
|
||||||
<label className="label">
|
<label className="label">
|
||||||
<span className="label-text">Description</span>
|
<span className="label-text">Description (optional)</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
|
@ -105,7 +105,7 @@ export default function NewContract() {
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-primary"
|
className="btn btn-primary"
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting || !question}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
submit()
|
submit()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user