client/src/components/SlateEditor/MarkButton.js
changeset 173 0e6703cd0968
equal deleted inserted replaced
172:4b780ebbedc6 173:0e6703cd0968
       
     1 import React from 'react';
       
     2 import { withNamespaces } from 'react-i18next';
       
     3 
       
     4 /**
       
     5  * Render a mark-toggling toolbar button.
       
     6  *
       
     7  * @param {String} type
       
     8  * @param {String} icon
       
     9  * @return {Element}
       
    10  */
       
    11 export default withNamespaces("")(({icon, isActive, onMouseDown, t}) => (
       
    12   <span className={"button sticky-top" + ((!isActive)?" text-primary":" text-dark")} onMouseDown={onMouseDown} data-active={isActive} title={t("common." + icon)} >
       
    13 
       
    14     <span className="material-icons">{icon}</span>
       
    15   </span>
       
    16 ));
       
    17