Commit a828dcc4 authored by chris's avatar chris

remove custom items

parent 3413ad6a
......@@ -30,8 +30,6 @@ const StyledWax = styled(Wax)`
}
`;
const menuItems = ["em"];
class Editoria extends Component {
render() {
return (
......@@ -45,7 +43,7 @@ class Editoria extends Component {
layout="editoria"
renderLayout={({ editor, ...props }) => (
<React.Fragment>
<MainMenuBar {...props} menuItems={menuItems} />
<MainMenuBar {...props} />
<div className="wax-surface-container">{editor}</div>
</React.Fragment>
)}
......
......@@ -8,6 +8,11 @@ const ButtonStyled = styled.button`
display: ${props => (props.select ? "inline" : "none")};
`;
const checkActive = (item, state) => {
console.log(item.active(state));
return item.active(state);
};
const Button = ({ dispatch, state, item }) => (
<ButtonStyled
type="button"
......
......@@ -167,9 +167,9 @@ export default {
subscript: {
title: "Toggle subscript",
content: icons.subscript,
active: state => {
return markActive(state.config.schema.marks.subscript)(state);
},
// active: state => {
// return markActive(state.config.schema.marks.subscript)(state);
// },
run(state, dispatch) {
toggleMark(state.config.schema.marks.subscript)(state, dispatch);
},
......@@ -179,9 +179,7 @@ export default {
superscript: {
title: "Toggle superscript",
content: icons.superscript,
active: state => {
return markActive(state.config.schema.marks.superscript)(state);
},
// active: markActive(schema.marks.superscript),
run(state, dispatch) {
toggleMark(state.config.schema.marks.superscript)(state, dispatch);
},
......@@ -191,9 +189,7 @@ export default {
underline: {
title: "Toggle underline",
content: icons.underline,
active: state => {
return markActive(state.config.schema.marks.underline)(state);
},
// active: markActive(schema.marks.underline),
run(state, dispatch) {
toggleMark(state.config.schema.marks.underline)(state, dispatch);
},
......@@ -204,9 +200,7 @@ export default {
strikethrough: {
title: "Toggle strikethrough",
content: icons.strikethrough,
active: state => {
return markActive(state.config.schema.marks.strikethrough)(state);
},
// active: markActive(schema.marks.strikethrough),
run(state, dispatch) {
toggleMark(state.config.schema.marks.strikethrough)(state, dispatch);
},
......@@ -216,9 +210,7 @@ export default {
link: {
title: "Add or remove link",
content: icons.link,
active: state => {
return markActive(state.config.schema.marks.link)(state);
},
// active: markActive(schema.marks.link),
enable: state => !state.selection.empty,
run(state, dispatch) {
if (markActive(state.config.schema.marks.link)(state)) {
......
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