ghost-portal/packages/react-components/src/VoteActions.tsx
Jaco Greeff dafea25972
Allow voting on treasury page (#2019)
* Allow voting on treasury page

* More re-usable voting components (a start)

* Ficup imports

* Adjust modals

* Bump API
2019-12-09 17:54:57 +01:00

49 lines
1.2 KiB
TypeScript

// Copyright 2017-2019 @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 { I18nProps } from './types';
import React from 'react';
import Button from './Button';
import Modal from './Modal';
import TxButton from './TxButton';
import translate from './translate';
interface Props extends I18nProps {
accountId: string | null;
isDisabled?: boolean;
onClick: () => void;
params: any[];
tx: string;
}
function VoteActions ({ accountId, className, isDisabled, onClick, params, t, tx }: Props): React.ReactElement<Props> {
return (
<Modal.Actions>
<Button.Group className={className}>
<Button
icon='cancel'
isNegative
label={t('Cancel')}
onClick={onClick}
/>
<Button.Or />
<TxButton
accountId={accountId}
icon='check'
isDisabled={!accountId || isDisabled}
isPrimary
label={t('Vote')}
onClick={onClick}
params={params}
tx={tx}
/>
</Button.Group>
</Modal.Actions>
);
}
export default translate(VoteActions);