diff --git a/src/attributes/components/AttributeDetails/AttributeDetails.tsx b/src/attributes/components/AttributeDetails/AttributeDetails.tsx index 3e31b3e2d..eff953517 100644 --- a/src/attributes/components/AttributeDetails/AttributeDetails.tsx +++ b/src/attributes/components/AttributeDetails/AttributeDetails.tsx @@ -6,7 +6,7 @@ import { useIntl } from "react-intl"; import slugify from "slugify"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import FormSpacer from "@saleor/components/FormSpacer"; import SingleSelectField from "@saleor/components/SingleSelectField"; import { commonMessages } from "@saleor/intl"; @@ -103,14 +103,15 @@ const AttributeDetails: React.FC = ({ value={data.inputType} /> - diff --git a/src/attributes/components/AttributeProperties/AttributeProperties.tsx b/src/attributes/components/AttributeProperties/AttributeProperties.tsx index 4521d4c76..fbbb328d9 100644 --- a/src/attributes/components/AttributeProperties/AttributeProperties.tsx +++ b/src/attributes/components/AttributeProperties/AttributeProperties.tsx @@ -7,7 +7,7 @@ import { FormattedMessage, useIntl } from "react-intl"; import CardSpacer from "@saleor/components/CardSpacer"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import { commonMessages } from "@saleor/intl"; @@ -71,16 +71,17 @@ const AttributeProperties: React.FC = ({ />
- + {data.filterableInStorefront && ( = ({ /> )} - @@ -116,36 +117,40 @@ const AttributeProperties: React.FC = ({
- - - + + + + + + } + checked={data.filterableInDashboard} onChange={onChange} + disabled={disabled} /> - - - + + + + + + } + checked={data.availableInGrid} onChange={onChange} + disabled={disabled} /> diff --git a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx index 91e565d7a..079d5c261 100644 --- a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx +++ b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx @@ -6,7 +6,7 @@ import AppHeader from "@saleor/components/AppHeader"; import { CardSpacer } from "@saleor/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton"; import { Container } from "@saleor/components/Container"; -import { ControlledSwitch } from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import Form from "@saleor/components/Form"; import Grid from "@saleor/components/Grid"; import PageHeader from "@saleor/components/PageHeader"; @@ -126,15 +126,15 @@ const CollectionDetailsPage: React.StatelessComponent< disabled={disabled} onChange={change} > - diff --git a/src/discounts/components/VoucherValue/VoucherValue.tsx b/src/discounts/components/VoucherValue/VoucherValue.tsx index 224d41153..95f8960ec 100644 --- a/src/discounts/components/VoucherValue/VoucherValue.tsx +++ b/src/discounts/components/VoucherValue/VoucherValue.tsx @@ -5,7 +5,7 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import { FormSpacer } from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import RadioGroupField from "@saleor/components/RadioGroupField"; @@ -98,8 +98,8 @@ const VoucherValue = ({ )}
- } + checked={data.applyOncePerOrder} onChange={onChange} - name={"applyOncePerOrder" as keyof FormData} disabled={disabled} /> diff --git a/src/plugins/components/PluginInfo/PluginInfo.tsx b/src/plugins/components/PluginInfo/PluginInfo.tsx index ee93f777e..3454f2d92 100644 --- a/src/plugins/components/PluginInfo/PluginInfo.tsx +++ b/src/plugins/components/PluginInfo/PluginInfo.tsx @@ -6,7 +6,7 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import { commonMessages } from "@saleor/intl"; @@ -69,12 +69,12 @@ const PluginInfo: React.StatelessComponent = ({ description: "plugin status" })} - diff --git a/src/plugins/components/PluginSettings/PluginSettings.tsx b/src/plugins/components/PluginSettings/PluginSettings.tsx index e6e231431..b97973783 100644 --- a/src/plugins/components/PluginSettings/PluginSettings.tsx +++ b/src/plugins/components/PluginSettings/PluginSettings.tsx @@ -3,7 +3,7 @@ import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import makeStyles from "@material-ui/styles/makeStyles"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import { FormErrors } from "@saleor/types"; import { ConfigurationTypeFieldEnum } from "@saleor/types/globalTypes"; import React from "react"; @@ -65,16 +65,16 @@ const PluginSettings: React.StatelessComponent = ({ /> )} {fields[index].type === ConfigurationTypeFieldEnum.BOOLEAN && ( - )} diff --git a/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.tsx b/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.tsx index baf025bce..f3e88d8f4 100644 --- a/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.tsx +++ b/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.tsx @@ -17,7 +17,7 @@ import { FormattedMessage, useIntl } from "react-intl"; import ConfirmButton, { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; @@ -184,10 +184,8 @@ const ShippingZoneRateDialog = withStyles(styles, { description: "order weight range" })} - } + checked={data.noLimits} + onChange={change} + disabled={disabled} /> {!data.noLimits && ( <> @@ -289,15 +290,15 @@ const ShippingZoneRateDialog = withStyles(styles, { description="shipping method" /> - {!data.isFree && ( <> diff --git a/src/taxes/components/TaxConfiguration/TaxConfiguration.tsx b/src/taxes/components/TaxConfiguration/TaxConfiguration.tsx index a044e71f1..7509e7eaf 100644 --- a/src/taxes/components/TaxConfiguration/TaxConfiguration.tsx +++ b/src/taxes/components/TaxConfiguration/TaxConfiguration.tsx @@ -7,7 +7,7 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; -import ControlledSwitch from "@saleor/components/ControlledSwitch"; +import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import { sectionNames } from "@saleor/intl"; @@ -42,33 +42,35 @@ export const TaxConfiguration = withStyles(styles, { - - + + - + + diff --git a/src/theme.ts b/src/theme.ts index 93eafa6d3..e1c5873e0 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -90,6 +90,12 @@ export default (colors: IThemeColors): Theme => padding: "5px 24px 24px" } }, + MuiFormControlLabel: { + root: { + display: "grid", + gridTemplateColumns: "50px 6fr" + } + }, MuiFormLabel: { filled: { color: [[colors.primary], "!important"] as any