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

22 lines
524 B
JavaScript
Raw Normal View History

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