import React, {Component, PropTypes} from 'react'; import {connect} from 'react-redux' import {bindActionCreators} from 'redux'; import {Tab, Tabs, TabList, TabPanel} from 'react-tabs' import {shell} from 'electron'; import Link from '../base/Link'; import Modal from '../base/Modal'; import ModalBody from '../base/ModalBody'; import ModalHeader from '../base/ModalHeader'; import ModalFooter from '../base/ModalFooter'; import ModalComponent from '../lib/ModalComponent'; import KeyboardShortcutsTable from '../KeyboardShortcutsTable'; import * as GlobalActions from '../../redux/modules/global'; import * as db from '../../database'; import {MASHAPE_URL} from '../../lib/constants'; import {getAppVersion} from '../../lib/appInfo'; import {getAppName, getAppLongName} from '../../lib/appInfo'; class SettingsTabs extends Component { _importFile () { const workspace = this._getActiveWorkspace(this.props); this.props.actions.global.importFile(workspace); this.props.hide(); } _exportFile () { this.props.actions.global.exportFile(); this.props.hide(); } _getActiveWorkspace (props) { // TODO: Factor this out into a selector const {entities, workspaces} = props || this.props; let workspace = entities.workspaces[workspaces.activeId]; if (!workspace) { workspace = entities.workspaces[Object.keys(entities.workspaces)[0]]; } return workspace; } render () { const {entities, selectedIndex} = this.props; const settings = entities.settings[Object.keys(entities.settings)[0]]; return ( = 0 ? selectedIndex : 0}>

db.settingsUpdate(settings, {showPasswords: e.target.checked})} />   
db.settingsUpdate(settings, {followRedirects: e.target.checked})} />   
db.settingsUpdate(settings, {validateSSL: e.target.checked})} />   
db.settingsUpdate(settings, {timeout: parseInt(e.target.value, 10)})} />

db.settingsUpdate(settings, {editorLineWrapping: e.target.checked})} />   
db.settingsUpdate(settings, {editorFontSize: parseInt(e.target.value, 10)})} />

Import or export your data, so you can share it or back it up.

{" "}

Use these shortcuts to improve your productivity.


Hi there!

{getAppName()} is made with love by me,  Gregory Schier.

You can help me out by sending your feedback to  support@insomnia.rest or tweet  @GetInsomnia.

Thanks!


~Gregory

); } } SettingsTabs.propTypes = { hide: PropTypes.func.isRequired, workspaces: PropTypes.shape({ activeId: PropTypes.string }), entities: PropTypes.shape({ workspaces: PropTypes.object.isRequired, settings: PropTypes.object.isRequired }).isRequired, actions: PropTypes.shape({ global: PropTypes.shape({ importFile: PropTypes.func.isRequired, exportFile: PropTypes.func.isRequired, }) }), // Optional selectedIndex: PropTypes.number }; function mapStateToProps (state) { return { workspaces: state.workspaces, entities: state.entities, actions: state.actions, loading: state.global.loading }; } function mapDispatchToProps (dispatch) { return { actions: { global: bindActionCreators(GlobalActions, dispatch) } } } // NOTE: We can't _connect_ the SettingsModal because it hides the public methods const ConnectedSettingsTabs = connect( mapStateToProps, mapDispatchToProps )(SettingsTabs); class SettingsModal extends ModalComponent { constructor (props) { super(props); this.state = { selectedIndex: 0 } } show (selectedIndex = 0) { super.show(); if (selectedIndex >= 0) { this.setState({selectedIndex}); } else { this.setState({selectedIndex: 0}); } } render () { const {selectedIndex} = this.state; return ( {getAppLongName()}    v{getAppVersion()} this.hide()} selectedIndex={selectedIndex}/>
Supported By  
); } } export default SettingsModal;