client/src/components/SlateEditor/MarkButton.js
author ymh <ymh.work@gmail.com>
Fri, 16 Nov 2018 11:19:13 +0100
changeset 173 0e6703cd0968
permissions -rw-r--r--
Correct the Note editor. Split the source file in sub components. Correct a timing problem on the editor checkbox.

import React from 'react';
import { withNamespaces } from 'react-i18next';

/**
 * Render a mark-toggling toolbar button.
 *
 * @param {String} type
 * @param {String} icon
 * @return {Element}
 */
export default withNamespaces("")(({icon, isActive, onMouseDown, t}) => (
  <span className={"button sticky-top" + ((!isActive)?" text-primary":" text-dark")} onMouseDown={onMouseDown} data-active={isActive} title={t("common." + icon)} >

    <span className="material-icons">{icon}</span>
  </span>
));