Change qty button to not need invasive CSS

This commit is contained in:
Connor Cleveland
2023-10-27 13:29:55 -05:00
parent a61c99b93d
commit ec1966734e
3 changed files with 273 additions and 278 deletions

View File

@@ -192,7 +192,7 @@
"settings_extruder_temp": "Extruder Temp", "settings_extruder_temp": "Extruder Temp",
"settings_bed_temp": "Bed Temp", "settings_bed_temp": "Bed Temp",
"color_hex": "Color", "color_hex": "Color",
"spools": "Spool List" "spools": "Show Spools"
}, },
"fields_help": { "fields_help": {
"name": "Filament name, to distinguish this filament type among others from the same vendor. Should contain the color for example.", "name": "Filament name, to distinguish this filament type among others from the same vendor. Should contain the color for example.",

View File

@@ -131,28 +131,27 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
isLoading={formLoading} isLoading={formLoading}
footerButtons={() => ( footerButtons={() => (
<> <>
<InputNumber <div style={{ display: 'flex', backgroundColor: '#141414', border: '1px solid #424242', borderRadius: '6px' }}>
name="Quantity"
min={1}
style={{ width: '50%', float: 'right', textAlign: 'center' }}
controls={false}
value={quantity}
addonBefore={
<Button type="text" style={{ padding: 0, width: 32, height: 32 }} onClick={decrementQty}> <Button type="text" style={{ padding: 0, width: 32, height: 32 }} onClick={decrementQty}>
<MinusOutlined /> <MinusOutlined />
</Button> </Button>
} <InputNumber
addonAfter={ name="Quantity"
min={1}
id="qty-input"
controls={false}
value={quantity}
>
</InputNumber>
<Button type="text" style={{ padding: 0, width: 32, height: 32 }} onClick={incrementQty}> <Button type="text" style={{ padding: 0, width: 32, height: 32 }} onClick={incrementQty}>
<PlusOutlined /> <PlusOutlined />
</Button> </Button>
} </div>
>
</InputNumber>
<Button type="primary" onClick={() => handleSubmit("list")}>{t("buttons.save")}</Button> <Button type="primary" onClick={() => handleSubmit("list")}>{t("buttons.save")}</Button>
<Button type="primary" onClick={() => handleSubmit("create")}>{t("buttons.saveAndAdd")}</Button> <Button type="primary" onClick={() => handleSubmit("create")}>{t("buttons.saveAndAdd")}</Button>
</> </>
)} )
}
> >
<Form {...formProps} layout="vertical"> <Form {...formProps} layout="vertical">
<Form.Item <Form.Item
@@ -326,7 +325,7 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
<TextArea maxLength={1024} /> <TextArea maxLength={1024} />
</Form.Item> </Form.Item>
</Form> </Form>
</Create> </Create >
); );
}; };

View File

@@ -1,7 +1,3 @@
.ant-input-number-group-addon { #qty-input {
padding: 0 !important;
}
.ant-input-number-input {
text-align: center !important; text-align: center !important;
} }