diff --git a/client/src/components/spoolIcon.css b/client/src/components/spoolIcon.css index be6c36b..23583c4 100644 --- a/client/src/components/spoolIcon.css +++ b/client/src/components/spoolIcon.css @@ -15,6 +15,10 @@ height: 4em; } +.spool-icon.no-margin { + margin: 0; +} + .spool-icon * { flex: 1 1 0px; border-radius: 2px; diff --git a/client/src/components/spoolIcon.tsx b/client/src/components/spoolIcon.tsx index 355f792..fb09721 100644 --- a/client/src/components/spoolIcon.tsx +++ b/client/src/components/spoolIcon.tsx @@ -3,13 +3,15 @@ import "./spoolIcon.css"; interface Props { color: string | { colors: string[]; vertical: boolean }; size?: "small" | "large"; + no_margin? : boolean } -export default function SpoolIcon(props: Props) { +export default function SpoolIcon(props: Readonly) { let dirClass = "vertical"; let cols = []; let size = props.size ? props.size : "small"; - + let no_margin = props.no_margin ? "no-margin" : ""; + if (typeof props.color === "string") { cols = [props.color]; } else { @@ -18,7 +20,7 @@ export default function SpoolIcon(props: Props) { } return ( -
+
{cols.map((col) => (
= () => { {t("filament.fields.name")} {t("filament.fields.color_hex")} - {colorObj && } + {colorObj && } + {record?.color_hex && } {t("filament.fields.material")} {t("filament.fields.price")} diff --git a/client/src/pages/spools/show.tsx b/client/src/pages/spools/show.tsx index d96a4e1..86b4e81 100644 --- a/client/src/pages/spools/show.tsx +++ b/client/src/pages/spools/show.tsx @@ -139,7 +139,8 @@ export const SpoolShow: React.FC = () => { {t("spool.fields.id")} {t("spool.fields.filament")} - {colorObj && } + {colorObj && } + {t("spool.fields.price")}