Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/react-components/src/ButtonCancel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import { useTranslation } from './translate';
interface Props {
className?: string;
isDisabled?: boolean;
label?: string;
onClick: () => void;
tabIndex?: number;
}

export default function ButtonCancel ({ className, isDisabled, onClick, tabIndex }: Props): React.ReactElement<Props> {
export default function ButtonCancel ({ className, isDisabled, label, onClick, tabIndex }: Props): React.ReactElement<Props> {
const { t } = useTranslation();

return (
Expand All @@ -23,7 +24,7 @@ export default function ButtonCancel ({ className, isDisabled, onClick, tabIndex
icon='cancel'
isDisabled={isDisabled}
isNegative
label={t('Cancel')}
label={label || t('Cancel')}
onClick={onClick}
tabIndex={tabIndex}
/>
Expand Down
8 changes: 5 additions & 3 deletions packages/react-components/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ interface ModalProps extends BareProps {
}

interface ActionsProps extends BareProps {
cancelLabel?: string;
children: React.ReactNode;
withOr?: boolean;
onCancel: () => void;
}

Expand All @@ -42,12 +44,12 @@ function Modal (props: ModalProps): React.ReactElement<ModalProps> {
);
}

function Actions ({ className, children, onCancel }: ActionsProps): React.ReactElement<ActionsProps> {
function Actions ({ cancelLabel, className, children, withOr = true, onCancel }: ActionsProps): React.ReactElement<ActionsProps> {
return (
<SUIModal.Actions>
<Button.Group className={className}>
<ButtonCancel onClick={onCancel} />
<Button.Or />
<ButtonCancel label={cancelLabel} onClick={onCancel} />
{withOr && <Button.Or />}
{children}
</Button.Group>
</SUIModal.Actions>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/src/TxButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class TxButtonInner extends React.PureComponent<InnerProps> {
}

protected send = (): void => {
const { accountId, api, extrinsic: propsExtrinsic, isUnsigned, onClick, onFailed, onStart, onSuccess, onUpdate, params = [], queueExtrinsic, tx = '', withSpinner = false } = this.props;
const { accountId, api, extrinsic: propsExtrinsic, isUnsigned, onClick, onFailed, onStart, onSuccess, onUpdate, params = [], queueExtrinsic, tx = '', withSpinner = true } = this.props;
let extrinsic: any;

if (propsExtrinsic) {
Expand Down
Loading