30 lines
909 B
JavaScript
30 lines
909 B
JavaScript
import React from 'react';
|
|
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 => {
|
|
return {
|
|
InfoMessage: state.error.InfoStack.length > 0 ? state.error.InfoStack[0] : '',
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
return {
|
|
dismissInfo: () => dispatch(dismissInfo()),
|
|
};
|
|
};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
|
return (
|
|
<Box dxDark dxStyle={{padding: '8px'}}>
|
|
<h1 className={'InfoDetailsHeading'}>{props.InfoMessage.title}</h1>
|
|
<div className={'InfoDetailsContent'}>
|
|
<p style={{textAlign: 'left', whiteSpace: 'pre-line'}}>{props.InfoMessage.message}</p>
|
|
</div>
|
|
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
|
</Box>
|
|
);
|
|
}); |