{/* 상단 - 닫기 버튼 */}
);
};
diff --git a/apps/nowait-admin/src/pages/AdminBooth/components/NoticeEditor.tsx b/apps/nowait-admin/src/pages/AdminBooth/components/NoticeEditor.tsx
index 5f858c0b..607aa6a8 100644
--- a/apps/nowait-admin/src/pages/AdminBooth/components/NoticeEditor.tsx
+++ b/apps/nowait-admin/src/pages/AdminBooth/components/NoticeEditor.tsx
@@ -1,55 +1,79 @@
-import { useState } from "react";
+import { useState, useEffect } from "react";
import { useEditor, EditorContent } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import Underline from "@tiptap/extension-underline";
const MenuBar = ({ editor }: { editor: any }) => {
+ const [editorChanged, setEditorChanged] = useState(0);
+ // 툴바 버튼 클릭시 리랜더링
+ useEffect(() => {
+ if (!editor) return;
+
+ const update = () => setEditorChanged((prev) => prev + 1);
+ editor.on("transaction", update);
+ return () => editor.off("transaction", update);
+ }, [editor]);
+
if (!editor) return null;
+ const baseBtnClass =
+ "h-[34px] w-[34px] flex justify-center items-center rounded hover:bg-gray-100 transition-colors duration-200";
+
return (
editor.chain().focus().toggleHeading({ level: 1 }).run()}
- className="px-2 py-1 rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("heading", { level: 1 }) ? "bg-gray-100" : ""
+ }`}
>
H1
editor.chain().focus().toggleHeading({ level: 2 }).run()}
- className="px-2 py-1 mr-6 rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("heading", { level: 2 }) ? "bg-gray-100" : ""
+ }`}
>
H2
editor.chain().focus().toggleBold().run()}
- className="px-2 py-1 font-bold rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("bold") ? "bg-gray-100" : ""
+ }`}
>
B
editor.chain().focus().toggleItalic().run()}
- className="px-2 py-1 italic rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("italic") ? "bg-gray-100" : ""
+ }`}
>
I
editor.chain().focus().toggleUnderline().run()}
- className="px-2 py-1 underline rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("underline") ? "bg-gray-100" : ""
+ }`}
>
U
editor.chain().focus().toggleStrike().run()}
- className="px-2 py-1 line-through rounded hover:bg-gray-100"
+ className={`${baseBtnClass} ${
+ editor.isActive("strike") ? "bg-gray-100" : ""
+ }`}
>
S
);
};
-
const NoticeEditor = () => {
- const [title, setTitle] = useState("제목을 입력해주세요");
+ const [title, setTitle] = useState("");
const editor = useEditor({
extensions: [StarterKit, Underline],
@@ -63,13 +87,32 @@ const NoticeEditor = () => {
// API 전송 가능
};
+ const [hasCleared, setHasCleared] = useState(false);
+ // 텍스터 에디터 focusing시 clear
+ useEffect(() => {
+ if (!editor) return;
+
+ const handleFocus = () => {
+ if (!hasCleared) {
+ editor.commands.clearContent();
+ setHasCleared(true);
+ }
+ };
+
+ editor.on("focus", handleFocus);
+ return () => {
+ editor.off("focus", handleFocus);
+ };
+ }, [editor, hasCleared]);
+
return (
setTitle("")}
onChange={(e) => setTitle(e.target.value)}
- placeholder="공지 제목을 입력하세요"
+ placeholder="제목을 입력해주세요"
className="w-full px-5 py-3 text-[#666666] bg-black-20 font-semibold rounded-t-xl outline-none"
/>
diff --git a/apps/nowait-admin/src/pages/AdminHome/AdminHome.tsx b/apps/nowait-admin/src/pages/AdminHome/AdminHome.tsx
index d5efe6f0..9ea6bff0 100644
--- a/apps/nowait-admin/src/pages/AdminHome/AdminHome.tsx
+++ b/apps/nowait-admin/src/pages/AdminHome/AdminHome.tsx
@@ -208,7 +208,7 @@ const AdminHome = () => {
{/* 대기자 목록
*/}
-
+
{tabLabels.map(({ label, count }) => (
{
)}
peopleCount={res.peopleCount}
name={res.name}
- phone="010-****-****"
+ phone="010-1234-1234"
status={res.status}
calledAt={res.calledAt}
isNoShow={noShowIds.includes(res.id)}
diff --git a/apps/nowait-admin/src/pages/AdminHome/components/RoundTabButton.tsx b/apps/nowait-admin/src/pages/AdminHome/components/RoundTabButton.tsx
index d809a77a..1cdcc224 100644
--- a/apps/nowait-admin/src/pages/AdminHome/components/RoundTabButton.tsx
+++ b/apps/nowait-admin/src/pages/AdminHome/components/RoundTabButton.tsx
@@ -19,7 +19,7 @@ const RoundTabButton: React.FC = ({
{/* 입장인원 */}
-
-
입장
+
{/* 이름 */}
-
+
이름
{truncateName(name)}
@@ -150,7 +150,7 @@ export function WaitingCard({
) : (
<>
-

{elapsed}
+
{elapsed}