Fix issues

This commit is contained in:
Krzysztof Bialoglowicz 2019-09-12 12:38:23 +02:00
parent a5762f8e0d
commit 2e488f9436
10 changed files with 48 additions and 55 deletions

View file

@ -144,7 +144,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
description="add attribute as column in product list table"
/>
<Typography variant="caption">
<FormattedMessage defaultMessage="If enable this attribute can be used as a column in product table." />
<FormattedMessage defaultMessage="If enabled this attribute can be used as a column in product table." />
</Typography>
</>
}

View file

@ -150,6 +150,7 @@ const CollectionCreatePage: React.StatelessComponent<
errors={formErrors}
disabled={disabled}
onChange={change}
translate="collection"
/>
</CardContent>
</Card>

View file

@ -125,6 +125,7 @@ const CollectionDetailsPage: React.StatelessComponent<
errors={formErrors}
disabled={disabled}
onChange={change}
translate="collection"
>
<ControlledCheckbox
name={"isFeatured" as keyof CollectionDetailsPageFormData}

View file

@ -18,6 +18,9 @@ export interface AppHeaderProps {
const styles = (theme: Theme) =>
createStyles({
backArrow: {
fontSize: 30
},
menuButton: {
flex: "0 0 auto",
marginLeft: theme.spacing.unit * -2,
@ -25,9 +28,6 @@ const styles = (theme: Theme) =>
marginTop: -theme.spacing.unit * 2
},
root: {
"& svg": {
fontSize: 30
},
"&:hover": {
color: theme.typography.body2.color
},
@ -60,7 +60,7 @@ const AppHeader = withStyles(styles, { name: "AppHeader" })(
anchor ? (
<Portal container={anchor.current}>
<div className={classes.root} onClick={onBack}>
<ArrowBackIcon />
<ArrowBackIcon className={classes.backArrow} />
{children ? (
<Typography className={classes.title}>{children}</Typography>
) : (

View file

@ -45,12 +45,10 @@ const styles = (theme: Theme) =>
backgroundColor: fade(theme.palette.primary.main, 0.2)
},
backgroundColor: "transparent"
}
},
padding: 6
},
root: {
"& button": {
padding: 6
},
color: theme.palette.text.secondary,
flexShrink: 0,
margin: `0 ${theme.spacing.unit * 2.5}px`

View file

@ -43,6 +43,7 @@ interface VisibilityCardProps extends WithStyles<typeof styles> {
errors: { [key: string]: string };
disabled?: boolean;
onChange(event: any);
translate: string;
}
export const VisibilityCard = withStyles(styles, {
@ -54,7 +55,8 @@ export const VisibilityCard = withStyles(styles, {
data: { isPublished, publicationDate },
errors,
disabled,
onChange
onChange,
translate
}: VisibilityCardProps) => {
const intl = useIntl();
const [isPublicationDate, setPublicationDate] = React.useState(
@ -75,7 +77,8 @@ export const VisibilityCard = withStyles(styles, {
defaultMessage: "since {date}"
},
{
date: localizeDate(publicationDate)
date: localizeDate(publicationDate),
description: translate
}
)
: null
@ -89,7 +92,8 @@ export const VisibilityCard = withStyles(styles, {
defaultMessage: "will be visible from {date}"
},
{
date: localizeDate(publicationDate)
date: localizeDate(publicationDate),
description: translate
}
)
: null

View file

@ -23,50 +23,36 @@ export interface SaleInfoProps {
onChange: (event: React.ChangeEvent<any>) => void;
}
const styles = (theme: Theme) =>
createStyles({
root: {
display: "grid",
gridColumnGap: theme.spacing.unit * 2 + "px",
gridTemplateColumns: "1fr"
}
});
const SaleInfo: React.FC<SaleInfoProps> = ({
data,
disabled,
errors,
onChange
}) => {
const intl = useIntl();
const SaleInfo = withStyles(styles, {
name: "SaleInfo"
})(
({
classes,
data,
disabled,
errors,
onChange
}: SaleInfoProps & WithStyles<typeof styles>) => {
const intl = useIntl();
return (
<Card>
<CardTitle
title={intl.formatMessage(commonMessages.generalInformations)}
return (
<Card>
<CardTitle
title={intl.formatMessage(commonMessages.generalInformations)}
/>
<CardContent>
<TextField
disabled={disabled}
error={!!errors.name}
helperText={errors.name}
name={"name" as keyof FormData}
onChange={onChange}
label={intl.formatMessage({
defaultMessage: "Name",
description: "sale name"
})}
value={data.name}
fullWidth
/>
<CardContent className={classes.root}>
<TextField
disabled={disabled}
error={!!errors.name}
helperText={errors.name}
name={"name" as keyof FormData}
onChange={onChange}
label={intl.formatMessage({
defaultMessage: "Name",
description: "sale name"
})}
value={data.name}
fullWidth
/>
</CardContent>
</Card>
);
}
);
</CardContent>
</Card>
);
};
SaleInfo.displayName = "SaleInfo";
export default SaleInfo;

View file

@ -124,6 +124,7 @@ const PageDetailsPage: React.StatelessComponent<PageDetailsPageProps> = ({
disabled={disabled}
errors={formErrors}
onChange={change}
translate="product"
/>
</div>
</Grid>

View file

@ -281,6 +281,7 @@ export const ProductCreatePage: React.StatelessComponent<
errors={errors}
disabled={disabled}
onChange={change}
translate="page"
/>
</div>
</Grid>

View file

@ -291,6 +291,7 @@ export const ProductUpdatePage: React.FC<ProductUpdatePageProps> = ({
errors={errors}
disabled={disabled}
onChange={change}
translate="product"
/>
</div>
</Grid>