diff --git a/client/src/components/FormField.tsx b/client/src/components/FormField.tsx index 1543493..a529800 100644 --- a/client/src/components/FormField.tsx +++ b/client/src/components/FormField.tsx @@ -33,6 +33,7 @@ export function Btn({ children, variant = "primary", type = "button", + size, disabled, onClick, style, @@ -40,6 +41,7 @@ export function Btn({ children: React.ReactNode; variant?: "primary" | "danger" | "ghost"; type?: "button" | "submit" | "reset"; + size?: "sm"; disabled?: boolean; onClick?: () => void; style?: React.CSSProperties; @@ -47,9 +49,9 @@ export function Btn({ const base: React.CSSProperties = { border: "none", borderRadius: "var(--radius)", - padding: "8px 16px", + padding: size === "sm" ? "4px 10px" : "8px 16px", fontWeight: 600, - fontSize: 13, + fontSize: size === "sm" ? 12 : 13, cursor: disabled ? "not-allowed" : "pointer", opacity: disabled ? 0.6 : 1, }; diff --git a/client/src/pages/CatalogPage.tsx b/client/src/pages/CatalogPage.tsx index b26c856..11ddfda 100644 --- a/client/src/pages/CatalogPage.tsx +++ b/client/src/pages/CatalogPage.tsx @@ -301,7 +301,7 @@ function emptyProduct() { return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" }; } -function f(key: string, set: React.Dispatch>>) { +function f>(key: keyof T, set: React.Dispatch>) { return (e: React.ChangeEvent) => set((prev) => ({ ...prev, [key]: e.target.value })); } diff --git a/client/src/pages/UsersPage.tsx b/client/src/pages/UsersPage.tsx index 8e0fd6b..fe9c2e7 100644 --- a/client/src/pages/UsersPage.tsx +++ b/client/src/pages/UsersPage.tsx @@ -61,7 +61,7 @@ export default function UsersPage() { const openEdit = (user: User) => { setSelected(user); - setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id }); + setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id, vendorId: user.vendor?.id ?? "" }); setError(""); setModal("edit"); };