Newer
Older
import React, { useContext } from 'react';
import styled from 'styled-components';
import { ButtonStyles } from 'wax-prosemirror-themes';
import { WaxContext } from 'wax-prosemirror-core';
pointer-events: ${props => (props.select ? 'default' : 'none')};
color: ${props => (props.isActive ? 'white' : props.theme.colorButton)};
props.isActive ? props.theme.colorPrimary : 'transparent'};
props.isActive ? props.theme.colorPrimary : 'transparent'};
if (item.onlyOnMain) {
return (
<ButtonStyled
type="button"
isActive={item.active && item.active(view.state)}
title={item.title}
disabled={item.enable && !item.enable(view.state)}
onMouseDown={e => {
e.preventDefault();
item.run(view.state, view.dispatch);
}}
select={item.select && item.select(view.state)}
>
{item.content}
</ButtonStyled>
);
};