2020-02-11 20:04:51 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import TopPage from './view';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { doClearPublish, doPrepareEdit } from 'redux/actions/publish';
|
|
|
|
import { doResolveUris } from 'redux/actions/claims';
|
2020-12-04 01:10:23 +01:00
|
|
|
import { push } from 'connected-react-router';
|
|
|
|
import * as PAGES from 'constants/pages';
|
2020-02-11 20:04:51 +01:00
|
|
|
|
|
|
|
const select = (state, props) => {
|
|
|
|
const { search } = props.location;
|
|
|
|
const urlParams = new URLSearchParams(search);
|
|
|
|
const name = urlParams.get('name');
|
|
|
|
|
|
|
|
return {
|
|
|
|
name,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
beginPublish: (name) => {
|
2020-12-04 01:10:23 +01:00
|
|
|
dispatch(doClearPublish());
|
|
|
|
dispatch(doPrepareEdit({ name }));
|
|
|
|
dispatch(push(`/$/${PAGES.UPLOAD}`));
|
|
|
|
},
|
2021-10-08 05:47:39 +02:00
|
|
|
doResolveUris: (uris) => dispatch(doResolveUris(uris)),
|
2020-12-04 01:10:23 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(TopPage);
|