Export Skylinks to json file
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import { dismissInfo } from '../../redux/actions/error_actions';
|
||||
import { dismissInfo, notifyError } 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';
|
||||
import { promptLocationAndSaveFile } from '../../utils';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
@@ -14,6 +15,7 @@ const mapStateToProps = (state) => {
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
notifyError: (msg) => dispatch(notifyError(msg)),
|
||||
dismissInfo: () => dispatch(dismissInfo()),
|
||||
};
|
||||
};
|
||||
@@ -65,7 +67,30 @@ export default connect(
|
||||
<p style={{ textAlign: 'left' }}>{msg}</p>
|
||||
)}
|
||||
</div>
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
{props.InfoMessage.saveToFile ? (
|
||||
<div className={'InfoButtonOwner'}>
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
<Button
|
||||
buttonStyles={{ marginLeft: 'var(--default_spacing)' }}
|
||||
clicked={() => {
|
||||
if (
|
||||
promptLocationAndSaveFile(
|
||||
props.InfoMessage.fileName +
|
||||
'.' +
|
||||
props.InfoMessage.extension,
|
||||
msg,
|
||||
props.notifyError
|
||||
)
|
||||
) {
|
||||
props.dismissInfo();
|
||||
}
|
||||
}}>
|
||||
Save...
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user