client/src/components/SlateEditor/MarkButton.js
author ymh <ymh.work@gmail.com>
Tue, 04 Dec 2018 18:56:31 +0100
changeset 192 e4c2c1919c20
parent 173 0e6703cd0968
permissions -rw-r--r--
Add placeholder translation for empty title and description

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>
));