Prettier support

This commit is contained in:
2021-03-10 21:14:32 -06:00
parent c51b527707
commit 0924490a6f
99 changed files with 5504 additions and 3979 deletions

View File

@@ -6,4 +6,4 @@
.DependencyLink {
cursor: pointer;
}
}

View File

@@ -1,17 +1,18 @@
import React from 'react';
import './Dependency.css';
import {connect} from 'react-redux';
import { connect } from 'react-redux';
import * as Constants from '../../../constants';
const mapStateToProps = state => {
const mapStateToProps = (state) => {
return {
AllowDownload: (state.download.DownloadType !== Constants.INSTALL_TYPES.Dependency) &&
AllowDownload:
state.download.DownloadType !== Constants.INSTALL_TYPES.Dependency &&
!state.download.DownloadActive &&
!state.install.InstallActive,
};
};
export default connect(mapStateToProps)(props => {
export default connect(mapStateToProps)((props) => {
return (
<div className={'Dependency'}>
<table width="100%">
@@ -21,11 +22,20 @@ export default connect(mapStateToProps)(props => {
<h3>{props.name}</h3>
</td>
<td>
{props.AllowDownload ?
<a href={'#'}
className={'DependencyLink'}
onClick={()=>{props.onDownload(); return false;}}><u>Install</u></a> :
'Installing...'}
{props.AllowDownload ? (
<a
href={'#'}
className={'DependencyLink'}
onClick={() => {
props.onDownload();
return false;
}}
>
<u>Install</u>
</a>
) : (
'Installing...'
)}
</td>
</tr>
</tbody>

View File

@@ -1,3 +1,2 @@
.DependencyList {
}
}

View File

@@ -1,14 +1,14 @@
import React from 'react';
import './DependencyList.css';
import {connect} from 'react-redux';
import { connect } from 'react-redux';
import * as Constants from '../../constants';
import Dependency from './Dependency/Dependency';
import Box from '../UI/Box/Box';
import {downloadItem} from '../../redux/actions/download_actions';
import {extractFileNameFromURL} from '../../utils';
import {setDismissDependencies} from '../../redux/actions/install_actions';
import { downloadItem } from '../../redux/actions/download_actions';
import { extractFileNameFromURL } from '../../utils.jsx';
import { setDismissDependencies } from '../../redux/actions/install_actions';
const mapStateToProps = state => {
const mapStateToProps = (state) => {
return {
AllowDismissDependencies: state.relver.AllowDismissDependencies,
MissingDependencies: state.install.MissingDependencies,
@@ -17,33 +17,80 @@ const mapStateToProps = state => {
const mapDispatchToProps = (dispatch) => {
return {
downloadItem: (name, type, url, isWinFSP) => dispatch(downloadItem(name, type, url, isWinFSP)),
setDismissDependencies: dismiss => dispatch(setDismissDependencies(dismiss)),
downloadItem: (name, type, url, isWinFSP) =>
dispatch(downloadItem(name, type, url, isWinFSP)),
setDismissDependencies: (dismiss) =>
dispatch(setDismissDependencies(dismiss)),
};
};
export default connect(mapStateToProps, mapDispatchToProps)(props => {
const items = props.MissingDependencies.map((k, i)=> {
export default connect(
mapStateToProps,
mapDispatchToProps
)((props) => {
const items = props.MissingDependencies.map((k, i) => {
return (
<Dependency key={i}
name={k.display}
onDownload={()=>props.downloadItem(extractFileNameFromURL(k.download), Constants.INSTALL_TYPES.Dependency, k.download, k.is_winfsp)}/>
<Dependency
key={i}
name={k.display}
onDownload={() =>
props.downloadItem(
extractFileNameFromURL(k.download),
Constants.INSTALL_TYPES.Dependency,
k.download,
k.is_winfsp
)
}
/>
);
});
const dismissDisplay = (
<div style={{float: 'right', margin: 0, paddingRight: '4px', boxSizing: 'border-box', display: 'block'}}>
<a href={'#'}
onClick={props.AllowDismissDependencies ? () => props.setDismissDependencies(true) : e => e.preventDefault()}
style={{cursor: props.AllowDismissDependencies ? 'pointer' : 'no-drop'}}>X</a>
<div
style={{
float: 'right',
margin: 0,
paddingRight: '4px',
boxSizing: 'border-box',
display: 'block',
}}
>
<a
href={'#'}
onClick={
props.AllowDismissDependencies
? () => props.setDismissDependencies(true)
: (e) => e.preventDefault()
}
style={{
cursor: props.AllowDismissDependencies ? 'pointer' : 'no-drop',
}}
>
X
</a>
</div>
);
return (
<Box dxStyle={{width: '300px', height: 'auto', padding: '5px'}}>
<Box dxStyle={{ width: '300px', height: 'auto', padding: '5px' }}>
{dismissDisplay}
<div style={{width: '100%', height: 'auto', paddingBottom: '5px', boxSizing: 'border-box'}}>
<h1 style={{width: '100%', textAlign: 'center', color: 'var(--text_color_error)'}}>Missing Dependencies</h1>
<div
style={{
width: '100%',
height: 'auto',
paddingBottom: '5px',
boxSizing: 'border-box',
}}
>
<h1
style={{
width: '100%',
textAlign: 'center',
color: 'var(--text_color_error)',
}}
>
Missing Dependencies
</h1>
</div>
{items}
</Box>