docbrown/app/javascript/article-form/elements/publishToggle.jsx
Ben Halpern 87a7067a5c
Spruce up V2 editor look and feel (almost ready 🙂) (#846)
* Spruce up editor look and feel

* Update jest snapshots for editor

* Fix editor guide scoping issue
2018-10-07 11:06:52 -04:00

24 lines
822 B
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
const PublishToggle = ({ previewShowing, onPreview, onSaveDraft, onPublish, onHelp, published, helpShowing }) => (
<div className="articleform__buttons">
<button onClick={onHelp} className={helpShowing ? "articleform__buttons--small active" : "articleform__buttons--small inactive" } >
?
</button>
<button onClick={onPreview} className={previewShowing ? "active" : "inactive" }>
PREVIEW
</button>
{published ? '' : <button onClick={onSaveDraft}>SAVE DRAFT</button> }
<button onClick={onPublish} class="articleform__buttons--publish">
{published ? 'SAVE CHANGES' : 'PUBLISH' }
</button>
</div>
);
PublishToggle.propTypes = {
defaultValue: PropTypes.string.isRequired,
};
export default PublishToggle;