refactor: rename navbar components and dimensions to sidebar for improved semantic consistency

This commit is contained in:
Firman Ramdhani
2026-06-22 16:42:32 +07:00
parent 25f3cd3b30
commit edc4e15325
3 changed files with 26 additions and 25 deletions
@@ -5,11 +5,11 @@ import { CoreAppShellConfig, CoreAppShellSlots, CoreAppShellDimensions } from '.
const DEFAULT_DIMENSIONS: Required<CoreAppShellDimensions> = {
headerHeight: 60,
navbarWidth: 260,
navbarMiniWidth: 80,
navbarRailWidth: 54,
utilityBarHeight: 32,
headerHeight: 60,
sidebarWidth: 260,
sidebarMiniWidth: 80,
sidebarRailWidth: 54,
asideWidth: 260,
};
@@ -31,12 +31,12 @@ function CoreAppShellInner({ slots, children }: CoreAppShellInnerProps) {
const navbarWidth = useMemo(() => {
if (isTopNav) return 0;
if (isDoubleSidebar) {
return navbarPanelOpened ? dims.navbarWidth : dims.navbarRailWidth;
return navbarPanelOpened ? dims.sidebarWidth : dims.sidebarRailWidth;
}
if (sidebarVariant === 'mini' && dims.navbarMiniWidth) {
return dims.navbarMiniWidth;
if (sidebarVariant === 'mini' && dims.sidebarMiniWidth) {
return dims.sidebarMiniWidth;
}
return dims.navbarWidth;
return dims.sidebarWidth;
}, [sidebarVariant, dims, isTopNav, isDoubleSidebar, navbarPanelOpened]);
// Determine AppShell Layout
@@ -121,27 +121,27 @@ function CoreAppShellInner({ slots, children }: CoreAppShellInnerProps) {
{isDoubleSidebar ? (
<Flex h="100%" direction="row" wrap="nowrap">
<Box
w={dims.navbarRailWidth}
w={dims.sidebarRailWidth}
h="100%"
style={{
flexShrink: 0,
borderRight: '1px solid var(--mantine-color-default-border)'
}}
>
{slots.navbarRail}
{slots.sidebarRail}
</Box>
{navbarPanelOpened && (
<Box flex={1} h="100%" style={{ overflow: 'hidden' }}>
{slots.navbarPanel}
{slots.sidebarPanel}
</Box>
)}
</Flex>
) : (
slots.navbar
slots.sidebar
)}
</Box>
<Box hiddenFrom="sm" h="100%">
{slots.navbarMobile || slots.navbar}
{slots.sidebarMobile || slots.sidebar}
</Box>
</AppShell.Navbar>
)}
@@ -168,7 +168,8 @@ function CoreAppShellInner({ slots, children }: CoreAppShellInnerProps) {
{showFooter && (
<AppShell.Footer
zIndex={isFooterOffset ? 100 : 105}
// zIndex={isFooterOffset ? 100 : 105}
zIndex={100}
style={
isFooterOffset
? {
@@ -7,9 +7,9 @@ export type DesktopCollapseVariant = 'hide' | 'mini';
export interface CoreAppShellDimensions {
utilityBarHeight?: number | string;
headerHeight?: number | string;
navbarWidth?: number | string;
navbarMiniWidth?: number | string;
navbarRailWidth?: number | string;
sidebarWidth?: number | string;
sidebarMiniWidth?: number | string;
sidebarRailWidth?: number | string;
asideWidth?: number | string;
}
@@ -33,10 +33,10 @@ export interface CoreAppShellConfig {
export interface CoreAppShellSlots {
utilityBar?: ReactNode;
header?: ReactNode;
navbar?: ReactNode;
navbarMobile?: ReactNode;
navbarRail?: ReactNode;
navbarPanel?: ReactNode;
sidebar?: ReactNode;
sidebarMobile?: ReactNode;
sidebarRail?: ReactNode;
sidebarPanel?: ReactNode;
aside?: ReactNode;
footer?: ReactNode;
}