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
+4 -4
View File
@@ -139,8 +139,8 @@ export default function ShellDemo() {
</Group>
),
header: <MockHeader />,
navbarMobile: <MockMobileDrawer />,
navbar: !withDoubleSidebar ? (
sidebarMobile: <MockMobileDrawer />,
sidebar: !withDoubleSidebar ? (
<Box p="md" h="100%" bg="grape.1" c="grape.9" style={{ borderRight: '1px solid var(--mantine-color-grape-3)' }}>
<Text fw={700} mb="sm">Mock Standard Navbar (bg="grape.1")</Text>
<Stack gap="xs">
@@ -151,7 +151,7 @@ export default function ShellDemo() {
</Stack>
</Box>
) : undefined,
navbarRail: withDoubleSidebar ? (
sidebarRail: withDoubleSidebar ? (
<Stack align="center" gap="lg" pt="md" h="100%" bg="orange.1" c="orange.9">
<Text size="xs" fw={700} style={{ writingMode: 'vertical-rl', transform: 'rotate(180deg)' }}>
Mock Rail (bg="orange.1")
@@ -161,7 +161,7 @@ export default function ShellDemo() {
<SettingsIcon size={24} />
</Stack>
) : undefined,
navbarPanel: withDoubleSidebar ? (
sidebarPanel: withDoubleSidebar ? (
<Box p="md" h="100%" bg="grape.1" c="grape.9" style={{ borderRight: '1px solid var(--mantine-color-grape-3)' }}>
<Text fw={700} mb="sm">Mock Panel (bg="grape.1")</Text>
<Stack gap="xs">
@@ -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;
}