[feat] negodata/front: 협상대화 카드내용 렌더 + 견적상세 헤더·테이블 UI 정리
- 협상대화: 사용 카드 번호/멘트(Slate 서식본)/와일드 조건·메모 표시, SlateRenderer
밑줄·헥스색·{변수} 치환 보정, 말풍선 우측정렬·발신자 아바타 제거
- 견적상세 헤더: DB 컬럼명 라벨 제거, 견적정보/(진행상태+세팅)/상품(이미지) 2열 재배치,
협상카드 탭에 사용 카드 수 표시
- DataTable 행 패딩 축소, 협력사명 아바타 제거, 카드관리 본인 카드 안내문
- orval 재생성(QuotationCardData 신규 필드)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
df68609c49
commit
7186446068
114 files changed
+4731
-5537
No files matched your search
@@ -15,6 +15,8 @@ import {
|
||||
Moon,
|
||||
Building,
|
||||
ChevronRight,
|
||||
Menu,
|
||||
X,
|
||||
} from 'lucide-react';
|
||||
|
||||
interface LayoutProps {
|
||||
@@ -46,7 +48,11 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
const today = new Date().toLocaleDateString('sv-SE');
|
||||
|
||||
const [isDark, setIsDark] = useState(false);
|
||||
const [isSidebarOpen, setIsSidebarOpen] = useState(true);
|
||||
const [isSidebarOpen, setIsSidebarOpen] = useState(true); // 데스크톱 접기 토글
|
||||
const [isMobileOpen, setIsMobileOpen] = useState(false); // 모바일 드로어 열림
|
||||
|
||||
// 사이드바 펼침 여부(라벨/프로필 노출 기준). 모바일 드로어는 항상 펼친 상태로 본다.
|
||||
const expanded = isMobileOpen || isSidebarOpen;
|
||||
|
||||
const toggleDarkMode = () => {
|
||||
setIsDark(!isDark);
|
||||
@@ -61,44 +67,62 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
<div className="min-h-screen bg-background text-foreground flex">
|
||||
{/* 토스트는 sonner <Toaster/>(main.tsx)가 전역으로 처리한다 */}
|
||||
|
||||
{/* 모바일 드로어 백드롭 */}
|
||||
{isMobileOpen && (
|
||||
<div
|
||||
className="fixed inset-0 z-30 bg-black/40 backdrop-blur-xs md:hidden"
|
||||
onClick={() => setIsMobileOpen(false)}
|
||||
aria-hidden
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Main Sidebar */}
|
||||
<aside
|
||||
className={cn(
|
||||
'bg-card border-r border-border flex flex-col justify-between transition-all duration-300 z-30 fixed h-full',
|
||||
isSidebarOpen ? 'w-60' : 'w-16'
|
||||
'bg-card border-r border-border flex flex-col justify-between transition-all duration-300 z-40 fixed inset-y-0 left-0',
|
||||
// 폭: 모바일은 항상 펼친 드로어(w-60), 데스크톱만 접기 토글
|
||||
'w-60',
|
||||
isSidebarOpen ? 'md:w-60' : 'md:w-16',
|
||||
// 모바일 슬라이드 인/아웃 — 데스크톱은 항상 보임
|
||||
isMobileOpen ? 'translate-x-0' : '-translate-x-full',
|
||||
'md:translate-x-0'
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
{/* Sidebar Brand Header */}
|
||||
<div className="h-14 flex items-center justify-between px-4 border-b border-border">
|
||||
{isSidebarOpen ? (
|
||||
<>
|
||||
<Typography as="div" variant="body" className="text-primary font-extrabold tracking-tighter">
|
||||
NegoData
|
||||
</Typography>
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setIsSidebarOpen(false)}
|
||||
className="p-1 h-auto rounded text-muted-foreground"
|
||||
title="메뉴 접기"
|
||||
>
|
||||
<ChevronRight size={14} className="rotate-180 size-3.5" />
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setIsSidebarOpen(true)}
|
||||
className="mx-auto p-1.5 h-auto rounded bg-muted/65 text-muted-foreground"
|
||||
title="메뉴 열기"
|
||||
>
|
||||
<ChevronRight size={14} className="size-3.5" />
|
||||
</Button>
|
||||
{expanded && (
|
||||
<Typography as="div" variant="body" className="text-primary font-extrabold tracking-tighter">
|
||||
NegoData
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
{/* 데스크톱: 사이드바 접기/펼치기 */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setIsSidebarOpen((v) => !v)}
|
||||
className={cn(
|
||||
'hidden md:inline-flex p-1 h-auto rounded text-muted-foreground',
|
||||
!isSidebarOpen && 'mx-auto bg-muted/65'
|
||||
)}
|
||||
title={isSidebarOpen ? '메뉴 접기' : '메뉴 열기'}
|
||||
>
|
||||
<ChevronRight size={14} className={cn('size-3.5', isSidebarOpen && 'rotate-180')} />
|
||||
</Button>
|
||||
|
||||
{/* 모바일: 드로어 닫기 */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setIsMobileOpen(false)}
|
||||
className="md:hidden p-1 h-auto rounded text-muted-foreground"
|
||||
title="메뉴 닫기"
|
||||
>
|
||||
<X size={16} className="size-4" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Nav User Profile Card */}
|
||||
{isSidebarOpen && <SidebarProfileCard user={user} />}
|
||||
{expanded && <SidebarProfileCard user={user} />}
|
||||
|
||||
{/* Nav Items */}
|
||||
<nav className="mt-2 px-3 space-y-1">
|
||||
@@ -107,8 +131,11 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
key={item.type}
|
||||
item={item}
|
||||
isActive={currentPage === item.type}
|
||||
isOpen={isSidebarOpen}
|
||||
onClick={() => setPage(item.type)}
|
||||
isOpen={expanded}
|
||||
onClick={() => {
|
||||
setPage(item.type);
|
||||
setIsMobileOpen(false);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</nav>
|
||||
@@ -123,7 +150,7 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-muted-foreground"
|
||||
>
|
||||
{isDark ? <Sun size={14} className="text-warning size-3.5" /> : <Moon size={14} className="size-3.5" />}
|
||||
{isSidebarOpen && <span>{isDark ? '라이트 모드' : '다크 모드'}</span>}
|
||||
{expanded && <span>{isDark ? '라이트 모드' : '다크 모드'}</span>}
|
||||
</Button>
|
||||
|
||||
{/* Logout btn */}
|
||||
@@ -134,20 +161,33 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
className="w-full justify-start gap-3 py-1.5 px-3 h-auto rounded text-[11px] font-semibold text-destructive hover:bg-destructive/10 hover:text-destructive"
|
||||
>
|
||||
<LogOut size={14} className="size-3.5" />
|
||||
{isSidebarOpen && <span>시스템 로그아웃</span>}
|
||||
{expanded && <span>시스템 로그아웃</span>}
|
||||
</Button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
{/* Main Container Wrapper */}
|
||||
<div
|
||||
className="flex-1 flex flex-col transition-all duration-300"
|
||||
style={{ paddingLeft: isSidebarOpen ? '15rem' : '4rem' }}
|
||||
className={cn(
|
||||
'flex-1 flex flex-col transition-all duration-300',
|
||||
// 모바일: 사이드바가 오버레이라 패딩 없음 / 데스크톱: 사이드바 폭만큼 확보
|
||||
isSidebarOpen ? 'md:pl-60' : 'md:pl-16'
|
||||
)}
|
||||
>
|
||||
{/* Global Header */}
|
||||
<header className="h-14 bg-card border-b border-border flex items-center justify-between px-8 sticky top-0 z-20 shadow-xs backdrop-blur-md bg-opacity-95">
|
||||
<div className="flex items-center gap-4">
|
||||
<Typography as="div" variant="small" className="font-bold">
|
||||
<header className="h-14 bg-card border-b border-border flex items-center justify-between px-4 md:px-8 sticky top-0 z-20 shadow-xs backdrop-blur-md bg-opacity-95">
|
||||
<div className="flex items-center gap-2 md:gap-4 min-w-0">
|
||||
{/* 모바일 햄버거 */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setIsMobileOpen(true)}
|
||||
className="md:hidden p-1.5 h-auto rounded text-muted-foreground"
|
||||
title="메뉴 열기"
|
||||
>
|
||||
<Menu size={18} className="size-[18px]" />
|
||||
</Button>
|
||||
{/* 현재 페이지 — 모바일·데스크톱 모두 표시(로고는 사이드바/드로어 몫) */}
|
||||
<Typography as="div" variant="small" className="font-bold truncate">
|
||||
{pageLabelMap[currentPage]}
|
||||
</Typography>
|
||||
</div>
|
||||
@@ -156,12 +196,12 @@ export default function Layout({ children, currentPage, setPage, onLogout }: Lay
|
||||
</header>
|
||||
|
||||
{/* Content Body Area */}
|
||||
<main className="flex-1 p-8 overflow-y-auto bg-background">
|
||||
<main className="flex-1 p-4 md:p-8 overflow-y-auto bg-background">
|
||||
<div className="max-w-7xl mx-auto space-y-6">{children}</div>
|
||||
</main>
|
||||
|
||||
{/* Compact Admin footer info */}
|
||||
<footer className="h-10 border-t border-border/60 bg-card flex items-center justify-between px-8">
|
||||
<footer className="h-10 border-t border-border/60 bg-card flex items-center justify-between px-4 md:px-8">
|
||||
<Typography variant="mono">Copyright © O2O Inc. All rights reserved</Typography>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -254,27 +294,27 @@ function NavItem({
|
||||
/** 글로벌 헤더 우측 메타 정보 */
|
||||
function HeaderMeta({ user, today }: { user: SidebarUser; today: string }) {
|
||||
return (
|
||||
<div className="flex items-center gap-4">
|
||||
<Typography as="div" variant="caption" className="hidden md:block">
|
||||
<div className="flex items-center gap-3 md:gap-4">
|
||||
<Typography as="div" variant="caption" className="hidden lg:block">
|
||||
기준일시: <span className="font-semibold text-foreground">{today}</span>
|
||||
</Typography>
|
||||
<div className="h-4 w-px bg-border hidden md:block" />
|
||||
<div className="h-4 w-px bg-border hidden lg:block" />
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="inline-block h-2 w-2 rounded-full bg-success animate-pulse" />
|
||||
<Typography as="span" variant="caption">회사:</Typography>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="inline-block h-2 w-2 rounded-full bg-success animate-pulse shrink-0" />
|
||||
<Typography as="span" variant="caption" className="shrink-0">회사:</Typography>
|
||||
<Typography
|
||||
as="span"
|
||||
variant="caption"
|
||||
id="header-company-name"
|
||||
className="font-bold text-foreground underline decoration-1"
|
||||
className="font-bold text-foreground underline decoration-1 truncate max-w-[140px] md:max-w-none"
|
||||
>
|
||||
{user?.company}
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
<div className="h-4 w-px bg-border" />
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="h-4 w-px bg-border hidden lg:block" />
|
||||
<div className="hidden lg:flex items-center gap-2">
|
||||
<Typography as="span" variant="caption">관리자:</Typography>
|
||||
<Typography as="span" variant="caption" className="font-semibold text-foreground">
|
||||
{user?.name} ({user?.loginId})
|
||||
|
||||
@@ -21,7 +21,7 @@ export function PageToolbar({
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-1 flex-col sm:flex-row gap-3">{children}</div>
|
||||
{actions && <div className="flex items-center gap-2">{actions}</div>}
|
||||
{actions && <div className="flex flex-wrap items-center gap-2">{actions}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user