insomnia/app/ui/components/settings/SettingsImportExport.js

53 lines
1.6 KiB
JavaScript
Raw Normal View History

import React, {PropTypes} from 'react';
import {Dropdown, DropdownButton, DropdownItem, DropdownDivider} from '../base/dropdown';
2016-12-01 00:02:35 +00:00
import Link from '../base/Link';
const SettingsImportExport = ({
handleImport,
handleExportAll,
handleExportWorkspace
}) => (
<div>
<h1 className="no-margin-top">Data Import and Export</h1>
<p>
Import format will be automatically detected (<strong>Insomnia, Postman v2, HAR, Curl</strong>)
</p>
2016-12-01 00:02:35 +00:00
<p>
Don't see your format here?
{" "}
<Link href="https://insomnia.rest/documentation/import-export">Add Your Own</Link>.
</p>
<div className="pad-top">
<Dropdown outline={true}>
<DropdownButton className="btn btn--clicky">
Export Data <i className="fa fa-caret-down"></i>
</DropdownButton>
<DropdownDivider>Choose Export Type</DropdownDivider>
<DropdownItem onClick={handleExportWorkspace}>
2016-12-01 00:02:35 +00:00
<i className="fa fa-home"></i>
Current Workspace
</DropdownItem>
<DropdownItem onClick={handleExportAll}>
2016-12-01 00:02:35 +00:00
<i className="fa fa-empty"></i>
All Workspaces
</DropdownItem>
</Dropdown>
&nbsp;&nbsp;
<button className="btn btn--clicky" onClick={handleImport}>
2016-12-01 00:02:35 +00:00
Import Data
</button>
</div>
<p className="italic faint">
* Tip: You can also paste Curl commands into the URL bar
</p>
</div>
);
SettingsImportExport.propTypes = {
handleImport: PropTypes.func.isRequired,
handleExportAll: PropTypes.func.isRequired,
handleExportWorkspace: PropTypes.func.isRequired,
};
export default SettingsImportExport;