Client: Added color edit

This commit is contained in:
Donkie
2023-06-03 21:33:14 +02:00
parent d74393d12d
commit 50abc5c74f
4 changed files with 53 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
import React from "react";
import { IResourceComponentsProps } from "@refinedev/core";
import { Create, useForm, useSelect } from "@refinedev/antd";
import { Form, Input, Select, InputNumber } from "antd";
import { Form, Input, Select, InputNumber, ColorPicker } from "antd";
import TextArea from "antd/es/input/TextArea";
import { IVendor } from "../vendors/model";
@@ -39,6 +39,20 @@ export const FilamentCreate: React.FC<IResourceComponentsProps> = () => {
>
<Select {...selectProps} allowClear />
</Form.Item>
<Form.Item
label="Color"
name={["color_hex"]}
rules={[
{
required: false,
},
]}
getValueFromEvent={(e) => {
return e?.toHex();
}}
>
<ColorPicker format="hex" />
</Form.Item>
<Form.Item
label="Material"
help="E.g. PLA, ABS, PETG, etc."