Skip to content
Snippets Groups Projects
Commit 2dbf7465 authored by chris's avatar chris
Browse files

add custom btn

parent c97878b4
No related branches found
No related tags found
1 merge request!301Question controls
import React from 'react';
import { isEmpty } from 'lodash';
import { injectable } from 'inversify';
import { Tools } from 'wax-prosemirror-services';
import { Fragment } from 'prosemirror-model';
import { v4 as uuidv4 } from 'uuid';
import ToolBarBtn from './components/ToolBarBtn';
const createQuestion = (state, dispatch, tr) => {
const { empty, $from, $to } = state.selection;
......@@ -63,6 +66,13 @@ class MultipleChoiceQuestion extends Tools {
get enable() {
return state => {};
}
renderTool(view) {
if (isEmpty(view)) return null;
return this._isDisplayed ? (
<ToolBarBtn key={uuidv4()} item={this.toJSON()} view={view} />
) : null;
}
}
export default MultipleChoiceQuestion;
......@@ -2,7 +2,7 @@
import React, { useContext, useMemo } from 'react';
import { WaxContext } from 'wax-prosemirror-core';
import styled, { css } from 'styled-components';
import MenuButton from 'wax-prosemirror-components';
import { MenuButton } from 'wax-prosemirror-components';
const activeStyles = css`
pointer-events: none;
......
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