Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Match the height of the existing buttons:
const createSpan = text => (
<span style="{{">{text}</span>
);
const DoubleButton = createInlineStyleButton({
style: 'DOUBLE',
children: createSpan('π»')
});
const ScriptButton = createInlineStyleButton({
style: 'SCRIPT',
children: createSpan('π’')
});
const FrakturButton = createInlineStyleButton({
style: 'FRAKTUR',
children: createSpan('π')
});
const StrikethroughButton = createInlineStyleButton({
style: 'STRIKETHROUGH',
children: createSpan('XΜΆ')
});
const inlineToolbarPlugin = createInlineToolbarPlugin({
structure: [
BoldButton,
ItalicButton,
UnderlineButton,
StrikethroughButton,
Separator,
Separator
} from 'draft-js-inline-toolbar-plugin';
import {
createInlineStyleButton,
BoldButton,
ItalicButton,
UnderlineButton,
CodeButton
} from 'draft-js-buttons';
// Match the height of the existing buttons:
const createSpan = text => (
<span style="{{">{text}</span>
);
const DoubleButton = createInlineStyleButton({
style: 'DOUBLE',
children: createSpan('π»')
});
const ScriptButton = createInlineStyleButton({
style: 'SCRIPT',
children: createSpan('π’')
});
const FrakturButton = createInlineStyleButton({
style: 'FRAKTUR',
children: createSpan('π')
});
const StrikethroughButton = createInlineStyleButton({
style: 'STRIKETHROUGH',
// @flow
import React from 'react';
import { I18n } from 'react-redux-i18n';
import { createBlockStyleButton, createInlineStyleButton } from 'draft-js-buttons';
// we need to create this intermediate component for title attribute to be translated
const DumbBoldButton = () => <span title="{I18n.t('common.editor.bold')}">;
export const BoldButton = createInlineStyleButton({
style: 'BOLD',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbItalicButton = () => <span title="{I18n.t('common.editor.italic')}">;
export const ItalicButton = createInlineStyleButton({
style: 'ITALIC',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbUnorderedListButton = () => <span title="{I18n.t('common.editor.bulletList')}">;
export const UnorderedListButton = createBlockStyleButton({</span></span></span>
import React from 'react';
import { I18n } from 'react-redux-i18n';
import { createBlockStyleButton, createInlineStyleButton } from 'draft-js-buttons';
// we need to create this intermediate component for title attribute to be translated
const DumbBoldButton = () => <span title="{I18n.t('common.editor.bold')}">;
export const BoldButton = createInlineStyleButton({
style: 'BOLD',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbItalicButton = () => <span title="{I18n.t('common.editor.italic')}">;
export const ItalicButton = createInlineStyleButton({
style: 'ITALIC',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbUnorderedListButton = () => <span title="{I18n.t('common.editor.bulletList')}">;
export const UnorderedListButton = createBlockStyleButton({
blockType: 'unordered-list-item',
children:
});</span></span></span>
ItalicButton,
UnderlineButton,
CodeButton
} from 'draft-js-buttons';
// Match the height of the existing buttons:
const createSpan = text => (
<span style="{{">{text}</span>
);
const DoubleButton = createInlineStyleButton({
style: 'DOUBLE',
children: createSpan('π»')
});
const ScriptButton = createInlineStyleButton({
style: 'SCRIPT',
children: createSpan('π’')
});
const FrakturButton = createInlineStyleButton({
style: 'FRAKTUR',
children: createSpan('π')
});
const StrikethroughButton = createInlineStyleButton({
style: 'STRIKETHROUGH',
children: createSpan('XΜΆ')
});
const inlineToolbarPlugin = createInlineToolbarPlugin({
structure: [
style: 'BOLD',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbItalicButton = () => <span title="{I18n.t('common.editor.italic')}">;
export const ItalicButton = createInlineStyleButton({
style: 'ITALIC',
children:
});
// we need to create this intermediate component for title attribute to be translated
const DumbUnorderedListButton = () => <span title="{I18n.t('common.editor.bulletList')}">;
export const UnorderedListButton = createBlockStyleButton({
blockType: 'unordered-list-item',
children:
});</span></span>
const DoubleButton = createInlineStyleButton({
style: 'DOUBLE',
children: createSpan('π»')
});
const ScriptButton = createInlineStyleButton({
style: 'SCRIPT',
children: createSpan('π’')
});
const FrakturButton = createInlineStyleButton({
style: 'FRAKTUR',
children: createSpan('π')
});
const StrikethroughButton = createInlineStyleButton({
style: 'STRIKETHROUGH',
children: createSpan('XΜΆ')
});
const inlineToolbarPlugin = createInlineToolbarPlugin({
structure: [
BoldButton,
ItalicButton,
UnderlineButton,
StrikethroughButton,
Separator,
CodeButton,
FrakturButton,
DoubleButton,
ScriptButton
],
const HeadlineTwoButton = createBlockStyleButton({
blockType: 'header-two',
children: ,
});
const HeadlineThreeButton = createBlockStyleButton({
blockType: 'header-three',
children: ,
});
const UnorderedListButton = createBlockStyleButton({
blockType: 'unordered-list-item',
children: ,
});
const OrderedListButton = createBlockStyleButton({
blockType: 'ordered-list-item',
children: ,
});
const BlockquoteButton = createBlockStyleButton({
blockType: 'blockquote',
children: ,
});
const CalloutButton = createBlockStyleButton({
blockType: 'callout',
children: ,
});
export {
BlockquoteButton,
const HeadlineThreeButton = createBlockStyleButton({
blockType: 'header-three',
children: ,
});
const UnorderedListButton = createBlockStyleButton({
blockType: 'unordered-list-item',
children: ,
});
const OrderedListButton = createBlockStyleButton({
blockType: 'ordered-list-item',
children: ,
});
const BlockquoteButton = createBlockStyleButton({
blockType: 'blockquote',
children: ,
});
const CalloutButton = createBlockStyleButton({
blockType: 'callout',
children: ,
});
export {
BlockquoteButton,
BoldButton,
CalloutButton,
ItalicButton,
HeadlineTwoButton,
HeadlineThreeButton,
const BoldButton = createInlineStyleButton({
style: 'BOLD',
children: ,
});
const ItalicButton = createInlineStyleButton({
style: 'ITALIC',
children: ,
});
const HeadlineTwoButton = createBlockStyleButton({
blockType: 'header-two',
children: ,
});
const HeadlineThreeButton = createBlockStyleButton({
blockType: 'header-three',
children: ,
});
const UnorderedListButton = createBlockStyleButton({
blockType: 'unordered-list-item',
children: ,
});
const OrderedListButton = createBlockStyleButton({
blockType: 'ordered-list-item',
children: ,
});
const BlockquoteButton = createBlockStyleButton({
blockType: 'blockquote',