Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/ui/modalContents/MakeRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ import { IRoomNameSchema } from "./schema";
import { useCreateRoomMutation } from "@hooks/useMutation";

export default function MakeRoom() {
const methods = useForm();
const methods = useForm<IRoomNameSchema>();
const mutation = useCreateRoomMutation();
const { closeModal } = useModal();

const onClickClose = () => {
closeModal();
};

const onClickMakeRoom = async (data: IRoomNameSchema) => {
const result = mutation.mutate(data);
console.log(result);
const onClickSubmit = async (data: IRoomNameSchema) => {
console.log(data, "data확인");
mutation.mutate(data);
closeModal();
};

return (
<FormProvider {...methods}>
<S.container>
<S.container onSubmit={methods.handleSubmit(onClickSubmit)}>
<S.title>방 만들기</S.title>
<S.inputContainer>
<S.label>방 이름</S.label>
<Input type="text" keyname="roomName" />
<Input<IRoomNameSchema> type="text" keyname="roomName" />
</S.inputContainer>
<S.warningContainer>
욕설이나 이용자에게 불쾌감을 줄 수 있는 단어가 포함되지 않도록 주의해
Expand All @@ -45,11 +46,10 @@ export default function MakeRoom() {
</Button>

<Button
type="button"
type="submit"
size="l"
textcolor="black"
bgcolor="green"
onClick={onClickMakeRoom}
width="50%"
>
방 만들기
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/modalContents/makeRoomStyle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "styled-components";

export const container = styled.div`
export const container = styled.form`
width: 100%;
height: 100%;
overflow: hidden;
Expand Down