lbry-desktop/ui/component/fileActions/index.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2020-01-06 19:32:35 +01:00
import * as SETTINGS from 'constants/settings';
import {
makeSelectClaimIsMine,
makeSelectFileInfoForUri,
makeSelectClaimForUri,
makeSelectContentTypeForUri,
doPrepareEdit,
} from 'lbry-redux';
2019-03-12 20:53:55 +01:00
import { makeSelectCostInfoForUri } from 'lbryinc';
2020-01-06 19:32:35 +01:00
import { makeSelectClientSetting } from 'redux/selectors/settings';
2018-11-27 18:00:45 +01:00
import { doOpenModal } from 'redux/actions/app';
2020-01-06 19:32:35 +01:00
import fs from 'fs';
import FilePage from './view';
2017-09-08 05:15:05 +02:00
const select = (state, props) => ({
2020-01-06 19:32:35 +01:00
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
2017-09-08 05:15:05 +02:00
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
2020-01-06 19:32:35 +01:00
contentType: makeSelectContentTypeForUri(props.uri)(state),
2017-09-08 05:15:05 +02:00
costInfo: makeSelectCostInfoForUri(props.uri)(state),
2020-01-06 19:32:35 +01:00
supportOption: makeSelectClientSetting(SETTINGS.SUPPORT_OPTION)(state),
2017-09-08 05:15:05 +02:00
});
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
2020-01-06 19:32:35 +01:00
prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo, fs)),
2017-06-06 06:21:55 +02:00
});
2018-10-31 17:40:17 +01:00
export default connect(
select,
perform
2020-01-06 19:32:35 +01:00
)(FilePage);