Revert the Links Modal; we'll augment the Share Modal to include the download link.

This reverts commit cb47ed61375b4de32adacd89ce46d5da183150b5.
This commit is contained in:
infiinte-persistence 2020-07-06 22:43:47 +08:00 committed by Sean Yesmunt
parent 3a2284a244
commit 12db7c519f
7 changed files with 1 additions and 87 deletions

View file

@ -15,7 +15,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Publish Page improvements to prevent accidental overwrites of existing claims _community pr!_ ([#4416](https://github.com/lbryio/lbry-desktop/pull/4416))
- Option to remove abandoned claims from Blocked Channels page _community pr!_ ([#4433](https://github.com/lbryio/lbry-desktop/pull/4433))
- New channel create/edit page ([#4445](https://github.com/lbryio/lbry-desktop/pull/4445))
- Add dialog to copy various types of links for a claim _community pr!_ ([#4474](https://github.com/lbryio/lbry-desktop/pull/4474))
### Changed

View file

@ -1291,12 +1291,5 @@
"Awesome! You just followed your first first channel.": "Awesome! You just followed your first first channel.",
"After submitting, it will take a few minutes for your changes to be live for everyone.": "After submitting, it will take a few minutes for your changes to be live for everyone.",
"Anything": "Anything",
"Paid": "Paid",
"Start at": "Start at",
"Download Link": "Download Link",
"Links": "Links",
"LBRY URL": "LBRY URL",
"LBRY link copied": "LBRY link copied",
"LBRY URL copied": "LBRY URL copied",
"Download link copied": "Download link copied"
"Paid": "Paid"
}

View file

@ -108,12 +108,6 @@ function FileActions(props: Props) {
onClick={() => openModal(MODALS.CONFIRM_FILE_REMOVE, { uri })}
/>
)}
<Button
button="alt"
icon={ICONS.COPY}
title={__('Links')}
onClick={() => openModal(MODALS.COPY_LINKS, { uri })}
/>
{!claimIsMine && (
<Button
title={__('Report content')}

View file

@ -43,4 +43,3 @@ export const LIQUIDATE_SUPPORTS = 'liquidate_supports';
export const CONFIRM_AGE = 'confirm_age';
export const REMOVE_BLOCKED = 'remove_blocked';
export const IMAGE_UPLOAD = 'image_upload';
export const COPY_LINKS = 'copy_links';

View file

@ -1,14 +0,0 @@
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import { makeSelectClaimForUri } from 'lbry-redux';
import ModalCopyLinks from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
});
const perform = dispatch => ({
closeModal: () => dispatch(doHideModal()),
});
export default connect(select, perform)(ModalCopyLinks);

View file

@ -1,54 +0,0 @@
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import Card from 'component/common/card';
import CopyableText from 'component/copyableText';
import { generateDownloadUrl } from 'util/web';
import { generateLbryContentUrl, generateLbryWebUrl, generateOpenDotLbryDotComUrl } from 'util/url';
type Props = {
claim: StreamClaim,
closeModal: () => void,
};
class ModalCopyLinks extends React.PureComponent<Props> {
render() {
const { claim, closeModal } = this.props;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl, name, claim_id: claimId } = claim;
const OPEN_URL = 'https://open.lbry.com/';
const lbryUrl: string = generateLbryContentUrl(canonicalUrl, permanentUrl);
const lbryWebUrl: string = generateLbryWebUrl(lbryUrl);
const openDotLbryDotComUrl: string = generateOpenDotLbryDotComUrl(OPEN_URL, lbryWebUrl, canonicalUrl, permanentUrl);
const downloadUrl = `${generateDownloadUrl(name, claimId)}`;
return (
<Modal isOpen type="card" onAborted={closeModal}>
<Card
title={__('Links')}
actions={
<React.Fragment>
<CopyableText
label={__('LBRY Link')}
snackMessage={__('LBRY link copied')}
copyable={openDotLbryDotComUrl}
/>
<CopyableText
label={__('LBRY URL')}
snackMessage={__('LBRY URL copied')}
copyable={`lbry://${lbryUrl}`}
/>
<CopyableText
label={__('Download Link')}
snackMessage={__('Download link copied')}
copyable={downloadUrl}
/>
</React.Fragment>
}
/>
</Modal>
);
}
}
export default ModalCopyLinks;

View file

@ -41,7 +41,6 @@ import ModalSupportsLiquidate from 'modal/modalSupportsLiquidate';
import ModalConfirmAge from 'modal/modalConfirmAge';
import ModalFileSelection from 'modal/modalFileSelection';
import ModalImageUpload from 'modal/modalImageUpload';
import ModalCopyLinks from 'modal/modalCopyLinks';
type Props = {
modal: { id: string, modalProps: {} },
@ -147,8 +146,6 @@ function ModalRouter(props: Props) {
return <ModalRemoveBlocked {...modalProps} />;
case MODALS.IMAGE_UPLOAD:
return <ModalImageUpload {...modalProps} />;
case MODALS.COPY_LINKS:
return <ModalCopyLinks {...modalProps} />;
default:
return null;
}