2020-01-30 16:01:23 -05:00
|
|
|
import * as PAGES from 'constants/pages';
|
|
|
|
import { connect } from 'react-redux';
|
2021-10-19 00:49:51 -04:00
|
|
|
import { makeSelectClaimForUri, makeSelectClaimIsPending } from 'redux/selectors/claims';
|
2021-10-07 23:47:39 -04:00
|
|
|
import { doClearPublish, doPrepareEdit } from 'redux/actions/publish';
|
2020-01-30 16:01:23 -05:00
|
|
|
import { push } from 'connected-react-router';
|
2020-01-30 17:25:15 -05:00
|
|
|
import ClaimPreviewSubtitle from './view';
|
2020-01-30 16:01:23 -05:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
|
|
|
});
|
|
|
|
|
2021-03-17 16:53:35 -04:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
beginPublish: (name) => {
|
2020-01-30 16:01:23 -05:00
|
|
|
dispatch(doClearPublish());
|
|
|
|
dispatch(doPrepareEdit({ name }));
|
2020-07-23 13:02:07 -04:00
|
|
|
dispatch(push(`/$/${PAGES.UPLOAD}`));
|
2020-01-30 16:01:23 -05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-07-23 13:02:07 -04:00
|
|
|
export default connect(select, perform)(ClaimPreviewSubtitle);
|