{mounted ? (
diff --git a/packages/common/components/src/ui/header/search-form.tsx b/packages/common/components/src/ui/header/search-form.tsx
index 66ffbadb1..ab0e4c47e 100644
--- a/packages/common/components/src/ui/header/search-form.tsx
+++ b/packages/common/components/src/ui/header/search-form.tsx
@@ -1,32 +1,63 @@
+import { useState } from "react";
import { Button } from "../button";
import { Input } from "../input";
export function SearchForm() {
+ const [isExpanded, setIsExpanded] = useState(false);
+ const [keyword, setKeyword] = useState("");
+
const handleSubmit = (e: React.FormEvent
) => {
e.preventDefault();
- const formData = new FormData(e.target as HTMLFormElement);
- const keyword = formData.get("keyword") as string;
-
+
if (keyword && keyword.trim().length > 0) {
window.location.href = `/cms/search?keyword=${encodeURIComponent(keyword)}`;
}
};
+ const handleButtonClick = () => {
+ if (isExpanded) {
+ // 입력 박스가 열려있을 때는 검색 실행
+ if (keyword && keyword.trim().length > 0) {
+ window.location.href = `/cms/search?keyword=${encodeURIComponent(keyword)}`;
+ }
+ } else {
+ // 입력 박스가 닫혀있을 때는 입력 박스 열기
+ setIsExpanded(true);
+ }
+ };
+
+ const handleInputBlur = () => {
+ // 입력 박스에서 포커스가 벗어나면 닫기 (약간의 지연을 두어 버튼 클릭이 먼저 처리되도록)
+ setTimeout(() => {
+ if (!keyword.trim()) {
+ setIsExpanded(false);
+ }
+ }, 200);
+ };
+
return (
-
+
+
+
);
}
diff --git a/packages/common/components/src/ui/layout/index.ts b/packages/common/components/src/ui/layout/index.ts
index 100f53453..24b8eb565 100644
--- a/packages/common/components/src/ui/layout/index.ts
+++ b/packages/common/components/src/ui/layout/index.ts
@@ -1,3 +1,4 @@
export { BaseLayout } from "./base";
export { VBaseLayout } from "./vbase";
-export { NoFooterLayout } from "./nofooter";
\ No newline at end of file
+export { NoFooterLayout } from "./nofooter";
+export { NoLNBLayout } from "./nolnb";
\ No newline at end of file
diff --git a/packages/common/components/src/ui/layout/nolnb.tsx b/packages/common/components/src/ui/layout/nolnb.tsx
new file mode 100644
index 000000000..5e64c42e0
--- /dev/null
+++ b/packages/common/components/src/ui/layout/nolnb.tsx
@@ -0,0 +1,42 @@
+import type { QueryClient } from "@tanstack/react-query";
+import { QueryProvider } from "../../provider/query-provider";
+import { PopupProvider } from "../../provider/popup-provider";
+import { ClientIpGuard } from "../../lib/client-ip-guard";
+import type { MenuItem } from "../../api";
+import { SidebarProvider } from "../sidebar";
+import { LNB } from "../lnb";
+import { Header } from "../header";
+import { Footer } from "../footer";
+import "./common.css";
+
+export function NoLNBLayout({
+ children,
+ queryClient,
+ currentPath,
+ handleMenuClick,
+}: {
+ children: React.ReactNode;
+ queryClient?: QueryClient;
+ currentPath?: string;
+ handleMenuClick?: (item: MenuItem) => void;
+}) {
+ return (
+
+
+
+
+
+
+
+
+
+ );
+}