diff --git a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx index e1d972723..55411231e 100644 --- a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx +++ b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx @@ -148,20 +148,18 @@ const CollectionDetailsPage: React.StatelessComponent< } )} > - <> - -
- - + +
+ diff --git a/src/components/RadioGroupField/RadioGroupField.tsx b/src/components/RadioGroupField/RadioGroupField.tsx index 0b2fe0739..85d3f3ad4 100644 --- a/src/components/RadioGroupField/RadioGroupField.tsx +++ b/src/components/RadioGroupField/RadioGroupField.tsx @@ -23,18 +23,16 @@ const styles = createStyles({ "& > span": { padding: "6px" } - }, - secondLabel: { - display: "block", - fontSize: "12px" } }); +interface RadioGroupFieldChoice { + value: string; + label: React.ReactNode; +} + interface RadioGroupFieldProps { - choices: Array<{ - value: string; - label: React.ReactNode; - }>; + choices: RadioGroupFieldChoice[]; className?: string; disabled?: boolean; error?: boolean; diff --git a/src/components/RadioSwitchField/RadioSwitchField.tsx b/src/components/RadioSwitchField/RadioSwitchField.tsx index 77072e8c7..dbff28317 100644 --- a/src/components/RadioSwitchField/RadioSwitchField.tsx +++ b/src/components/RadioSwitchField/RadioSwitchField.tsx @@ -51,13 +51,13 @@ export const RadioSwitchField = withStyles(styles, { secondOptionLabel, value }: RadioSwitchFieldProps & WithStyles) => { - const initialValue = value ? "visible" : "hidden"; + const initialValue = value ? "true" : "false"; const change = event => { onChange({ target: { name: event.target.name, - value: event.target.value === "visible" ? true : false + value: event.target.value === "true" ? true : false } } as any); }; @@ -75,14 +75,14 @@ export const RadioSwitchField = withStyles(styles, { onChange={event => change(event)} > } label={firstOptionLabel} name={name} /> } label={secondOptionLabel} diff --git a/src/configuration/ConfigurationPage.tsx b/src/configuration/ConfigurationPage.tsx index 85d020b8c..afbc61155 100644 --- a/src/configuration/ConfigurationPage.tsx +++ b/src/configuration/ConfigurationPage.tsx @@ -19,14 +19,16 @@ import PageHeader from "../components/PageHeader"; import { PermissionEnum } from "../types/globalTypes"; export interface MenuItem { + description: string; + icon: React.ReactElement; + permission: PermissionEnum; + title: string; + url?: string; +} + +export interface MenuSection { label: string; - menuItems: Array<{ - description: string; - icon: React.ReactElement; - permission: PermissionEnum; - title: string; - url?: string; - }>; + menuItems: MenuItem[]; } const styles = (theme: Theme) => @@ -87,7 +89,7 @@ const styles = (theme: Theme) => }); export interface ConfigurationPageProps { - menu: MenuItem[]; + menu: MenuSection[]; user: User; onSectionClick: (sectionName: string) => void; } diff --git a/src/configuration/index.tsx b/src/configuration/index.tsx index 9c9cf5bfb..cb987e8cc 100644 --- a/src/configuration/index.tsx +++ b/src/configuration/index.tsx @@ -25,9 +25,9 @@ import { siteSettingsUrl } from "@saleor/siteSettings/urls"; import { staffListUrl } from "@saleor/staff/urls"; import { taxSection } from "@saleor/taxes/urls"; import { PermissionEnum } from "@saleor/types/globalTypes"; -import ConfigurationPage, { MenuItem } from "./ConfigurationPage"; +import ConfigurationPage, { MenuSection } from "./ConfigurationPage"; -export function createConfigurationMenu(intl: IntlShape): MenuItem[] { +export function createConfigurationMenu(intl: IntlShape): MenuSection[] { return [ { label: intl.formatMessage({ diff --git a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx index a88c995f6..747712b57 100644 --- a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx +++ b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx @@ -1,5 +1,4 @@ import Button from "@material-ui/core/Button"; - import React from "react"; import { FormattedMessage, useIntl } from "react-intl";