client/src/components/SlateEditor/MarkButton.js
author ymh <ymh.work@gmail.com>
Fri, 30 Nov 2018 10:53:15 +0100
changeset 183 f8f3af9e5c83
parent 173 0e6703cd0968
permissions -rw-r--r--
Change the settings to avoid using Session authentication for rest framework as it raise exceptions in case client and backend are on the same domain On the filter, adapt to take into account new version of django_filters

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