Commit b47c3764 authored by chris's avatar chris

remove theme provider from editoria

parent a64ab426
......@@ -3,7 +3,6 @@ import styled, { createGlobalStyle, ThemeProvider } from "styled-components";
import { Wax } from "wax-prosemirror-core";
import { EditoriaLayout } from "wax-prosemirror-layouts";
import { cokoTheme } from "wax-prosemirror-themes";
import { schema, keys, plugins, rules } from "./EditorConfig";
......@@ -62,9 +61,7 @@ class Editoria extends Component {
user={user}
>
{({ editor, view, ...props }) => (
<ThemeProvider theme={cokoTheme}>
<EditoriaLayout editor={editor} view={view} {...props} />
</ThemeProvider>
<EditoriaLayout editor={editor} view={view} {...props} />
)}
</StyledWax>
</Fragment>
......
......@@ -3,14 +3,15 @@ import styled from "styled-components";
import { ButtonStyles } from "wax-prosemirror-themes";
const ButtonStyled = styled.button`
${ButtonStyles};
opacity: ${props => (props.select ? 1 : 0.4)};
pointer-events: ${props => (props.select ? "default" : "none")};
color: ${props =>
props.isActive ? props.theme.colorPrimary : props.theme.colorButton};
color: ${props => (props.isActive ? "white" : props.theme.colorButton)};
background-color: ${props =>
props.isActive ? props.theme.colorPrimary : "transparent"};
&:hover {
color: ${props => (props.isActive ? props.theme.colorPrimary : "#000")};
}
${ButtonStyles};
`;
const Button = ({ view = {}, item }) => (
......
......@@ -83,19 +83,19 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
// small_caps: {
// title: "Toggle Small Caps",
// content: icons.small_caps,
// active: state => {
// return markActive(state.config.schema.marks.small_caps)(state);
// },
// run(state, dispatch) {
// toggleMark(state.config.schema.marks.small_caps)(state, dispatch);
// },
//
// select: state => true,
// menu: props => <Button key={uuid()} {...props} />
// },
small_caps: {
title: "Toggle Small Caps",
content: icons.small_caps,
active: state => {
return markActive(state.config.schema.marks.small_caps)(state);
},
run(state, dispatch) {
toggleMark(state.config.schema.marks.small_caps)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
subscript: {
title: "Toggle subscript",
content: icons.subscript,
......
......@@ -89,23 +89,23 @@ const marks = {
}
]
},
// small_caps: {
// attrs: {
// class: { default: "small-caps" }
// },
// inclusive: false,
// parseDOM: [
// {
// tag: "span",
// getAttrs(dom) {
// return { class: dom.getAttribute("class") };
// }
// }
// ],
// toDOM(node) {
// return ["span", node.attrs, 0];
// }
// },
small_caps: {
attrs: {
class: { default: "small-caps" }
},
inclusive: false,
parseDOM: [
{
tag: "span.small-caps",
getAttrs(dom) {
return { class: dom.getAttribute("class") };
}
}
],
toDOM(node) {
return ["span", node.attrs, 0];
}
},
source: {
parseDOM: [{ tag: "cite" }],
toDOM() {
......
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