Display correct weight unit
This commit is contained in:
parent
8173624fca
commit
d5f6f27b2c
3 changed files with 5 additions and 6 deletions
|
@ -105,7 +105,7 @@ const ProductTypeCreatePage: React.FC<ProductTypeCreatePageProps> = ({
|
|||
<ProductTypeShipping
|
||||
disabled={disabled}
|
||||
data={data}
|
||||
defaultWeightUnit={defaultWeightUnit}
|
||||
weightUnit={defaultWeightUnit}
|
||||
onChange={change}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -199,7 +199,7 @@ const ProductTypeDetailsPage: React.FC<ProductTypeDetailsPageProps> = ({
|
|||
<ProductTypeShipping
|
||||
disabled={disabled}
|
||||
data={data}
|
||||
defaultWeightUnit={defaultWeightUnit}
|
||||
weightUnit={productType?.weight?.unit || defaultWeightUnit}
|
||||
onChange={change}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -6,21 +6,20 @@ import { useIntl } from "react-intl";
|
|||
|
||||
import CardTitle from "@saleor/components/CardTitle";
|
||||
import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox";
|
||||
import { WeightUnitsEnum } from "../../../types/globalTypes";
|
||||
|
||||
interface ProductTypeShippingProps {
|
||||
data: {
|
||||
isShippingRequired: boolean;
|
||||
weight: number | null;
|
||||
};
|
||||
defaultWeightUnit: WeightUnitsEnum;
|
||||
weightUnit: string;
|
||||
disabled: boolean;
|
||||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
}
|
||||
|
||||
const ProductTypeShipping: React.FC<ProductTypeShippingProps> = ({
|
||||
data,
|
||||
defaultWeightUnit,
|
||||
weightUnit,
|
||||
disabled,
|
||||
onChange
|
||||
}) => {
|
||||
|
@ -48,7 +47,7 @@ const ProductTypeShipping: React.FC<ProductTypeShippingProps> = ({
|
|||
{data.isShippingRequired && (
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
InputProps={{ endAdornment: defaultWeightUnit }}
|
||||
InputProps={{ endAdornment: weightUnit }}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Weight"
|
||||
})}
|
||||
|
|
Loading…
Reference in a new issue