도움말 추가
This commit is contained in:
@@ -84,8 +84,7 @@ function SearchPage() {
|
||||
<TabsList className="mx-auto">
|
||||
<TabsTrigger value="all">
|
||||
전체 (
|
||||
{data?.contsList?.length ??
|
||||
0 + (data?.boardList?.totalElements ?? 0)}
|
||||
{ (data?.contsList?.length ?? 0) + (data?.boardList?.totalElements ?? 0)}
|
||||
건)
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="contents">
|
||||
|
||||
@@ -26,7 +26,8 @@ export function Footer() {
|
||||
return (
|
||||
<footer className="flex w-full shrink-0 items-start border-t border-solid border-border bg-background px-6 py-8">
|
||||
<div className="w-1/2">
|
||||
<h6 className="mb-4 text-2xl font-bold">{siteInfo?.siteExpln ?? ""}</h6>
|
||||
<h6 className="mb-4 text-2xl font-bold">{siteInfo?.siteNm ?? ""}</h6>
|
||||
<p className="my-1 text-xl opacity-60">{siteInfo?.siteAddr ?? ""}</p>
|
||||
<p className="my-1 text-xl opacity-60">
|
||||
전화: {siteInfo?.telNo ?? ""} / 팩스: {siteInfo?.faxNumber ?? ""}
|
||||
</p>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import { ChevronRight, HelpCircle } from "lucide-react";
|
||||
import { useDetectDevice } from "@frontend-opensource/use-react-hooks";
|
||||
import { getConfig } from "@common/config";
|
||||
import { getParentIds } from "./lib";
|
||||
@@ -22,6 +22,13 @@ import {
|
||||
CollapsibleContent,
|
||||
CollapsibleTrigger,
|
||||
} from "../collapsible";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "../dialog";
|
||||
import { ENDPOINT } from "../../config";
|
||||
import { cn, getCookie, setCookie } from "../../lib";
|
||||
import {
|
||||
@@ -56,6 +63,8 @@ export function LNB({
|
||||
}) {
|
||||
const [defaultOpenMenuIds, setDefaultOpenMenuIds] = useState<number[]>([]);
|
||||
const [currentMenuCode, setCurrentMenuCode] = useState<number | null>(null);
|
||||
const [currentMenuHelp, setCurrentMenuHelp] = useState<string>("");
|
||||
const [isHelpModalOpen, setIsHelpModalOpen] = useState(false);
|
||||
const prevPathRef = useRef(currentPath);
|
||||
const { browser } = useDetectDevice();
|
||||
|
||||
@@ -95,6 +104,7 @@ export function LNB({
|
||||
|
||||
const matchedMenuIds: number[] = [];
|
||||
let matchedMenuCode: number | null = null;
|
||||
let matchedMenuHelp: string = "";
|
||||
|
||||
const findMatchedMenus = (items: MenuItem[]) => {
|
||||
items.forEach((item) => {
|
||||
@@ -109,7 +119,10 @@ export function LNB({
|
||||
const findMatchedMenuCode = (items: MenuItem[]) => {
|
||||
items.forEach((item) => {
|
||||
if (matchedMenuCode) return;
|
||||
if (currentPath === item.urlPath) matchedMenuCode = item.menuCd;
|
||||
if (currentPath === item.urlPath) {
|
||||
matchedMenuCode = item.menuCd;
|
||||
matchedMenuHelp = item.menuHlpCn || "";
|
||||
}
|
||||
if (item.children) findMatchedMenuCode(item.children);
|
||||
});
|
||||
};
|
||||
@@ -127,7 +140,10 @@ export function LNB({
|
||||
prevPathRef.current = currentPath;
|
||||
}
|
||||
|
||||
if (matchedMenuCode) setCurrentMenuCode(matchedMenuCode);
|
||||
if (matchedMenuCode) {
|
||||
setCurrentMenuCode(matchedMenuCode);
|
||||
setCurrentMenuHelp(matchedMenuHelp);
|
||||
}
|
||||
|
||||
// 접속 로그 저장
|
||||
saveConnectionLog({
|
||||
@@ -185,7 +201,7 @@ export function LNB({
|
||||
/>
|
||||
<span className={cn("whitespace-nowrap", !isSidebarOpen && "hidden")}>
|
||||
{item.menuKornNm}
|
||||
</span>
|
||||
</span>
|
||||
</MenuButton>
|
||||
</MenuItem>
|
||||
);
|
||||
@@ -268,6 +284,41 @@ export function LNB({
|
||||
<SidebarMenu className="gap-0">
|
||||
{menuList?.map((item) => <MenuItem key={item.menuCd} item={item} />)}
|
||||
</SidebarMenu>
|
||||
|
||||
{/* 도움말 아이콘 */}
|
||||
<div className="mt-auto pb-4">
|
||||
<Dialog open={isHelpModalOpen} onOpenChange={setIsHelpModalOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<button
|
||||
className={cn(
|
||||
"flex h-12 w-full items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
||||
"focus:outline-none"
|
||||
)}
|
||||
title="도움말"
|
||||
>
|
||||
<HelpCircle className="size-8" />
|
||||
<span className="ml-2">도움말</span>
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[85rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>도움말</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="py-4">
|
||||
{currentMenuHelp ? (
|
||||
<div
|
||||
className="text-sm leading-relaxed text-muted-foreground"
|
||||
dangerouslySetInnerHTML={{ __html: currentMenuHelp }}
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
현재 페이지에 대한 도움말이 없습니다.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</SidebarContent>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user