lbry-desktop/ui/component/claimSupportButton/view.jsx

35 lines
1 KiB
React
Raw Normal View History

2020-02-12 19:59:48 +01:00
// @flow
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
2020-09-30 20:46:17 +02:00
import classnames from 'classnames';
2020-02-12 19:59:48 +01:00
import Button from 'component/button';
import Tooltip from 'component/common/tooltip';
2020-02-12 19:59:48 +01:00
type Props = {
uri: string,
2020-09-30 20:46:17 +02:00
fileAction?: boolean,
// redux
disableSupport: boolean,
isRepost?: boolean,
doOpenModal: (id: string, {}) => void,
2020-02-12 19:59:48 +01:00
};
export default function ClaimSupportButton(props: Props) {
const { uri, fileAction, isRepost, disableSupport, doOpenModal } = props;
2020-11-10 06:21:04 +01:00
return disableSupport ? null : (
<Tooltip title={__('Support this claim')} arrow={false}>
<Button
button={!fileAction ? 'alt' : undefined}
className={classnames({ 'button--file-action': fileAction })}
icon={ICONS.LBC}
iconSize={fileAction ? 22 : undefined}
label={isRepost ? __('Support Repost') : __('Support --[button to support a claim]--')}
requiresAuth
onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })}
/>
</Tooltip>
2020-02-12 19:59:48 +01:00
);
}