Commit 6641d22c authored by chris's avatar chris

move button

parent 3898d21c
import React from "react";
import styled from "styled-components";
import { ButtonStyles } from "wax-prosemirror-themes";
const ButtonStyled = styled.button`
opacity: ${props => (props.select ? 1 : 0.4)};
pointer-events: ${props => (props.select ? "default" : "none")};
color: ${props =>
props.isActive ? props.theme.colorPrimary : props.theme.colorButton};
&:hover {
color: ${props => (props.isActive ? props.theme.colorPrimary : "#000")};
}
${ButtonStyles};
`;
const Button = ({ view = {}, item }) => (
<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>
);
export default Button;
......@@ -16,7 +16,7 @@ import { wrapInList } from "prosemirror-schema-list";
import icons from "../icons/icons";
//Components
import Button from "../components/button/Button";
import Button from "../components/Button";
import TableDropDown from "../components/TableDropDown";
import ImageUpload from "../components/ImageUpload";
import HeadingsDropDown from "../components/HeadingsDropDown";
......
......@@ -2,7 +2,7 @@ import React from "react";
import { v4 as uuid } from "uuid";
import { setBlockType } from "prosemirror-commands";
import Button from "../components/button/Button";
import Button from "../components/Button";
import { blockActive } from "./SideMenuItems";
export default {
title: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment