mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Fixes plumbing pill press not highlighting selected option (#92717)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Box,
|
|
||||||
Button,
|
Button,
|
||||||
|
ImageButton,
|
||||||
Input,
|
Input,
|
||||||
LabeledList,
|
LabeledList,
|
||||||
NumberInput,
|
NumberInput,
|
||||||
@@ -34,7 +34,7 @@ type Data = {
|
|||||||
packaging_type: string;
|
packaging_type: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ChemPress = (props) => {
|
export const ChemPress = () => {
|
||||||
const { act, data } = useBackend<Data>();
|
const { act, data } = useBackend<Data>();
|
||||||
const {
|
const {
|
||||||
current_volume,
|
current_volume,
|
||||||
@@ -52,7 +52,7 @@ export const ChemPress = (props) => {
|
|||||||
packaging_types.find((category) => category.cat_name === categoryName) ||
|
packaging_types.find((category) => category.cat_name === categoryName) ||
|
||||||
packaging_types[0];
|
packaging_types[0];
|
||||||
return (
|
return (
|
||||||
<Window width={300} height={330}>
|
<Window width={450} height={340}>
|
||||||
<Window.Content>
|
<Window.Content>
|
||||||
<Section>
|
<Section>
|
||||||
<LabeledList>
|
<LabeledList>
|
||||||
@@ -60,10 +60,11 @@ export const ChemPress = (props) => {
|
|||||||
{packaging_types.map((category, i) => (
|
{packaging_types.map((category, i) => (
|
||||||
<Button.Checkbox
|
<Button.Checkbox
|
||||||
key={category.cat_name}
|
key={category.cat_name}
|
||||||
content={capitalizeAll(category.cat_name)}
|
|
||||||
checked={category.cat_name === shownCategory.cat_name}
|
checked={category.cat_name === shownCategory.cat_name}
|
||||||
onClick={() => setCategoryName(category.cat_name)}
|
onClick={() => setCategoryName(category.cat_name)}
|
||||||
/>
|
>
|
||||||
|
{capitalizeAll(category.cat_name)}
|
||||||
|
</Button.Checkbox>
|
||||||
))}
|
))}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item label="Volume">
|
<LabeledList.Item label="Volume">
|
||||||
@@ -112,7 +113,9 @@ export const ChemPress = (props) => {
|
|||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item label="Styles">
|
<LabeledList.Item label="Styles">
|
||||||
{shownCategory.products.map((design, j) => (
|
{shownCategory.products.map((design, j) => (
|
||||||
<Button
|
<ImageButton
|
||||||
|
asset={['', design.class_name]}
|
||||||
|
imageSize={42}
|
||||||
key={design.ref}
|
key={design.ref}
|
||||||
selected={design.ref === packaging_type}
|
selected={design.ref === packaging_type}
|
||||||
color="transparent"
|
color="transparent"
|
||||||
@@ -121,14 +124,7 @@ export const ChemPress = (props) => {
|
|||||||
ref: design.ref,
|
ref: design.ref,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
/>
|
||||||
<Box
|
|
||||||
className={design.class_name}
|
|
||||||
style={{
|
|
||||||
transform: 'scale(1.5)',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Button>
|
|
||||||
))}
|
))}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
</LabeledList>
|
</LabeledList>
|
||||||
|
|||||||
Reference in New Issue
Block a user