lbry-desktop/ui/js/component/fileActions/view.jsx
btzr-io 7400b8c916 more experimental changes
add more focus for support button

minor fixes css
2017-10-08 20:39:10 -06:00

55 lines
1.6 KiB
JavaScript

import React from "react";
import Link from "component/link";
import FileDownloadLink from "component/fileDownloadLink";
import * as modals from "constants/modal_types";
class FileActions extends React.PureComponent {
render() {
const { fileInfo, uri, openModal, claimIsMine } = this.props;
const claimId = fileInfo ? fileInfo.claim_id : null,
showDelete = fileInfo && Object.keys(fileInfo).length > 0,
showSupport = !claimIsMine;
return (
<section className="card__actions">
{claimIsMine &&
<Link
button="text"
icon="icon-edit"
label={__("Edit")}
navigate="/publish"
className="no-underline"
navigateParams={{ id: claimId }}
/>}
<FileDownloadLink uri={uri} />
{showDelete &&
<Link
button="text"
icon="icon-trash"
label={__("Remove")}
className="no-underline"
onClick={() => openModal(modals.CONFIRM_FILE_REMOVE, { uri })}
/>}
<Link
button="text"
icon="icon-flag"
href={`https://lbry.io/dmca?claim_id=${claimId}`}
className="no-underline"
label={__("report")}
/>
{showSupport &&
<Link
button="primary"
icon="icon-gift"
label={__("Support")}
navigate="/show"
className="card__action--right no-underline"
navigateParams={{ uri, tab: "tip" }}
/>}
</section>
);
}
}
export default FileActions;