added title in add aboutus

This commit is contained in:
Philip Cheung 2024-10-07 20:07:54 +08:00
parent be06a0783f
commit dadc2cec38
1 changed files with 20 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { useState } from 'react';
import { useState } from 'react';
import {
Button,
FormControl,
@ -16,6 +16,7 @@ import {
NumberInputStepper,
NumberIncrementStepper,
NumberDecrementStepper,
Input,
} from "@chakra-ui/react"
import { useMutation, useQueryClient } from "@tanstack/react-query"
@ -82,6 +83,7 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
criteriaMode: "all",
defaultValues: {
index: 0,
title: "",
description: "",
image: undefined,
},
@ -149,6 +151,20 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
<ModalCloseButton />
<ModalBody pb={30}>
<FormControl isRequired isInvalid={!!errors.title}>
<FormLabel htmlFor="title">Title</FormLabel>
<Input
id="title"
{...register("title", {
required: "Title is required.",
})}
placeholder="Title"
type="text"
/>
{errors.title && (
<FormErrorMessage>{errors.title.message}</FormErrorMessage>
)}
</FormControl>
<FormControl isRequired isInvalid={!!errors.description}>
<Editor
editorState={editorState}