From 065cb54f3277e9ce6c4158bc3d9928f4026ccdcf Mon Sep 17 00:00:00 2001 From: konstantin krivlenia Date: Fri, 12 Apr 2019 20:46:48 +0300 Subject: [PATCH] #299 add link format button --- web/app/@types/markdown-toolbar-element/index.d.ts | 1 + .../input/markdown-toolbar-icons/link-icon.tsx | 13 +++++++++++++ web/app/components/input/markdown-toolbar.tsx | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 web/app/components/input/markdown-toolbar-icons/link-icon.tsx diff --git a/web/app/@types/markdown-toolbar-element/index.d.ts b/web/app/@types/markdown-toolbar-element/index.d.ts index 64f9e96da4..dd95648ca2 100644 --- a/web/app/@types/markdown-toolbar-element/index.d.ts +++ b/web/app/@types/markdown-toolbar-element/index.d.ts @@ -10,5 +10,6 @@ declare namespace JSX { 'md-italic': any; 'md-quote': any; 'md-code': any; + 'md-link': any; } } diff --git a/web/app/components/input/markdown-toolbar-icons/link-icon.tsx b/web/app/components/input/markdown-toolbar-icons/link-icon.tsx new file mode 100644 index 0000000000..40b8cb2a62 --- /dev/null +++ b/web/app/components/input/markdown-toolbar-icons/link-icon.tsx @@ -0,0 +1,13 @@ +/** @jsx h */ +import { h } from 'preact'; + +export default function LinkIcon() { + return ( + + ); +} diff --git a/web/app/components/input/markdown-toolbar.tsx b/web/app/components/input/markdown-toolbar.tsx index c01ce2dc56..66473bff7e 100644 --- a/web/app/components/input/markdown-toolbar.tsx +++ b/web/app/components/input/markdown-toolbar.tsx @@ -6,6 +6,7 @@ import HeaderIcon from './markdown-toolbar-icons/header-icon'; import ItalicIcon from './markdown-toolbar-icons/italic-icon'; import QuoteIcon from './markdown-toolbar-icons/quote-icon'; import CodeIcon from './markdown-toolbar-icons/code-icon'; +import LinkIcon from './markdown-toolbar-icons/link-icon'; interface Props { textareaId: string; @@ -16,6 +17,7 @@ const headerLabel = 'Add header text'; const italicLabel = 'Add italic text '; const quoteLabel = 'Insert a quote'; const codeLabel = 'Insert a code'; +const linkLabel = 'Add a link '; export default class MarkdownToolbar extends Component { render(props: RenderableProps) { @@ -39,6 +41,9 @@ export default class MarkdownToolbar extends Component { + + + );