#299 add quote format button

This commit is contained in:
konstantin krivlenia
2019-04-14 11:18:14 +03:00
parent 2b68c8e8d3
commit b13cc1cae7
3 changed files with 21 additions and 0 deletions
+1
View File
@@ -8,5 +8,6 @@ declare namespace JSX {
'md-bold': any;
'md-header': any;
'md-italic': any;
'md-quote': any;
}
}
@@ -0,0 +1,13 @@
/** @jsx h */
import { h } from 'preact';
export default function QuoteIcon() {
return (
<svg className="input__toolbar-icon" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true">
<path
fill-rule="evenodd"
d="M6.16 3.5C3.73 5.06 2.55 6.67 2.55 9.36c.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.9 0-2.99-1.52-2.99-4.25 0-3.8 1.75-6.53 5.02-8.42L6.16 3.5zm7 0c-2.43 1.56-3.61 3.17-3.61 5.86.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.89 0-2.98-1.52-2.98-4.25 0-3.8 1.75-6.53 5.02-8.42l1.14 1.84h-.01z"
/>
</svg>
);
}
@@ -4,6 +4,7 @@ import '@github/markdown-toolbar-element';
import BoldIcon from './markdown-toolbar-icons/bold-icon';
import HeaderIcon from './markdown-toolbar-icons/header-icon';
import ItalicIcon from './markdown-toolbar-icons/italic-icon';
import QuoteIcon from './markdown-toolbar-icons/quote-icon';
interface Props {
textareaId: string;
@@ -12,6 +13,7 @@ interface Props {
const boldLabel = 'Add bold text <cmd-b>';
const headerLabel = 'Add header text';
const italicLabel = 'Add italic text <cmd-i>';
const quoteLabel = 'Add italic text <cmd-i>';
export default class MarkdownToolbar extends Component<Props> {
render(props: RenderableProps<Props>) {
@@ -28,6 +30,11 @@ export default class MarkdownToolbar extends Component<Props> {
<ItalicIcon />
</md-italic>
</div>
<div className="input__toolbar-group">
<md-quote className="input__toolbar-item" title={quoteLabel} aria-label={quoteLabel}>
<QuoteIcon />
</md-quote>
</div>
</markdown-toolbar>
);
}