내비게이션, 테마 적용
This commit is contained in:
@@ -6,20 +6,25 @@ import { ThemeSelectBox } from "./ThemeSelectBox";
|
||||
import { LanguageSelectBox } from "./LanguageSelectBox";
|
||||
import { UserProfileBox } from "./UserProfileBox";
|
||||
import { useSettingsStore } from "@/store/useSettingsStore";
|
||||
|
||||
const menuItems = [
|
||||
{ name: "Landing", path: "/" },
|
||||
{ name: "Home", path: "/" },
|
||||
{ name: "Feedback", path: "/feedbacks" },
|
||||
{ name: "Issue", path: "/issues" },
|
||||
];
|
||||
export function Header() {
|
||||
const projectId = useSettingsStore((state) => state.projectId);
|
||||
const channelId = useSettingsStore((state) => state.channelId);
|
||||
const getFullPath = (path) => {
|
||||
if (path === "/")
|
||||
return `/projects/${projectId}`; // Landing 페이지 경로 예시
|
||||
if (path.startsWith("/")) {
|
||||
return `/projects/${projectId}/channels/4${path}`; // 채널 ID는 4로 고정
|
||||
return `/`; // Landing 페이지 경로 예시
|
||||
if (path.startsWith("/feedbacks")) {
|
||||
return `/projects/${projectId}/channels/${channelId}${path}`;
|
||||
}
|
||||
if (path.startsWith("/issues")){
|
||||
return `/projects/${projectId}${path}`;
|
||||
}
|
||||
return path;
|
||||
};
|
||||
return (_jsxs("header", { className: "flex h-16 items-center border-b px-4", children: [_jsx(ProjectSelectBox, {}), _jsx(Separator, { orientation: "vertical", className: "mx-4 h-8" }), _jsx("nav", { className: "flex items-center space-x-4 lg:space-x-6 flex-1", children: menuItems.map((item) => (_jsx(NavLink, { to: getFullPath(item.path), className: ({ isActive }) => `text-sm font-medium transition-colors hover:text-primary ${!isActive ? "text-muted-foreground" : ""}`, children: item.name }, item.name))) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(ThemeSelectBox, {}), _jsx(LanguageSelectBox, {}), _jsx(UserProfileBox, {})] })] }));
|
||||
return (_jsxs("header", { className: "flex h-16 items-center border-b px-4", children: [_jsx(ProjectSelectBox, { className: "mr-4"}), _jsx("nav", { className: "flex items-center space-x-4 lg:space-x-6 flex-1 ml-8", children: menuItems.map((item) => (_jsx(NavLink, { to: getFullPath(item.path), className: ({ isActive }) => `text-sm font-medium transition-colors hover:text-primary ${!isActive ? "text-muted-foreground" : ""}`, children: item.name }, item.name))) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(ThemeSelectBox, {}), _jsx(LanguageSelectBox, {}), _jsx(UserProfileBox, {})] })] }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user