From d3791b6a235718525c609b00590ca2a3d7314949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dro=C5=84?= Date: Thu, 29 Jun 2023 10:03:36 +0200 Subject: [PATCH] Migrate voucher channel listings to new inputs (#3742) --- .../components/VoucherValue/VoucherValue.tsx | 23 ++++++++----------- .../components/VoucherValue/styles.ts | 2 ++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/discounts/components/VoucherValue/VoucherValue.tsx b/src/discounts/components/VoucherValue/VoucherValue.tsx index f8c7b2e16..552774c1c 100644 --- a/src/discounts/components/VoucherValue/VoucherValue.tsx +++ b/src/discounts/components/VoucherValue/VoucherValue.tsx @@ -7,7 +7,6 @@ import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; import TableHead from "@dashboard/components/TableHead"; import TableRowLink from "@dashboard/components/TableRowLink"; -import TextFieldWithChoice from "@dashboard/components/TextFieldWithChoice"; import { ChannelInput } from "@dashboard/discounts/handlers"; import { DiscountTypeEnum } from "@dashboard/discounts/types"; import { DiscountErrorFragment } from "@dashboard/graphql"; @@ -21,6 +20,7 @@ import { TableCell, Typography, } from "@material-ui/core"; +import { Input, Text } from "@saleor/macaw-ui/next"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; @@ -100,22 +100,21 @@ const VoucherValue: React.FC = props => { return ( - {listing?.name || } + {listing?.name || } {listing ? ( - + {data.discountType === DiscountTypeEnum.VALUE_FIXED ? listing.currency - : "%", - name: "discountType" as keyof FormData, - values: null, - }} + : "%"} + + } helperText={ error ? getDiscountErrorMessage( @@ -136,10 +135,6 @@ const VoucherValue: React.FC = props => { })} value={listing.discountValue || ""} type="number" - fullWidth - inputProps={{ - min: 0, - }} /> ) : ( diff --git a/src/discounts/components/VoucherValue/styles.ts b/src/discounts/components/VoucherValue/styles.ts index 03d6f6024..af98b8484 100644 --- a/src/discounts/components/VoucherValue/styles.ts +++ b/src/discounts/components/VoucherValue/styles.ts @@ -9,6 +9,8 @@ export const useStyles = makeStyles( }, colPrice: { minWidth: 300, + paddingTop: 12, + paddingBottom: 12, }, colType: { fontSize: 14,