ghost-portal/packages/react-components/src/VoteActions.tsx
Jaco Greeff 9001400ef0
TxButton withSpinner swap (#2194)
* TxButton withSpinner swap

* TxModal onClick -> onStart (in modal)
2020-01-24 15:19:49 +01:00

41 lines
1007 B
TypeScript

// Copyright 2017-2020 @polkadot/react-components authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import React from 'react';
import Modal from './Modal';
import TxButton from './TxButton';
import { useTranslation } from './translate';
interface Props {
accountId: string | null;
className?: string;
isDisabled?: boolean;
onClick: () => void;
params: any[];
tx: string;
}
export default function VoteActions ({ accountId, className, isDisabled, onClick, params, tx }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
return (
<Modal.Actions
className={className}
onCancel={onClick}
>
<TxButton
accountId={accountId}
icon='check'
isDisabled={!accountId || isDisabled}
isPrimary
label={t('Vote')}
onStart={onClick}
params={params}
tx={tx}
/>
</Modal.Actions>
);
}