@@ -36,6 +32,7 @@ export default function GoalContainerSkeleton() {
diff --git a/src/app/(protected)/goals/[goalId]/_components/GoalHeader.tsx b/src/app/(protected)/goals/[goalId]/_components/GoalHeader.tsx
index a7766c1..08427b2 100644
--- a/src/app/(protected)/goals/[goalId]/_components/GoalHeader.tsx
+++ b/src/app/(protected)/goals/[goalId]/_components/GoalHeader.tsx
@@ -11,6 +11,7 @@ import { useDeleteGoalMutation } from "@/hooks/queries/goals/useDeleteGoalMutati
import ConfirmModal from "@/components/common/popup-modal/ConfirmModal";
import { useRouter } from "next/navigation";
import { toast } from "@/lib/toast";
+import BaseInput from "@/components/common/input/base-input/BaseInput";
type GoalHeaderProps = {
goalId: string;
@@ -41,7 +42,7 @@ export default function GoalHeader({ goalId }: GoalHeaderProps) {
text: "수정하기",
onClick: () => {
closeDropdown();
- setEditTitle(goal?.title ?? "");
+ setEditTitle("");
setIsEditing(true);
},
},
@@ -66,6 +67,11 @@ export default function GoalHeader({ goalId }: GoalHeaderProps) {
);
};
+ const handleCancelEdit = () => {
+ setEditTitle("");
+ setIsEditing(false);
+ };
+
const handleConfim = () => {
deleteGoal(numericGoalId, {
onSuccess: () => {
@@ -86,11 +92,13 @@ export default function GoalHeader({ goalId }: GoalHeaderProps) {
{goal?.title}
) : (
- setEditTitle(e.target.value)}
+ placeholder="수정할 목표를 적어주세요."
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
@@ -98,10 +106,16 @@ export default function GoalHeader({ goalId }: GoalHeaderProps) {
}
}}
/>
+
- 수정 완료
+ 수정
+
+
+ 취소
)}
diff --git a/src/app/(protected)/goals/[goalId]/_components/GoalSection.tsx b/src/app/(protected)/goals/[goalId]/_components/GoalSection.tsx
index bc8e05e..219cc7a 100644
--- a/src/app/(protected)/goals/[goalId]/_components/GoalSection.tsx
+++ b/src/app/(protected)/goals/[goalId]/_components/GoalSection.tsx
@@ -42,7 +42,7 @@ export default function GoalSection({
className="grid sm:gap-0.5 lg:gap-1"
items={items}
onToggleChecked={onToggleChecked}
- containerClassName="sm:h-110"
+ containerClassName="sm:h-110 overflow-hidden overflow-y-auto"
/>
)}
diff --git a/src/components/common/input/base-input/BaseInput.tsx b/src/components/common/input/base-input/BaseInput.tsx
index 19885ad..6c4aab4 100644
--- a/src/components/common/input/base-input/BaseInput.tsx
+++ b/src/components/common/input/base-input/BaseInput.tsx
@@ -9,6 +9,7 @@ export interface BaseInputProps {
id?: string;
value: string;
onChange: (e: React.ChangeEvent