Redux changes and refactoring

This commit is contained in:
Scott E. Graves
2019-06-07 23:13:05 -05:00
parent 6499ff4f79
commit 4b93c298c2
9 changed files with 75 additions and 45 deletions

View File

@@ -1,7 +1,15 @@
import React from 'react';
import './Dependency.css';
import {connect} from 'react-redux';
import * as Constants from '../../../constants';
export default props => {
const mapStateToProps = state => {
return {
AllowDownload: (state.download.DownloadType !== Constants.INSTALL_TYPES.Dependency),
};
};
export default connect(mapStateToProps)(props => {
return (
<div className={'Dependency'}>
<table width="100%">
@@ -11,7 +19,7 @@ export default props => {
<h3>{props.name}</h3>
</td>
<td>
{props.allowDownload ?
{props.AllowDownload ?
<a href={void(0)} className={'DependencyLink'} onClick={()=>{props.onDownload(props.download); return false;}}><u>Install</u></a> :
'Installing...'}
</td>
@@ -20,4 +28,4 @@ export default props => {
</table>
</div>
);
};
});