lbry-desktop/ui/component/fileActions/index.js
mayeaux 4f47779303
Preorder content functionality (#1743)
* adding preorder button

* adding preorder modal

* frontend mostly done

* check if its already purchased

* refresh page after purchase

* smooth out purchase process

* check if user has card saved

* handle case where its the users own upload

* fix transaction listing order bug

* cleaning up code for merge

* fix lint errors

* fix flow errors

* allow eur purchases

* support eur on customer transaction page

* fix css
2022-06-23 20:58:32 -04:00

47 lines
1.6 KiB
JavaScript

import { connect } from 'react-redux';
import {
selectClaimIsMine,
selectClaimForUri,
selectHasChannels,
makeSelectTagInClaimOrChannelForUri,
selectClaimIsNsfwForUri,
selectPreorderTag,
} from 'redux/selectors/claims';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
import { doPrepareEdit } from 'redux/actions/publish';
import { selectCostInfoForUri } from 'lbryinc';
import { doDownloadUri } from 'redux/actions/content';
import { doToast } from 'redux/actions/notifications';
import { doOpenModal } from 'redux/actions/app';
import FileActions from './view';
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
import { DISABLE_DOWNLOAD_BUTTON_TAG } from 'constants/tags';
import { isStreamPlaceholderClaim } from 'util/claim';
const select = (state, props) => {
const { uri } = props;
const claim = selectClaimForUri(state, uri);
return {
claim,
claimIsMine: selectClaimIsMine(state, claim),
renderMode: makeSelectFileRenderModeForUri(uri)(state),
costInfo: selectCostInfoForUri(state, uri),
hasChannels: selectHasChannels(state),
isLivestreamClaim: isStreamPlaceholderClaim(claim),
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
disableDownloadButton: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_DOWNLOAD_BUTTON_TAG)(state),
isMature: selectClaimIsNsfwForUri(state, uri),
isAPreorder: selectPreorderTag(state, props.uri),
};
};
const perform = {
doOpenModal,
doPrepareEdit,
doToast,
doDownloadUri,
};
export default connect(select, perform)(FileActions);