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

31 lines
819 B
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';
type Props = {
uri: string,
doOpenModal: (string, {}) => void,
2020-09-30 20:46:17 +02:00
fileAction?: boolean,
2020-02-12 19:59:48 +01:00
};
export default function ClaimSupportButton(props: Props) {
2020-09-30 20:46:17 +02:00
const { doOpenModal, uri, fileAction } = props;
2020-02-12 19:59:48 +01:00
return (
<Button
button="alt"
2020-09-30 20:46:17 +02:00
button={fileAction ? undefined : 'alt'}
className={classnames({ 'button--file-action': fileAction })}
2020-09-02 22:08:37 +02:00
icon={ICONS.LBC}
2020-09-30 20:46:17 +02:00
iconSize={fileAction ? 22 : undefined}
2020-02-12 19:59:48 +01:00
label={__('Support')}
requiresAuth={IS_WEB}
title={__('Support this claim')}
onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })}
/>
);
}