2016-07-16 02:06:10 +00:00
|
|
|
import React, {PropTypes} from 'react';
|
2016-04-30 05:01:57 +00:00
|
|
|
|
2016-07-16 02:06:10 +00:00
|
|
|
import Dropdown from '../components/base/Dropdown';
|
|
|
|
import {PREVIEW_MODES, getPreviewModeName} from '../lib/previewModes';
|
2016-04-30 05:01:57 +00:00
|
|
|
|
|
|
|
const PreviewModeDropdown = ({updatePreviewMode}) => {
|
|
|
|
return (
|
|
|
|
<Dropdown>
|
2016-06-12 00:00:52 +00:00
|
|
|
<button className="tall">
|
|
|
|
<i className="fa fa-caret-down"></i>
|
|
|
|
</button>
|
2016-04-30 05:01:57 +00:00
|
|
|
<ul>
|
|
|
|
{PREVIEW_MODES.map(previewMode => (
|
|
|
|
<li key={previewMode}>
|
|
|
|
<button onClick={e => updatePreviewMode(previewMode)}>
|
|
|
|
{getPreviewModeName(previewMode)}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</Dropdown>
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
|
|
|
PreviewModeDropdown.propTypes = {
|
|
|
|
// Functions
|
|
|
|
updatePreviewMode: PropTypes.func.isRequired,
|
|
|
|
|
|
|
|
// Required
|
|
|
|
previewMode: PropTypes.string.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default PreviewModeDropdown;
|