2016-07-16 02:06:10 +00:00
|
|
|
import React, {PropTypes} from 'react';
|
2016-08-15 17:04:36 +00:00
|
|
|
import Dropdown from '../base/Dropdown';
|
2016-10-28 17:51:08 +00:00
|
|
|
import DropdownDivider from '../base/DropdownDivider';
|
2016-11-10 02:40:53 +00:00
|
|
|
import {PREVIEW_MODES, getPreviewModeName} from '../../../common/constants';
|
2016-04-30 05:01:57 +00:00
|
|
|
|
2016-10-28 17:51:08 +00:00
|
|
|
const PreviewModeDropdown = ({updatePreviewMode, download}) => (
|
2016-10-02 20:57:00 +00:00
|
|
|
<Dropdown>
|
|
|
|
<button className="tall">
|
|
|
|
<i className="fa fa-caret-down"></i>
|
|
|
|
</button>
|
|
|
|
<ul>
|
|
|
|
{PREVIEW_MODES.map(previewMode => (
|
|
|
|
<li key={previewMode}>
|
|
|
|
<button onClick={() => {
|
|
|
|
updatePreviewMode(previewMode);
|
|
|
|
}}>{getPreviewModeName(previewMode)}</button>
|
|
|
|
</li>
|
|
|
|
))}
|
2016-10-28 17:51:08 +00:00
|
|
|
<DropdownDivider></DropdownDivider>
|
|
|
|
<li>
|
|
|
|
<button onClick={download}>Download</button>
|
|
|
|
</li>
|
2016-10-02 20:57:00 +00:00
|
|
|
</ul>
|
|
|
|
</Dropdown>
|
|
|
|
);
|
2016-04-30 05:01:57 +00:00
|
|
|
|
|
|
|
PreviewModeDropdown.propTypes = {
|
|
|
|
// Functions
|
|
|
|
updatePreviewMode: PropTypes.func.isRequired,
|
2016-10-28 17:51:08 +00:00
|
|
|
download: PropTypes.func.isRequired,
|
2016-07-28 20:10:26 +00:00
|
|
|
|
2016-04-30 05:01:57 +00:00
|
|
|
// Required
|
|
|
|
previewMode: PropTypes.string.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default PreviewModeDropdown;
|