Client: Improved layout of new spool icon

This commit is contained in:
Donkie
2023-07-10 12:40:32 +02:00
parent cfef2beb47
commit c8974c505d
2 changed files with 54 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import {
DateField, DateField,
CloneButton, CloneButton,
} from "@refinedev/antd"; } from "@refinedev/antd";
import { Table, Space, Button } from "antd"; import { Table, Space, Button, Row, Col } from "antd";
import { NumberFieldUnit } from "../../components/numberField"; import { NumberFieldUnit } from "../../components/numberField";
import dayjs from "dayjs"; import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"; import utc from "dayjs/plugin/utc";
@@ -158,25 +158,32 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
filters={useListFiltersForField(dataSource, "name")} filters={useListFiltersForField(dataSource, "name")}
filteredValue={getFiltersForField(typedFilters, "name")} filteredValue={getFiltersForField(typedFilters, "name")}
render={(value, record: IFilament) => { render={(value, record: IFilament) => {
return ( return {
<> props: {
style: {
paddingLeft: 0,
paddingTop: 0,
paddingBottom: 0,
},
},
children: (
<Row wrap={false} justify="space-around" align="middle">
{record.color_hex && ( {record.color_hex && (
<Col flex="none">
<Icon <Icon
component={SpoolIcon} component={SpoolIcon}
style={{ style={{
color: "#" + record.color_hex, color: "#" + record.color_hex,
fontSize: 40, fontSize: 42,
verticalAlign: "middle",
marginLeft: -10,
marginRight: 0, marginRight: 0,
marginTop: -20,
marginBottom: -20,
}} }}
/> />
</Col>
)} )}
{value} <Col flex="auto">{value}</Col>
</> </Row>
); ),
};
}} }}
/> />
<Table.Column <Table.Column

View File

@@ -9,7 +9,7 @@ import {
TextField, TextField,
CloneButton, CloneButton,
} from "@refinedev/antd"; } from "@refinedev/antd";
import { Table, Space, Button } from "antd"; import { Table, Space, Button, Row, Col } from "antd";
import { NumberFieldUnit } from "../../components/numberField"; import { NumberFieldUnit } from "../../components/numberField";
import dayjs from "dayjs"; import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"; import utc from "dayjs/plugin/utc";
@@ -151,25 +151,32 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
filters={useListFiltersForField(dataSource, "filament_name")} filters={useListFiltersForField(dataSource, "filament_name")}
filteredValue={getFiltersForField(typedFilters, "filament_name")} filteredValue={getFiltersForField(typedFilters, "filament_name")}
render={(value, record: ISpool) => { render={(value, record: ISpool) => {
return ( return {
<> props: {
style: {
paddingLeft: 0,
paddingTop: 0,
paddingBottom: 0,
},
},
children: (
<Row wrap={false} justify="space-around" align="middle">
{record.filament.color_hex && ( {record.filament.color_hex && (
<Col flex="none">
<Icon <Icon
component={SpoolIcon} component={SpoolIcon}
style={{ style={{
color: "#" + record.filament.color_hex, color: "#" + record.filament.color_hex,
fontSize: 40, fontSize: 42,
verticalAlign: "middle",
marginLeft: -10,
marginRight: 0, marginRight: 0,
marginTop: -20,
marginBottom: -20,
}} }}
/> />
</Col>
)} )}
{value} <Col flex="auto">{value}</Col>
</> </Row>
); ),
};
}} }}
/> />
<Table.Column <Table.Column