qc: nomer 2 dan 4

Deskripsi:
- button back
- breadcrumb
- active menu

No Issues
This commit is contained in:
2026-01-13 15:10:08 +08:00
parent 5bbbc15c27
commit 80df579499

View File

@@ -73,7 +73,7 @@ export default function DashboardLayout() {
<AppShell <AppShell
padding="lg" padding="lg"
navbar={{ navbar={{
width: 260, width: 300,
breakpoint: "sm", breakpoint: "sm",
collapsed: { mobile: !opened, desktop: !opened }, collapsed: { mobile: !opened, desktop: !opened },
}} }}
@@ -215,8 +215,6 @@ function NavigationDashboard() {
const location = useLocation(); const location = useLocation();
const [permissions, setPermissions] = useState<JsonValue[]>([]); const [permissions, setPermissions] = useState<JsonValue[]>([]);
console.log(location)
useEffect(() => { useEffect(() => {
async function fetchPermissions() { async function fetchPermissions() {
const { data } = await apiFetch.api.user.find.get(); const { data } = await apiFetch.api.user.find.get();
@@ -292,14 +290,19 @@ function NavigationDashboard() {
.map((item) => ( .map((item) => (
<NavLink <NavLink
key={item.path} key={item.path}
active={isActive(item.path as keyof typeof clientRoute)} active={isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")}
leftSection={item.icon} leftSection={item.icon}
label={ label={
<Flex align="center" gap={6}> <Flex align="center" gap={6}>
<Text fw={500}>{item.label}</Text> <Text fw={500}>{item.label}</Text>
{(isActive(item.path as keyof typeof clientRoute) || {(
isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") || (location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") (location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")
) )
&& ( && (
<Badge <Badge
@@ -319,7 +322,10 @@ function NavigationDashboard() {
navigate(clientRoutes[item.path as keyof typeof clientRoute]) navigate(clientRoutes[item.path as keyof typeof clientRoute])
} }
style={{ style={{
backgroundColor: isActive(item.path as keyof typeof clientRoute) backgroundColor: isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")
? "rgba(0,255,200,0.1)" ? "rgba(0,255,200,0.1)"
: "transparent", : "transparent",
borderRadius: "8px", borderRadius: "8px",