2021-05-14 08:15:15 +00:00
|
|
|
|
import {
|
|
|
|
|
Button,
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogActions,
|
|
|
|
|
DialogContent,
|
|
|
|
|
DialogContentText,
|
|
|
|
|
DialogTitle
|
|
|
|
|
} from "@material-ui/core";
|
2020-04-28 01:09:31 +00:00
|
|
|
|
import { buttonMessages } from "@saleor/intl";
|
2021-07-21 08:59:52 +00:00
|
|
|
|
import { makeStyles } from "@saleor/macaw-ui";
|
2020-04-28 01:09:31 +00:00
|
|
|
|
import { DialogProps } from "@saleor/types";
|
2020-05-14 09:30:32 +00:00
|
|
|
|
import React from "react";
|
|
|
|
|
import { FormattedMessage } from "react-intl";
|
2020-04-28 01:09:31 +00:00
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles(
|
|
|
|
|
theme => ({
|
|
|
|
|
button: {
|
|
|
|
|
backgroundColor: theme.palette.error.main
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
name: "OrderCannotCancelOrderDialog"
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const OrderCannotCancelOrderDialog: React.FC<DialogProps> = ({
|
|
|
|
|
open,
|
|
|
|
|
onClose
|
|
|
|
|
}) => {
|
|
|
|
|
const classes = useStyles({});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog onClose={onClose} open={open} maxWidth="sm">
|
|
|
|
|
<DialogTitle>
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
defaultMessage="Saleor couldn’t cancel order"
|
|
|
|
|
description="dialog header"
|
|
|
|
|
/>
|
|
|
|
|
</DialogTitle>
|
|
|
|
|
<DialogContent>
|
|
|
|
|
<DialogContentText>
|
|
|
|
|
<FormattedMessage defaultMessage="There are still fulfillments created for this order. Cancel the fulfillments first before you cancel the order." />
|
|
|
|
|
</DialogContentText>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
<DialogActions>
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
className={classes.button}
|
|
|
|
|
onClick={onClose}
|
|
|
|
|
>
|
|
|
|
|
<FormattedMessage {...buttonMessages.ok} />
|
|
|
|
|
</Button>
|
|
|
|
|
</DialogActions>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
OrderCannotCancelOrderDialog.displayName = "OrderCannotCancelOrderDialog";
|
|
|
|
|
export default OrderCannotCancelOrderDialog;
|