Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix syntax

Krzysztof Bialoglowicz8cfe1b804ed9
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx b/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
index 6a7aeda38b..6b93e08ae9 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
@@ -25,25 +25,24 @@ const VoucherInfo = ({
variant,
onChange
}: VoucherInfoProps) => {
- const onGenerateCode = () => {
+ const onGenerateCode = () =>
onChange({
target: {
name: "code",
value: generateCode(10)
}
});
- };
return (
<Card>
<CardTitle
title={i18n.t("General Information")}
toolbar={
- variant === "create" ? (
+ variant === "create" && (
<Button color="primary" onClick={onGenerateCode}>
{i18n.t("Generate Code")}
</Button>
- ) : null
+ )
}
/>
<CardContent>
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherValue/VoucherValue.tsx b/saleor/static/dashboard-next/discounts/components/VoucherValue/VoucherValue.tsx
index 8222fe0463..8529ef79a8 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherValue/VoucherValue.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherValue/VoucherValue.tsx
@@ -70,7 +70,7 @@ const VoucherValue = ({
}}
/>
<FormSpacer />
- {variant === "update" ? (
+ {variant === "update" && (
<>
<RadioGroupField
choices={voucherTypeChoices}
@@ -84,7 +84,7 @@ const VoucherValue = ({
/>
<FormSpacer />
</>
- ) : null}
+ )}
<Hr />
<FormSpacer />
<ControlledSwitch