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: add file size limit indicators

Brad Barbinaaf1efbc30fe
diff --git a/apps/erp/app/modules/account/ui/Profile/ProfilePhotoForm.tsx b/apps/erp/app/modules/account/ui/Profile/ProfilePhotoForm.tsx
index b6ad55c03a..09fe66f693 100644
--- a/apps/erp/app/modules/account/ui/Profile/ProfilePhotoForm.tsx
+++ b/apps/erp/app/modules/account/ui/Profile/ProfilePhotoForm.tsx
@@ -1,11 +1,19 @@
import { SUPABASE_URL, useCarbon } from "@carbon/auth";
-import { Button, File as FileUpload, toast, VStack } from "@carbon/react";
+import {
+ Badge,
+ Button,
+ File as FileUpload,
+ toast,
+ VStack
+} from "@carbon/react";
import type { ChangeEvent } from "react";
import { useSubmit } from "react-router";
import { Avatar } from "~/components";
import { path } from "~/utils/path";
import type { Account } from "../../types";
+const maxSizeMB = 10;
+
type ProfilePhotoFormProps = {
user: Account;
};
@@ -140,6 +148,7 @@ const ProfilePhotoForm = ({ user }: ProfilePhotoFormProps) => {
Remove
</Button>
)}
+ <Badge variant="outline">{maxSizeMB}MB limit</Badge>
</VStack>
);
};
diff --git a/apps/erp/app/modules/settings/ui/Company/CompanyLogoForm.tsx b/apps/erp/app/modules/settings/ui/Company/CompanyLogoForm.tsx
index a385c3d8ee..02d8661962 100644
--- a/apps/erp/app/modules/settings/ui/Company/CompanyLogoForm.tsx
+++ b/apps/erp/app/modules/settings/ui/Company/CompanyLogoForm.tsx
@@ -19,6 +19,8 @@ interface CompanyLogoFormProps {
icon?: boolean;
}
+export const maxSizeMB = 10;
+
const CompanyLogoForm = ({
company,
mode,
@@ -69,7 +71,7 @@ const CompanyLogoForm = ({
}
// Validate file size (10 MB limit)
- const maxSizeMB = 10;
+
const maxSizeBytes = maxSizeMB * 1024 * 1024;
if (logo.size > maxSizeBytes) {
toast.error(
diff --git a/apps/erp/app/routes/x+/settings+/logos.tsx b/apps/erp/app/routes/x+/settings+/logos.tsx
index dbbeb55d1e..0a2ebbf78c 100644
--- a/apps/erp/app/routes/x+/settings+/logos.tsx
+++ b/apps/erp/app/routes/x+/settings+/logos.tsx
@@ -1,5 +1,6 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import {
+ Badge,
Card,
CardContent,
CardDescription,
@@ -21,6 +22,7 @@ import {
updateLogoLight,
updateLogoLightIcon
} from "~/modules/settings";
+import { maxSizeMB } from "~/modules/settings/ui/Company/CompanyLogoForm";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
@@ -74,7 +76,11 @@ export default function LogosRoute() {
return (
<ScrollArea className="w-full h-[calc(100dvh-49px)]">
<VStack spacing={4} className="py-12 px-4 max-w-[60rem] h-full mx-auto">
- <Heading size="h3">Logos</Heading>
+ <div className="flex w-full justify-between items-center gap-1">
+ <Heading size="h3">Logos</Heading>
+ <Badge variant="outline">{maxSizeMB}MB limit</Badge>
+ </div>
+
<div className="grid grid-cols-2 gap-4 w-full">
<Card>
<CardHeader>