spee.ch/react/components/ShowAssetLite/index.js

18 lines
498 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({ show }) => {
let props = {};
// select name and claim id
const existingRequest = show.assetRequests[show.request.id];
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
2018-02-13 03:50:19 +01:00
const asset = show.assetList[assetKey];
if (asset) {
props['name'] = asset.name;
props['claimId'] = asset.claimId;
};
return props;
};
export default connect(mapStateToProps, null)(View);