mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
318c35c2cb
* Some minor implementations * Some more * Lots more * Removed 'backend' alias * removed all promises * Removed a bunch of module exports stuff * Some morE' * Fix * custom DNS * Tests for DNS * bug fix * Some small adjustments * Small stuff
34 lines
901 B
JavaScript
34 lines
901 B
JavaScript
import React, {PropTypes} from 'react';
|
|
|
|
import Dropdown from '../base/Dropdown';
|
|
import {PREVIEW_MODES, getPreviewModeName} from '../../../backend/previewModes';
|
|
import {trackEvent} from '../../../backend/analytics';
|
|
|
|
const PreviewModeDropdown = ({updatePreviewMode}) => (
|
|
<Dropdown>
|
|
<button className="tall">
|
|
<i className="fa fa-caret-down"></i>
|
|
</button>
|
|
<ul>
|
|
{PREVIEW_MODES.map(previewMode => (
|
|
<li key={previewMode}>
|
|
<button onClick={() => {
|
|
trackEvent('Changed Preview Mode', {previewMode});
|
|
updatePreviewMode(previewMode);
|
|
}}>{getPreviewModeName(previewMode)}</button>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</Dropdown>
|
|
);
|
|
|
|
PreviewModeDropdown.propTypes = {
|
|
// Functions
|
|
updatePreviewMode: PropTypes.func.isRequired,
|
|
|
|
// Required
|
|
previewMode: PropTypes.string.isRequired
|
|
};
|
|
|
|
export default PreviewModeDropdown;
|