#8: Add tooltips to settings [partial]
This commit is contained in:
@@ -3,8 +3,16 @@ import './ConfigurationItem.css';
|
||||
import settings from '../../assets/settings';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
|
||||
import {connect} from 'react-redux';
|
||||
import {notifyInfo} from '../../redux/actions/error_actions';
|
||||
|
||||
export default props => {
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg))
|
||||
}
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(props => {
|
||||
const handleChanged = (e) => {
|
||||
const target = e.target;
|
||||
if (target.type === 'checkbox') {
|
||||
@@ -17,7 +25,7 @@ export default props => {
|
||||
if (settings[props.grouping] && settings[props.grouping][props.label]) {
|
||||
const displayInfo = () => {
|
||||
const description = settings[props.grouping][props.label];
|
||||
alert(description);
|
||||
props.notifyInfo(props.label, description);
|
||||
};
|
||||
|
||||
infoDisplay = <a href={void(0)}
|
||||
@@ -120,4 +128,4 @@ export default props => {
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
});
|
||||
11
src/components/InfoDetails/InfoDetails.css
Normal file
11
src/components/InfoDetails/InfoDetails.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.InfoDetailsHeading {
|
||||
text-align: center;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.InfoDetailsContent {
|
||||
max-height: 70vh;
|
||||
min-width: 80vw;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
30
src/components/InfoDetails/InfoDetails.js
Normal file
30
src/components/InfoDetails/InfoDetails.js
Normal file
@@ -0,0 +1,30 @@
|
||||
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'}}>{props.InfoMessage.message}</p>
|
||||
</div>
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
</Box>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user