diff --git a/api/room.ts b/api/room.ts index 18450e2..01c872b 100644 --- a/api/room.ts +++ b/api/room.ts @@ -1,4 +1,4 @@ -import { Furnishing, Room, RoomFile, RoomSearch, RoomSearchParams } from '@/public/types/room'; +import { ContactParams, Furnishing, Room, RoomFile, RoomSearch, RoomSearchParams } from '@/public/types/room'; import { fetchData } from './index'; export const fetchFurnishings = async () => { @@ -51,3 +51,13 @@ export const deleteRoom = async (id: string) => { }, }); }; + +export const contactRoom = async (params: ContactParams) => { + return fetchData(`/api/v1/rooms/${params.roomId}/contact`, { + method: 'POST', + body: JSON.stringify(params), + headers: { + 'Content-Type': 'application/json', + }, + }); +}; diff --git a/components/Modal/ModalBox.tsx b/components/Modal/ModalBox.tsx index e053cac..69faf53 100644 --- a/components/Modal/ModalBox.tsx +++ b/components/Modal/ModalBox.tsx @@ -25,6 +25,7 @@ function Modal({ buttonName = '', buttonName2 = '', buttonNames = [], + hasButton = true, size = 'md', }: ModalProps) { const { closeModal } = useModal(); @@ -116,7 +117,7 @@ function Modal({ {hasCloseButton && (
)} @@ -131,14 +132,19 @@ function Modal({ /> )} - {buttonType && buttonType !== 'none' && buttonType !== 'wrapper' ? ( -
{renderButton()}
- ) : ( + {hasButton && ( + // eslint-disable-next-line react/jsx-no-useless-fragment <> -
{renderButton()}
- + {buttonType && buttonType !== 'none' && buttonType !== 'wrapper' ? ( +
{renderButton()}
+ ) : ( +
+ {renderButton()} + +
+ )} )} diff --git a/components/Modal/ModalContainer.tsx b/components/Modal/ModalContainer.tsx index 51a31bf..b68215e 100644 --- a/components/Modal/ModalContainer.tsx +++ b/components/Modal/ModalContainer.tsx @@ -23,6 +23,7 @@ export interface ModalProps { buttonName2?: string; buttonNames?: Array; buttonNumber?: number; + hasButton?: boolean; size?: 'md' | 'full'; } diff --git a/components/Textarea/Textarea.module.scss b/components/Textarea/Textarea.module.scss index 68cf47c..05ca27d 100644 --- a/components/Textarea/Textarea.module.scss +++ b/components/Textarea/Textarea.module.scss @@ -1,8 +1,7 @@ .textArea { - @apply w-full px-3 py-2 border border-gray-300 rounded-md resize-none focus:outline-none focus:ring focus:border-[#FF8E00]; + @apply w-full px-3 py-2 border border-gray-300 rounded-md resize-none focus:outline-none focus:ring focus:border-[#FF8E00] font-normal; &.placeholder { - @apply text-g4; + @apply text-g4 font-normal; } - -} \ No newline at end of file +} diff --git a/components/Textarea/Textarea.tsx b/components/Textarea/Textarea.tsx index a052793..63cfbde 100644 --- a/components/Textarea/Textarea.tsx +++ b/components/Textarea/Textarea.tsx @@ -51,7 +51,7 @@ function Textarea({ placeholder, register, maxByte, maxLength, initValue, classN return (