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

fix dropdown tools

parent ccd2f76f
No related branches found
No related tags found
1 merge request!432Fix dropdown
......@@ -78,7 +78,10 @@ export default {
templateArea: 'mainMenuToolBar',
toolGroups: [
'Base',
'BlockDropDown',
{
name: 'BlockDropDown',
exclude: ['ParagraphContinued'],
},
{
name: 'Annotations',
more: [
......
......@@ -38,28 +38,28 @@ const DropdownStyled = styled(Dropdown)`
// eslint-disable-next-line react/prop-types
const BlockDropDownComponent = ({ view, tools }) => {
console.log(tools);
const context = useContext(WaxContext);
const {
activeViewId,
pmViews: { main },
} = context;
const [label, setLabel] = useState(null);
const { dispatch, state } = view;
const dropDownOptions = [
{ label: 'Title', value: '0', item: tools[0] },
{ label: 'author', value: '1', item: tools[1] },
{ label: 'Subtitle', value: '2', item: tools[2] },
{ label: 'Epigraph Prose', value: '3', item: tools[3] },
{ label: 'Epigraph Poetry', value: '4', item: tools[4] },
{ label: 'Heading 1', value: '5', item: tools[5] },
{ label: 'Heading 2', value: '6', item: tools[6] },
{ label: 'Heading 3', value: '7', item: tools[7] },
{ label: 'Title (H1)', value: '0', item: tools[0] },
// { label: 'author', value: '1', item: tools[1] },
// { label: 'Subtitle', value: '2', item: tools[2] },
// { label: 'Epigraph Prose', value: '3', item: tools[3] },
// { label: 'Epigraph Poetry', value: '4', item: tools[4] },
{ label: 'Heading 2', value: '5', item: tools[5] },
{ label: 'Heading 3', value: '6', item: tools[6] },
// { label: 'Heading 3', value: '7', item: tools[7] },
{ label: 'Paragraph', value: '8', item: tools[8] },
{ label: 'Paragraph Continued', value: '9', item: tools[9] },
{ label: 'Extract Prose', value: '10', item: tools[10] },
{ label: 'Extract Poetry', value: '11', item: tools[11] },
{ label: 'Source Note', value: '12', item: tools[12] },
// { label: 'Paragraph Continued', value: '9', item: tools[9] },
// { label: 'Extract Prose', value: '10', item: tools[10] },
// { label: 'Extract Poetry', value: '11', item: tools[11] },
// { label: 'Source Note', value: '12', item: tools[12] },
{ label: 'Block Quote', value: '13', item: tools[13] },
];
......@@ -80,7 +80,7 @@ const BlockDropDownComponent = ({ view, tools }) => {
<DropdownStyled
key={uuidv4()}
onChange={option => {
tools[option.value].run(state, dispatch);
tools[option.value].run(main.state, main.dispatch);
}}
options={dropDownOptions}
placeholder="Block Level"
......
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