Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

style: topbar full width

Brad Barbin4cbb75d47829
diff --git a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
index 44993d3432..2e0fe81aa4 100644
--- a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
+++ b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx
@@ -86,7 +86,7 @@ export const CollapsibleSidebar = ({
variants={variants}
className="relative flex h-[calc(100dvh-49px)]"
>
- <div className="h-full w-full overflow-y-scroll scrollbar-thin bg-card border-r border-border">
+ <div className="h-full w-full overflow-y-scroll scrollbar-thin bg-background border-r border-border">
{isOpen ? children : null}
</div>
</motion.div>
diff --git a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
index 22ceaecf20..d1b0fb9643 100644
--- a/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
+++ b/apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
@@ -1,10 +1,8 @@
-import { Button, VStack, cn, useDisclosure } from "@carbon/react";
+import { VStack, cn, useDisclosure } from "@carbon/react";
import { Link, useMatches } from "@remix-run/react";
import { forwardRef, type AnchorHTMLAttributes } from "react";
-import { BsFillHexagonFill } from "react-icons/bs";
import { z } from "zod";
-import { useModules, useOptimisticLocation, useUser } from "~/hooks";
-import { useMode } from "~/hooks/useMode";
+import { useModules, useOptimisticLocation } from "~/hooks";
import type { Authenticated, NavItem } from "~/types";
export const ModuleHandle = z.object({
@@ -12,10 +10,6 @@ export const ModuleHandle = z.object({
});
const PrimaryNavigation = () => {
- const { company } = useUser();
- const mode = useMode();
- const logo = mode === "dark" ? company?.logoDarkIcon : company?.logoLightIcon;
-
const navigationPanel = useDisclosure();
const location = useOptimisticLocation();
const currentModule = getModule(location.pathname);
@@ -36,7 +30,7 @@ const PrimaryNavigation = () => {
<nav
data-state={navigationPanel.isOpen ? "expanded" : "collapsed"}
className={cn(
- "bg-background py-[3px] group z-10 h-full w-14 data-[state=expanded]:w-[13rem]",
+ "bg-background py-2 group z-10 h-full w-14 data-[state=expanded]:w-[13rem]",
"border-r border-border data-[state=expanded]:shadow-xl",
"transition-width duration-200",
"hide-scrollbar flex flex-col justify-between overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"
@@ -49,20 +43,6 @@ const PrimaryNavigation = () => {
className="flex flex-col justify-between h-full px-2"
>
<VStack spacing={1}>
- <Button isIcon asChild variant="ghost" size="lg">
- <Link to="/">
- {logo ? (
- <img
- src={logo}
- alt={`${company.name} logo`}
- className="w-full h-auto rounded"
- />
- ) : (
- <BsFillHexagonFill />
- )}
- </Link>
- </Button>
-
{links.map((link) => {
const m = getModule(link.to);
@@ -151,6 +131,6 @@ NavigationIconLink.displayName = "NavigationIconLink";
export default PrimaryNavigation;
-function getModule(link: string) {
+export function getModule(link: string) {
return link.split("/")?.[2];
}
diff --git a/apps/erp/app/components/Layout/Topbar/Breadcrumbs.tsx b/apps/erp/app/components/Layout/Topbar/Breadcrumbs.tsx
index 269cb9010d..9908b82467 100644
--- a/apps/erp/app/components/Layout/Topbar/Breadcrumbs.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Breadcrumbs.tsx
@@ -67,21 +67,28 @@ const Breadcrumbs = () => {
.filter(Boolean);
const isMobile = useIsMobile();
+ const { company } = useUser();
+ const mode = useMode();
+ const logo = mode === "dark" ? company?.logoDarkIcon : company?.logoLightIcon;
return (
<HStack className="items-center h-full -ml-2" spacing={0}>
+ <Button isIcon asChild variant="ghost" size="lg">
+ <Link to="/">
+ {logo ? (
+ <img
+ src={logo}
+ alt={`${company.name} logo`}
+ className="w-full h-auto rounded"
+ />
+ ) : (
+ <BsFillHexagonFill />
+ )}
+ </Link>
+ </Button>
+
<BreadcrumbsBase className="line-clamp-1">
- {isMobile ? (
- <BreadcrumbItem>
- <Button isIcon asChild variant="ghost">
- <Link to="/">
- <BsFillHexagonFill />
- </Link>
- </Button>
- </BreadcrumbItem>
- ) : (
- <CompanyBreadcrumb />
- )}
+ {!isMobile && <CompanyBreadcrumb />}
{breadcrumbs.map((breadcrumb, i) => (
<BreadcrumbItem key={i}>
<BreadcrumbLink
diff --git a/apps/erp/app/components/Layout/Topbar/Topbar.tsx b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
index 49d6fbdf45..66111abef0 100644
--- a/apps/erp/app/components/Layout/Topbar/Topbar.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
@@ -13,11 +13,14 @@ const Topbar = () => {
const notificationsKey = `${user.id}:${user.company.id}`;
return (
- <div className="flex bg-background text-foreground border-b border-border px-4 top-0 sticky z-10 space-x-4 justify-between items-center">
- <Breadcrumbs />
-
- <HStack spacing={2} className="justify-end py-2">
+ <div className="flex bg-background text-foreground border-b border-border px-4 top-0 sticky z-10 items-center">
+ <div className="flex-1">
+ <Breadcrumbs />
+ </div>
+ <div className="flex-1 flex justify-center">
{permissions.is("employee") ? <Search /> : <div />}
+ </div>
+ <HStack spacing={2} className="flex-1 justify-end py-2">
<Feedback />
<CreateMenu />
<Notifications key={notificationsKey} />
diff --git a/apps/erp/app/routes/x+/_layout.tsx b/apps/erp/app/routes/x+/_layout.tsx
index abd5bf6930..387427c6db 100644
--- a/apps/erp/app/routes/x+/_layout.tsx
+++ b/apps/erp/app/routes/x+/_layout.tsx
@@ -134,20 +134,13 @@ export default function AuthenticatedRoute() {
<CarbonProvider session={session}>
<RealtimeDataProvider>
<TooltipProvider>
- <div className="flex-none" />
- <div className="h-screen min-h-[0px] basis-0 flex-1">
- <div className="flex h-full">
+ <div className="flex flex-col h-screen">
+ <Topbar />
+ <div className="flex flex-1 h-[calc(100vh-49px)]">
<PrimaryNavigation />
- <div className="flex w-full h-full">
- <div className="w-full h-full flex-1 overflow-hidden">
- <main className="h-full flex flex-col flex-1 max-w-[100vw] sm:max-w-[calc(100vw-56px)] overflow-hidden bg-muted">
- <Topbar />
- <main className="flex-1 overflow-y-auto scrollbar-hide h-[calc(100dvh-49px)]">
- <Outlet />
- </main>
- </main>
- </div>
- </div>
+ <main className="flex-1 overflow-y-auto scrollbar-hide bg-muted">
+ <Outlet />
+ </main>
</div>
</div>
</TooltipProvider>
diff --git a/apps/erp/app/routes/x+/account+/_layout.tsx b/apps/erp/app/routes/x+/account+/_layout.tsx
index 4a9c57240b..3b570b2d55 100644
--- a/apps/erp/app/routes/x+/account+/_layout.tsx
+++ b/apps/erp/app/routes/x+/account+/_layout.tsx
@@ -25,10 +25,10 @@ export default function AccountRoute() {
return (
<VStack
- className="flex w-full h-full items-center justify-start"
+ className="flex w-full h-full items-center justify-start bg-background"
spacing={4}
>
- <div className="flex bg-card border-b border-border py-8 px-2 w-full justify-center">
+ <div className="flex bg-background border-b border-border py-8 px-2 w-full justify-center">
<div className="w-full max-w-[60rem]">
<Heading size="h3">Account Settings</Heading>
</div>