Skip to content

Commit ec086b7

Browse files
committed
fix: 이미지 url 리스트 비교 추가
1 parent b3b66f5 commit ec086b7

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

app/admin-new/(components)/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from "react";
22
import Image from "next/image";
33
import classNames from "classnames";
44
import { useRouter, useSearchParams } from "next/navigation";
5-
import HintDialog from "@/components/common/Hint-Dialog-new/Dialog";
65

6+
import HintDialog from "@/components/common/Hint-Dialog-new/Dialog";
77
import {
88
logoProps,
99
plusDisableProps,

app/admin-new/(components)/ThemeDrawer/hooks/useEditHint.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import useModal from "@/hooks/useModal";
1414
import extractFilename from "@/utils/helper";
1515
import { getHintList } from "@/queries/getHintList";
1616
import { useDrawerState } from "@/components/atoms/drawer.atom";
17+
1718
import { DrawerType } from "../types/themeDrawerTypes";
1819

1920
const useEditHint = ({
@@ -81,7 +82,7 @@ const useEditHint = ({
8182
...prevDrawer,
8283
isSameHint,
8384
}));
84-
}, [isSameHint, setDrawer]);
85+
}, [createHint, selectedHint]);
8586

8687
useEffect(() => {
8788
if (drawer.hintType === "Add") {
@@ -111,8 +112,10 @@ const useEditHint = ({
111112
...prev,
112113
contents: selectedHint.contents,
113114
answer: selectedHint.answer,
115+
answerImageUrlList: selectedHint.answerImageUrlList,
116+
hintImageUrlList: selectedHint.hintImageUrlList,
114117
}));
115-
}, [hintType, selectedHint, setCreateHint]);
118+
}, [hintType, selectedHint]);
116119

117120
const { handleProcess } = useHintUpload();
118121
const handleSubmit = async (e: FormEvent) => {

app/admin-new/(components)/ThemeInfo/ThemeInfoHint.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ const ThemeInfoHint: React.FC<ThemeDrawerProps> = ({ handleHintCreate }) => {
3131
resetSelectedHint();
3232
resetCreateHint();
3333
handleHintCreate("Add");
34+
setDrawer({ ...drawer, isOpen: true, hintType: "add" });
3435
};
3536

3637
const handleAddHintBtn = () => {
3738
if (drawer.isOpen && !drawer.isSameHint) {
3839
open(HintDialog, {
39-
type: "",
40+
type: "put",
4041
fn: handleResetCreateHint,
4142
});
4243
} else handleResetCreateHint();

app/components/common/Hint-Dialog-new/Dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import DialogBody from "@/components/common/Hint-Dialog-new/DialogBody";
99
import "@/components/common/Dialog-new/dialog.sass";
1010
import { useDeleteHint } from "@/mutations/deleteHint";
1111
import { useSelectedHint } from "@/components/atoms/selectedHint.atom";
12-
13-
import ModalPortal from "./ModalPortal";
1412
import {
1513
useDrawerState,
1614
} from "@/components/atoms/drawer.atom";
1715

16+
import ModalPortal from "./ModalPortal";
17+
1818
interface DialogProps {
1919
type?: string | "";
2020
fn?: () => void;

0 commit comments

Comments
 (0)