2020-01-30 22:01:23 +01:00
|
|
|
import * as PAGES from 'constants/pages';
|
|
|
|
import { connect } from 'react-redux';
|
2021-03-17 21:53:35 +01:00
|
|
|
import {
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectClaimIsPending,
|
|
|
|
doClearPublish,
|
|
|
|
doPrepareEdit,
|
|
|
|
makeSelectClaimHasSource,
|
|
|
|
} from 'lbry-redux';
|
2020-01-30 22:01:23 +01:00
|
|
|
import { push } from 'connected-react-router';
|
2020-01-30 23:25:15 +01:00
|
|
|
import ClaimPreviewSubtitle from './view';
|
2020-01-30 22:01:23 +01:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
2021-03-17 21:53:35 +01:00
|
|
|
isLivestream: !makeSelectClaimHasSource(props.uri)(state),
|
2020-01-30 22:01:23 +01:00
|
|
|
});
|
|
|
|
|
2021-03-17 21:53:35 +01:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
beginPublish: (name) => {
|
2020-01-30 22:01:23 +01:00
|
|
|
dispatch(doClearPublish());
|
|
|
|
dispatch(doPrepareEdit({ name }));
|
2020-07-23 19:02:07 +02:00
|
|
|
dispatch(push(`/$/${PAGES.UPLOAD}`));
|
2020-01-30 22:01:23 +01:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-07-23 19:02:07 +02:00
|
|
|
export default connect(select, perform)(ClaimPreviewSubtitle);
|