mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
Add prettier for codestyle and re-format everything (#1294)
This commit is contained in:
parent
8b78154075
commit
0aae1f70d2
319 changed files with 4809 additions and 3936 deletions
|
@ -47,87 +47,138 @@ export const ToolBar: React.FC<ToolBarProps> = ({ editor }) => {
|
|||
|
||||
return (
|
||||
<ButtonToolbar className='bg-light'>
|
||||
<ButtonGroup className={ 'mx-1 flex-wrap' }>
|
||||
<Button data-cy={ 'format-bold' } variant='light' onClick={ () => makeSelectionBold(editor) }
|
||||
title={ t('editor.editorToolbar.bold') }>
|
||||
<ForkAwesomeIcon icon="bold"/>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button
|
||||
data-cy={'format-bold'}
|
||||
variant='light'
|
||||
onClick={() => makeSelectionBold(editor)}
|
||||
title={t('editor.editorToolbar.bold')}>
|
||||
<ForkAwesomeIcon icon='bold' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-italic' } variant='light' onClick={ () => makeSelectionItalic(editor) }
|
||||
title={ t('editor.editorToolbar.italic') }>
|
||||
<ForkAwesomeIcon icon="italic"/>
|
||||
<Button
|
||||
data-cy={'format-italic'}
|
||||
variant='light'
|
||||
onClick={() => makeSelectionItalic(editor)}
|
||||
title={t('editor.editorToolbar.italic')}>
|
||||
<ForkAwesomeIcon icon='italic' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-underline' } variant='light' onClick={ () => underlineSelection(editor) }
|
||||
title={ t('editor.editorToolbar.underline') }>
|
||||
<ForkAwesomeIcon icon="underline"/>
|
||||
<Button
|
||||
data-cy={'format-underline'}
|
||||
variant='light'
|
||||
onClick={() => underlineSelection(editor)}
|
||||
title={t('editor.editorToolbar.underline')}>
|
||||
<ForkAwesomeIcon icon='underline' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-strikethrough' } variant='light' onClick={ () => strikeThroughSelection(editor) }
|
||||
title={ t('editor.editorToolbar.strikethrough') }>
|
||||
<ForkAwesomeIcon icon="strikethrough"/>
|
||||
<Button
|
||||
data-cy={'format-strikethrough'}
|
||||
variant='light'
|
||||
onClick={() => strikeThroughSelection(editor)}
|
||||
title={t('editor.editorToolbar.strikethrough')}>
|
||||
<ForkAwesomeIcon icon='strikethrough' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-subscript' } variant='light' onClick={ () => subscriptSelection(editor) }
|
||||
title={ t('editor.editorToolbar.subscript') }>
|
||||
<ForkAwesomeIcon icon="subscript"/>
|
||||
<Button
|
||||
data-cy={'format-subscript'}
|
||||
variant='light'
|
||||
onClick={() => subscriptSelection(editor)}
|
||||
title={t('editor.editorToolbar.subscript')}>
|
||||
<ForkAwesomeIcon icon='subscript' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-superscript' } variant='light' onClick={ () => superscriptSelection(editor) }
|
||||
title={ t('editor.editorToolbar.superscript') }>
|
||||
<ForkAwesomeIcon icon="superscript"/>
|
||||
<Button
|
||||
data-cy={'format-superscript'}
|
||||
variant='light'
|
||||
onClick={() => superscriptSelection(editor)}
|
||||
title={t('editor.editorToolbar.superscript')}>
|
||||
<ForkAwesomeIcon icon='superscript' />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<ButtonGroup className={ 'mx-1 flex-wrap' }>
|
||||
<Button data-cy={ 'format-heading' } variant='light' onClick={ () => addHeaderLevel(editor) }
|
||||
title={ t('editor.editorToolbar.header') }>
|
||||
<ForkAwesomeIcon icon="header"/>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button
|
||||
data-cy={'format-heading'}
|
||||
variant='light'
|
||||
onClick={() => addHeaderLevel(editor)}
|
||||
title={t('editor.editorToolbar.header')}>
|
||||
<ForkAwesomeIcon icon='header' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-code-block' } variant='light' onClick={ () => addCodeFences(editor) }
|
||||
title={ t('editor.editorToolbar.code') }>
|
||||
<ForkAwesomeIcon icon="code"/>
|
||||
<Button
|
||||
data-cy={'format-code-block'}
|
||||
variant='light'
|
||||
onClick={() => addCodeFences(editor)}
|
||||
title={t('editor.editorToolbar.code')}>
|
||||
<ForkAwesomeIcon icon='code' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-block-quote' } variant='light' onClick={ () => addQuotes(editor) }
|
||||
title={ t('editor.editorToolbar.blockquote') }>
|
||||
<ForkAwesomeIcon icon="quote-right"/>
|
||||
<Button
|
||||
data-cy={'format-block-quote'}
|
||||
variant='light'
|
||||
onClick={() => addQuotes(editor)}
|
||||
title={t('editor.editorToolbar.blockquote')}>
|
||||
<ForkAwesomeIcon icon='quote-right' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-unordered-list' } variant='light' onClick={ () => addList(editor) }
|
||||
title={ t('editor.editorToolbar.unorderedList') }>
|
||||
<ForkAwesomeIcon icon="list"/>
|
||||
<Button
|
||||
data-cy={'format-unordered-list'}
|
||||
variant='light'
|
||||
onClick={() => addList(editor)}
|
||||
title={t('editor.editorToolbar.unorderedList')}>
|
||||
<ForkAwesomeIcon icon='list' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-ordered-list' } variant='light' onClick={ () => addOrderedList(editor) }
|
||||
title={ t('editor.editorToolbar.orderedList') }>
|
||||
<ForkAwesomeIcon icon="list-ol"/>
|
||||
<Button
|
||||
data-cy={'format-ordered-list'}
|
||||
variant='light'
|
||||
onClick={() => addOrderedList(editor)}
|
||||
title={t('editor.editorToolbar.orderedList')}>
|
||||
<ForkAwesomeIcon icon='list-ol' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-check-list' } variant='light' onClick={ () => addTaskList(editor) }
|
||||
title={ t('editor.editorToolbar.checkList') }>
|
||||
<ForkAwesomeIcon icon="check-square"/>
|
||||
<Button
|
||||
data-cy={'format-check-list'}
|
||||
variant='light'
|
||||
onClick={() => addTaskList(editor)}
|
||||
title={t('editor.editorToolbar.checkList')}>
|
||||
<ForkAwesomeIcon icon='check-square' />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
<ButtonGroup className={ 'mx-1 flex-wrap' }>
|
||||
<Button data-cy={ 'format-link' } variant='light' onClick={ () => addLink(editor) }
|
||||
title={ t('editor.editorToolbar.link') }>
|
||||
<ForkAwesomeIcon icon="link"/>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<Button
|
||||
data-cy={'format-link'}
|
||||
variant='light'
|
||||
onClick={() => addLink(editor)}
|
||||
title={t('editor.editorToolbar.link')}>
|
||||
<ForkAwesomeIcon icon='link' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-image' } variant='light' onClick={ () => addImage(editor) }
|
||||
title={ t('editor.editorToolbar.image') }>
|
||||
<ForkAwesomeIcon icon="picture-o"/>
|
||||
<Button
|
||||
data-cy={'format-image'}
|
||||
variant='light'
|
||||
onClick={() => addImage(editor)}
|
||||
title={t('editor.editorToolbar.image')}>
|
||||
<ForkAwesomeIcon icon='picture-o' />
|
||||
</Button>
|
||||
<UploadImageButton editor={ editor }/>
|
||||
<UploadImageButton editor={editor} />
|
||||
</ButtonGroup>
|
||||
<ButtonGroup className={ 'mx-1 flex-wrap' }>
|
||||
<TablePickerButton editor={ editor }/>
|
||||
<Button data-cy={ 'format-add-line' } variant='light' onClick={ () => addLine(editor) }
|
||||
title={ t('editor.editorToolbar.line') }>
|
||||
<ForkAwesomeIcon icon="minus"/>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<TablePickerButton editor={editor} />
|
||||
<Button
|
||||
data-cy={'format-add-line'}
|
||||
variant='light'
|
||||
onClick={() => addLine(editor)}
|
||||
title={t('editor.editorToolbar.line')}>
|
||||
<ForkAwesomeIcon icon='minus' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-collapsable-block' } variant='light' onClick={ () => addCollapsableBlock(editor) }
|
||||
title={ t('editor.editorToolbar.collapsableBlock') }>
|
||||
<ForkAwesomeIcon icon="caret-square-o-down"/>
|
||||
<Button
|
||||
data-cy={'format-collapsable-block'}
|
||||
variant='light'
|
||||
onClick={() => addCollapsableBlock(editor)}
|
||||
title={t('editor.editorToolbar.collapsableBlock')}>
|
||||
<ForkAwesomeIcon icon='caret-square-o-down' />
|
||||
</Button>
|
||||
<Button data-cy={ 'format-add-comment' } variant='light' onClick={ () => addComment(editor) }
|
||||
title={ t('editor.editorToolbar.comment') }>
|
||||
<ForkAwesomeIcon icon="comment"/>
|
||||
<Button
|
||||
data-cy={'format-add-comment'}
|
||||
variant='light'
|
||||
onClick={() => addComment(editor)}
|
||||
title={t('editor.editorToolbar.comment')}>
|
||||
<ForkAwesomeIcon icon='comment' />
|
||||
</Button>
|
||||
<EmojiPickerButton editor={ editor }/>
|
||||
<EmojiPickerButton editor={editor} />
|
||||
</ButtonGroup>
|
||||
<ButtonGroup className={ 'mx-1 flex-wrap' }>
|
||||
<EditorPreferences/>
|
||||
<ButtonGroup className={'mx-1 flex-wrap'}>
|
||||
<EditorPreferences />
|
||||
</ButtonGroup>
|
||||
</ButtonToolbar>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue