lbry-desktop/ui/component/claimSupportButton/view.jsx
Rafael c9fbf197f9 Refactor claimSupportButton
- Tooltip
- only interested in repost value from claim
2022-02-08 12:35:40 -05:00

34 lines
1 KiB
JavaScript

// @flow
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
import classnames from 'classnames';
import Button from 'component/button';
import Tooltip from 'component/common/tooltip';
type Props = {
uri: string,
fileAction?: boolean,
// redux
disableSupport: boolean,
isRepost?: boolean,
doOpenModal: (id: string, {}) => void,
};
export default function ClaimSupportButton(props: Props) {
const { uri, fileAction, isRepost, disableSupport, doOpenModal } = props;
return disableSupport ? null : (
<Tooltip title={__('Support this claim')} arrow={false}>
<Button
button={!fileAction && 'alt'}
className={classnames({ 'button--file-action': fileAction })}
icon={ICONS.LBC}
iconSize={fileAction && 22}
label={isRepost ? __('Support Repost') : __('Support --[button to support a claim]--')}
requiresAuth
onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })}
/>
</Tooltip>
);
}