Skip to content

Commit

Permalink
umputun#299 add quote format button
Browse files Browse the repository at this point in the history
  • Loading branch information
Mavrin committed Apr 12, 2019
1 parent fc13cbf commit 110b9ae
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/app/@types/markdown-toolbar-element/index.d.ts
Expand Up @@ -8,5 +8,6 @@ declare namespace JSX {
'md-bold': any;
'md-header': any;
'md-italic': any;
'md-quote': any;
}
}
13 changes: 13 additions & 0 deletions web/app/components/input/markdown-toolbar-icons/quote-icon.tsx
@@ -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>
);
}
7 changes: 7 additions & 0 deletions web/app/components/input/markdown-toolbar.tsx
Expand Up @@ -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;
Expand All @@ -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>) {
Expand All @@ -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>
);
}
Expand Down

0 comments on commit 110b9ae

Please sign in to comment.