260205_05_ENH: 1차 lg 수정 요청사항 반영
This commit is contained in:
@@ -13,7 +13,7 @@ import TotalFilter from "./TotalFilter";
|
||||
import CategoryFilter, {CategoryFilterValue} from "./CategoryFilter";
|
||||
import ExcelDownloadButton from "./ExcelDownloadButton";
|
||||
import {LayoutFilterProvider} from "./LayoutFilterContext";
|
||||
import {PRODUCTS_FILTER_ITEM} from "@/const/lgConst";
|
||||
import {LAST_YEAR, PRODUCTS_FILTER_ITEM} from "@/const/lgConst";
|
||||
import {ProductsFilterItem} from "@/types/lg";
|
||||
import {ArrowUp} from "lucide-react";
|
||||
|
||||
@@ -38,6 +38,7 @@ export const buildDefaultCategoryValue = (categoryFilterItems: ProductsFilterIte
|
||||
const initTarget = firstTarget ?? CategoryTargetData.PROFILE;
|
||||
|
||||
return {
|
||||
year: LAST_YEAR,
|
||||
product: initProduct,
|
||||
type: initType,
|
||||
target: initTarget,
|
||||
@@ -118,73 +119,79 @@ const MainLayout = ({ children }: MainLayoutProps) => {
|
||||
<LayoutFilterProvider
|
||||
value={isTotal? { isTotal: true, filterValue: totalValue } : { isTotal: false, filterValue: categoryValue }}
|
||||
>
|
||||
<Header
|
||||
activeTopId={activeTop.id}
|
||||
onNavigate={movePage}
|
||||
/>
|
||||
<div className="flex-1 min-h-0 flex flex-col bg-lg-main-body p-1 pl-6">
|
||||
<SubMenu
|
||||
subMenu={subMenus}
|
||||
activeSubId={activeSub.id}
|
||||
<Header
|
||||
activeTopId={activeTop.id}
|
||||
onNavigate={movePage}
|
||||
/>
|
||||
<div className="flex-1 min-h-0 flex flex-col pr-4">
|
||||
<div className="bg-card lg-tab-content flex-1 min-h-0 flex flex-col overflow-hidden">
|
||||
<div className="shrink-0 flex items-center justify-between px-2 py-1">
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleFilter}
|
||||
className={cn(
|
||||
"inline-flex items-center gap-2 font-semibold text-gray-900 content-text-sm",
|
||||
"select-none"
|
||||
)}
|
||||
>
|
||||
필터 <span className="text-sm leading-none">{isFilterOpen ? "▲" : "▼"}</span>
|
||||
</button>
|
||||
|
||||
<ExcelDownloadButton/>
|
||||
</div>
|
||||
|
||||
{isFilterOpen && (
|
||||
<div className="shrink-0">
|
||||
{isTotal ? (
|
||||
<TotalFilter filters={totalFilters} value={totalValue} onChange={setTotalValue} />
|
||||
) : (
|
||||
<CategoryFilter filterItems={categoryFilterItems} value={categoryValue} onChange={setCategoryValue} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="relative flex-1 min-h-0">
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onScroll={onScrollContent}
|
||||
className="h-full overflow-auto"
|
||||
>
|
||||
<div className="p-3 pb-8">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{showScrollTop && (
|
||||
<div className="flex-1 min-h-0 flex flex-col bg-lg-main-body p-1 pl-6">
|
||||
<SubMenu
|
||||
subMenu={subMenus}
|
||||
activeSubId={activeSub.id}
|
||||
onNavigate={movePage}
|
||||
/>
|
||||
<div className="flex-1 min-h-0 flex flex-col pr-4">
|
||||
<div className="bg-card lg-tab-content flex-1 min-h-0 flex flex-col overflow-hidden">
|
||||
<div className="shrink-0 flex items-center justify-between px-2 py-1">
|
||||
<div className="flex">
|
||||
<button
|
||||
type="button"
|
||||
onClick={scrollToTop}
|
||||
aria-label="위로 가기"
|
||||
onClick={toggleFilter}
|
||||
className={cn(
|
||||
"absolute -bottom-2 right-4 z-20",
|
||||
"h-8 w-8 rounded-full",
|
||||
"bg-gray-900/80 text-white hover:bg-primary",
|
||||
"flex items-center justify-center"
|
||||
"inline-flex items-center gap-2 font-semibold text-gray-900 content-text-sm",
|
||||
"select-none"
|
||||
)}
|
||||
>
|
||||
<ArrowUp className="h-5 w-5" />
|
||||
필터 <span className="text-sm leading-none">{isFilterOpen ? "▲" : "▼"}</span>
|
||||
</button>
|
||||
{isTotal && (
|
||||
<div className={"ml-5 content-text-sm"}>
|
||||
페이지에 대한 설명
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<ExcelDownloadButton/>
|
||||
</div>
|
||||
|
||||
{isFilterOpen && (
|
||||
<div className="shrink-0">
|
||||
{isTotal ? (
|
||||
<TotalFilter filters={totalFilters} value={totalValue} onChange={setTotalValue} />
|
||||
) : (
|
||||
<CategoryFilter filterItems={categoryFilterItems} value={categoryValue} onChange={setCategoryValue} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="relative flex-1 min-h-0">
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onScroll={onScrollContent}
|
||||
className="h-full overflow-auto"
|
||||
>
|
||||
<div className="p-3 pb-8">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{showScrollTop && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={scrollToTop}
|
||||
aria-label="위로 가기"
|
||||
className={cn(
|
||||
"absolute -bottom-2 right-4 z-20",
|
||||
"h-8 w-8 rounded-full",
|
||||
"bg-gray-900/80 text-white hover:bg-primary",
|
||||
"flex items-center justify-center"
|
||||
)}
|
||||
>
|
||||
<ArrowUp className="h-5 w-5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</LayoutFilterProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user