Prettier support
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
import React from 'react';
|
||||
import {dismissInfo} from '../../redux/actions/error_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import { dismissInfo } from '../../redux/actions/error_actions';
|
||||
import { connect } from 'react-redux';
|
||||
import Box from '../UI/Box/Box';
|
||||
import Button from '../UI/Button/Button';
|
||||
import './InfoDetails.css';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
InfoMessage: state.error.InfoStack.length > 0 ? state.error.InfoStack[0] : '',
|
||||
InfoMessage:
|
||||
state.error.InfoStack.length > 0 ? state.error.InfoStack[0] : '',
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
dismissInfo: () => dispatch(dismissInfo()),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)((props) => {
|
||||
let msg = props.InfoMessage.message;
|
||||
const classes = ['InfoDetailsContent'];
|
||||
|
||||
@@ -37,7 +41,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
}
|
||||
}
|
||||
|
||||
const scrollToTop = textArea => {
|
||||
const scrollToTop = (textArea) => {
|
||||
if (!textArea.firstClick) {
|
||||
textArea.firstClick = true;
|
||||
textArea.scrollTop = 0;
|
||||
@@ -46,20 +50,20 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
|
||||
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}>
|
||||
<h1 className={'InfoDetailsHeading'}>{props.InfoMessage.title}</h1>
|
||||
<div className={classes.join(' ')}>
|
||||
{
|
||||
copyable ? (
|
||||
<textarea autoFocus
|
||||
rows={9}
|
||||
value={msg}
|
||||
className={'SkynetImportTextArea'}
|
||||
onClick={e => scrollToTop(e.target)}/>
|
||||
) : (
|
||||
<p style={{textAlign: 'left'}}>{msg}</p>
|
||||
)
|
||||
}
|
||||
{copyable ? (
|
||||
<textarea
|
||||
autoFocus
|
||||
rows={9}
|
||||
value={msg}
|
||||
className={'SkynetImportTextArea'}
|
||||
onClick={(e) => scrollToTop(e.target)}
|
||||
/>
|
||||
) : (
|
||||
<p style={{ textAlign: 'left' }}>{msg}</p>
|
||||
)}
|
||||
</div>
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user