diff --git a/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx b/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx index a9a1764a1..f7530a0b8 100644 --- a/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx +++ b/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx @@ -23,14 +23,13 @@ interface CategoryDetailsFormProps { onChange: (event: React.ChangeEvent) => void; } -export const CategoryDetailsForm = ({ +export const CategoryDetailsForm: React.FC = ({ category, - classes, disabled, data, onChange, errors -}: CategoryDetailsFormProps) => { +}) => { const intl = useIntl(); return ( @@ -39,34 +38,32 @@ export const CategoryDetailsForm = ({ title={intl.formatMessage(commonMessages.generalInformations)} /> - <> -
- -
- - + JSON.parse(category.descriptionJson))} - name="description" + name="name" + disabled={disabled} + value={data && data.name} onChange={onChange} + error={!!errors.name} + helperText={errors.name} + fullWidth /> - + + + JSON.parse(category.descriptionJson))} + name="description" + onChange={onChange} + />
); diff --git a/src/collections/components/CollectionDetails/CollectionDetails.tsx b/src/collections/components/CollectionDetails/CollectionDetails.tsx index 0d11561a2..35c2ada33 100644 --- a/src/collections/components/CollectionDetails/CollectionDetails.tsx +++ b/src/collections/components/CollectionDetails/CollectionDetails.tsx @@ -24,14 +24,13 @@ export interface CollectionDetailsProps { onChange: (event: React.ChangeEvent) => void; } -const CollectionDetails = ({ - classes, +const CollectionDetails: React.FC = ({ collection, disabled, data, onChange, errors -}: CollectionDetailsProps) => { +}) => { const intl = useIntl(); return ( diff --git a/src/components/VisibilityCard/VisibilityCard.tsx b/src/components/VisibilityCard/VisibilityCard.tsx index 58c324587..5e7ab1a13 100644 --- a/src/components/VisibilityCard/VisibilityCard.tsx +++ b/src/components/VisibilityCard/VisibilityCard.tsx @@ -25,12 +25,6 @@ const styles = (theme: Theme) => }, marginTop: theme.spacing.unit * 3 }, - expandedSwitchContainer: { - "& > div": { - padding: 0 - }, - marginBottom: 0 - }, setPublicationDate: { color: theme.palette.primary.main, cursor: "pointer", @@ -126,21 +120,13 @@ export const VisibilityCard = withStyles(styles, { })} /> -
- -
+ {isPublishedRadio === "false" && ( <> {!isPublicationDate && ( @@ -149,8 +135,7 @@ export const VisibilityCard = withStyles(styles, { onClick={() => setPublicationDate(!isPublicationDate)} > {intl.formatMessage({ - defaultMessage: "Set publication date", - description: "set publication date" + defaultMessage: "Set publication date" })} )} diff --git a/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx b/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx index 55960504b..60797e7a3 100644 --- a/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx +++ b/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx @@ -1,11 +1,5 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { - createStyles, - Theme, - withStyles, - WithStyles -} from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import { RawDraftContentState } from "draft-js"; import React from "react"; @@ -16,15 +10,6 @@ import FormSpacer from "@saleor/components/FormSpacer"; import RichTextEditor from "@saleor/components/RichTextEditor"; import { commonMessages } from "@saleor/intl"; -const styles = (theme: Theme) => - createStyles({ - root: { - display: "grid", - gridColumnGap: theme.spacing.unit * 2 + "px", - gridTemplateColumns: `1fr` - } - }); - interface ProductDetailsFormProps { data: { description: RawDraftContentState; @@ -39,14 +24,13 @@ interface ProductDetailsFormProps { onChange(event: any); } -export const ProductDetailsForm = ({ - classes, +export const ProductDetailsForm: React.FC = ({ data, disabled, errors, initialDescription, onChange -}: ProductDetailsFormProps) => { +}) => { const intl = useIntl(); return (