Spaces:
Sleeping
Sleeping
Download frontend/src/features/layout/AppShell.jsx from Caner7/Muhasebe: direct link, hf CLI and curl.
- Browser
- Download file 2.57 kB
-
https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/features/layout/AppShell.jsx
- Command line
-
hf download hf://spaces/Caner7/Muhasebe/frontend/src/features/layout/AppShell.jsx
-
curl -L -o AppShell.jsx https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/features/layout/AppShell.jsx
2.57 kB
| import { | |
| isCatalogNavKey, | |
| SIDEBAR_ECOMMERCE_KICKER, | |
| SIDEBAR_FIRMA_NAV, | |
| SIDEBAR_LUMBER_NAV, | |
| SIDEBAR_MAIN_NAV, | |
| SIDEBAR_TALASH_KICKER, | |
| } from "../../constants/nav.js"; | |
| /** | |
| * Oturum açılmış ana iskelet: kenar çubuğu + içerik alanı (children). | |
| * Modal katmanları children ile `section.content` dışında verilebilir; DOM sırası korunur. | |
| */ | |
| export function AppShell({ user, activePage, onSelectPage, onLogout, children }) { | |
| return ( | |
| <main className="app-shell"> | |
| <aside className="sidebar"> | |
| <h2>Finans Panel</h2> | |
| <p>{user.username}</p> | |
| <nav className="sidebar-nav"> | |
| <div className="sidebar-nav-section"> | |
| <div className="sidebar-kereste-kicker sidebar-ecommerce-kicker">{SIDEBAR_ECOMMERCE_KICKER}</div> | |
| {SIDEBAR_MAIN_NAV.map(([key, label]) => ( | |
| <button | |
| key={key} | |
| type="button" | |
| className={`nav-btn nav-btn-ecommerce ${isCatalogNavKey(key) ? "nav-btn-catalog" : ""} ${ | |
| activePage === key ? "active" : "" | |
| }`} | |
| onClick={() => onSelectPage(key)} | |
| > | |
| {label} | |
| </button> | |
| ))} | |
| </div> | |
| <hr className="sidebar-kereste-divider" /> | |
| <div className="sidebar-nav-section"> | |
| <div className="sidebar-kereste-kicker sidebar-talas-kicker">{SIDEBAR_TALASH_KICKER}</div> | |
| {SIDEBAR_FIRMA_NAV.map(([key, label]) => ( | |
| <button | |
| key={key} | |
| type="button" | |
| className={`nav-btn nav-btn-firma ${activePage === key ? "active" : ""}`} | |
| onClick={() => onSelectPage(key)} | |
| > | |
| {label} | |
| </button> | |
| ))} | |
| </div> | |
| <hr className="sidebar-kereste-divider" /> | |
| <div className="sidebar-nav-section"> | |
| <div className="sidebar-kereste-kicker sidebar-lumber-kicker">Kereste</div> | |
| {SIDEBAR_LUMBER_NAV.map(([key, label]) => ( | |
| <button | |
| key={key} | |
| type="button" | |
| className={`nav-btn nav-btn-kereste ${activePage === key ? "active" : ""}`} | |
| onClick={() => onSelectPage(key)} | |
| > | |
| {label} | |
| </button> | |
| ))} | |
| </div> | |
| </nav> | |
| <button className="secondary full logout-btn" type="button" onClick={onLogout}> | |
| Cikis Yap | |
| </button> | |
| </aside> | |
| {children} | |
| </main> | |
| ); | |
| } | |