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