diff --git a/js/package.json b/js/package.json
index 8f6775605..d84b21d25 100644
--- a/js/package.json
+++ b/js/package.json
@@ -115,7 +115,6 @@
"geopattern": "^1.2.3",
"isomorphic-fetch": "^2.2.1",
"js-sha3": "^0.5.2",
- "json2csv": "^3.7.1",
"lodash": "^4.11.1",
"marked": "^0.3.6",
"material-ui": "^0.16.1",
diff --git a/js/src/ui/Actionbar/Export/export.js b/js/src/ui/Actionbar/Export/export.js
index 8e27b3451..21aaf2a43 100644
--- a/js/src/ui/Actionbar/Export/export.js
+++ b/js/src/ui/Actionbar/Export/export.js
@@ -15,11 +15,8 @@
// along with Parity. If not, see .
import React, { Component, PropTypes } from 'react';
-import IconMenu from 'material-ui/IconMenu';
-import MenuItem from 'material-ui/MenuItem';
import FileSaver from 'file-saver';
-import json2csv from 'json2csv';
import FileDownloadIcon from 'material-ui/svg-icons/file/file-download';
import { Button } from '../../';
@@ -34,32 +31,16 @@ class ActionbarExport extends Component {
className: PropTypes.string
}
- state = {
- menuOpen: false
- }
-
render () {
const { className } = this.props;
return (
- }
- label='export'
- onClick={ this.handleMenuOpen }
- />
- }
- open={ this.state.menuOpen }
- onRequestChange={ this.handleMenuChange }
- onItemTouchTap={ this.handleExport }
- targetOrigin={ { horizontal: 'right', vertical: 'top' } }
- anchorOrigin={ { horizontal: 'right', vertical: 'top' } }
- >
-
-
-
+ }
+ label='export'
+ onClick={ this.handleExport }
+ />
);
}
@@ -76,7 +57,6 @@ class ActionbarExport extends Component {
getExtension = (filetype) => {
switch (filetype) {
case 'json':
- case 'csv':
return filetype;
default:
return 'txt';
@@ -91,30 +71,13 @@ class ActionbarExport extends Component {
switch (filetype) {
case 'json':
return JSON.stringify(data, null, 4);
- case 'csv':
- return this.toCSV(data);
default:
return data.toString();
}
}
- toCSV = (data) => {
- const json = Object.values(data);
- console.log(json);
- return json2csv({ data: json });
- }
-
- handleExport = (event, child) => {
- const type = child.props.value;
- this.onDownloadBackup(type);
- }
-
- handleMenuOpen = () => {
- this.setState({ menuOpen: true });
- }
-
- handleMenuChange = (open) => {
- this.setState({ menuOpen: open });
+ handleExport = () => {
+ this.onDownloadBackup('json');
}
}