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" description="add attribute as column in product list table"
/> />
<Typography variant="caption"> <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> </Typography>
</> </>
} }

View file

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

View file

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

View file

@ -18,6 +18,9 @@ export interface AppHeaderProps {
const styles = (theme: Theme) => const styles = (theme: Theme) =>
createStyles({ createStyles({
backArrow: {
fontSize: 30
},
menuButton: { menuButton: {
flex: "0 0 auto", flex: "0 0 auto",
marginLeft: theme.spacing.unit * -2, marginLeft: theme.spacing.unit * -2,
@ -25,9 +28,6 @@ const styles = (theme: Theme) =>
marginTop: -theme.spacing.unit * 2 marginTop: -theme.spacing.unit * 2
}, },
root: { root: {
"& svg": {
fontSize: 30
},
"&:hover": { "&:hover": {
color: theme.typography.body2.color color: theme.typography.body2.color
}, },
@ -60,7 +60,7 @@ const AppHeader = withStyles(styles, { name: "AppHeader" })(
anchor ? ( anchor ? (
<Portal container={anchor.current}> <Portal container={anchor.current}>
<div className={classes.root} onClick={onBack}> <div className={classes.root} onClick={onBack}>
<ArrowBackIcon /> <ArrowBackIcon className={classes.backArrow} />
{children ? ( {children ? (
<Typography className={classes.title}>{children}</Typography> <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: fade(theme.palette.primary.main, 0.2)
}, },
backgroundColor: "transparent" backgroundColor: "transparent"
}
}, },
root: {
"& button": {
padding: 6 padding: 6
}, },
root: {
color: theme.palette.text.secondary, color: theme.palette.text.secondary,
flexShrink: 0, flexShrink: 0,
margin: `0 ${theme.spacing.unit * 2.5}px` margin: `0 ${theme.spacing.unit * 2.5}px`

View file

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

View file

@ -23,25 +23,12 @@ export interface SaleInfoProps {
onChange: (event: React.ChangeEvent<any>) => void; onChange: (event: React.ChangeEvent<any>) => void;
} }
const styles = (theme: Theme) => const SaleInfo: React.FC<SaleInfoProps> = ({
createStyles({
root: {
display: "grid",
gridColumnGap: theme.spacing.unit * 2 + "px",
gridTemplateColumns: "1fr"
}
});
const SaleInfo = withStyles(styles, {
name: "SaleInfo"
})(
({
classes,
data, data,
disabled, disabled,
errors, errors,
onChange onChange
}: SaleInfoProps & WithStyles<typeof styles>) => { }) => {
const intl = useIntl(); const intl = useIntl();
return ( return (
@ -49,7 +36,7 @@ const SaleInfo = withStyles(styles, {
<CardTitle <CardTitle
title={intl.formatMessage(commonMessages.generalInformations)} title={intl.formatMessage(commonMessages.generalInformations)}
/> />
<CardContent className={classes.root}> <CardContent>
<TextField <TextField
disabled={disabled} disabled={disabled}
error={!!errors.name} error={!!errors.name}
@ -66,7 +53,6 @@ const SaleInfo = withStyles(styles, {
</CardContent> </CardContent>
</Card> </Card>
); );
} };
);
SaleInfo.displayName = "SaleInfo"; SaleInfo.displayName = "SaleInfo";
export default SaleInfo; export default SaleInfo;

View file

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

View file

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

View file

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