2021-11-03 22:52:18 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
2021-11-10 03:30:03 +01:00
|
|
|
import { selectClaimIsMineForUri } from 'redux/selectors/claims';
|
2021-11-03 22:52:18 +01:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
|
|
|
import ClaimPreviewReset from './view';
|
|
|
|
|
2021-11-05 20:14:00 +01:00
|
|
|
const select = (state, props) => {
|
2021-11-03 22:52:18 +01:00
|
|
|
const { claim_id: channelId, name: channelName } = selectActiveChannelClaim(state) || {};
|
|
|
|
return {
|
|
|
|
channelName,
|
|
|
|
channelId,
|
2021-11-10 03:30:03 +01:00
|
|
|
claimIsMine: props.uri && selectClaimIsMineForUri(state, props.uri),
|
2021-11-03 22:52:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
doToast: (props) => dispatch(doToast(props)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(ClaimPreviewReset);
|