2022-06-24 02:58:32 +02:00
|
|
|
import { connect } from 'react-redux';
|
2022-06-24 15:08:46 +02:00
|
|
|
import { selectPreorderTagForUri, selectClaimForUri, selectClaimIsMine } from 'redux/selectors/claims';
|
|
|
|
import PreorderButton from './view';
|
2022-06-24 02:58:32 +02:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
|
|
|
|
|
|
|
const select = (state, props) => {
|
|
|
|
const claim = selectClaimForUri(state, props.uri);
|
|
|
|
|
|
|
|
return {
|
2022-06-24 15:08:46 +02:00
|
|
|
preorderTag: selectPreorderTagForUri(state, props.uri),
|
2022-06-24 02:58:32 +02:00
|
|
|
claimIsMine: selectClaimIsMine(state, claim),
|
|
|
|
claim,
|
|
|
|
preferredCurrency: selectClientSetting(state, SETTINGS.PREFERRED_CURRENCY),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = {
|
|
|
|
doOpenModal,
|
|
|
|
};
|
|
|
|
|
2022-06-24 15:08:46 +02:00
|
|
|
export default connect(select, perform)(PreorderButton);
|