
* Minor fixes for intl messages * Add esbuild-loader * switch from babel to esbuild-loader * use formatjs enforce-id linter * Generate ids for intl messages * id format defined by idInterpolationPattern * Modify intl messages extraction * remove react-intl-translations-manager * remove transpile-tx.js * use formatjs cli * Modify defaultMessages.json * modify ids in defaultMessages.json with defined idInterpolationPattern * Fix errors * Fix page crash * Use babel to transpile tests * Fix useStateFromProps * Improve render count * Add test to useStateFromProps * Fix reloading state buh * Do not check if form with channels is dirty * Stop blocking save if form has not changed * Remove debug code * Fix form disabling * Fix variant selection checkbox onClick * Update translations * Update messages * Use esbuild to build storybook Co-authored-by: Bartłomiej Wiaduch <tukan2can@gmail.com> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { DialogContentText } from "@material-ui/core";
|
|
import ActionDialog from "@saleor/components/ActionDialog";
|
|
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
|
import React from "react";
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
|
|
export interface TokenDeleteDialogProps {
|
|
confirmButtonState: ConfirmButtonTransitionState;
|
|
open: boolean;
|
|
onConfirm: () => void;
|
|
onClose: () => void;
|
|
name: string;
|
|
}
|
|
|
|
const TokenDeleteDialog: React.FC<TokenDeleteDialogProps> = ({
|
|
name,
|
|
confirmButtonState,
|
|
onClose,
|
|
onConfirm,
|
|
open
|
|
}) => {
|
|
const intl = useIntl();
|
|
|
|
return (
|
|
<ActionDialog
|
|
open={open}
|
|
onClose={onClose}
|
|
confirmButtonState={confirmButtonState}
|
|
onConfirm={onConfirm}
|
|
variant="delete"
|
|
title={intl.formatMessage({
|
|
id: "quV5zH",
|
|
defaultMessage: "Delete Token",
|
|
description: "dialog title"
|
|
})}
|
|
>
|
|
<DialogContentText>
|
|
<FormattedMessage
|
|
id="2VSP8C"
|
|
defaultMessage="Are you sure you want to delete token {token}?"
|
|
description="delete token"
|
|
values={{
|
|
token: <strong>{name}</strong>
|
|
}}
|
|
/>
|
|
</DialogContentText>
|
|
</ActionDialog>
|
|
);
|
|
};
|
|
|
|
TokenDeleteDialog.displayName = "TokenDeleteDialog";
|
|
export default TokenDeleteDialog;
|