Skip to content

Commit

Permalink
umputun#371 add image icon for toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Mavrin committed Jul 13, 2019
1 parent accaae0 commit 1d16c2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @jsx h */
import { h } from 'preact';

export default function ImageIcon() {
return (
<svg className="input__toolbar-icon" width="12" height="16" viewBox="0 0 384 512" aria-hidden="true">
<path
fill-rule="evenodd"
d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"
/>
</svg>
);
}
5 changes: 5 additions & 0 deletions frontend/app/components/input/markdown-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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';
import ImageIcon from './markdown-toolbar-icons/image-icon';
import UnorderedListIcon from './markdown-toolbar-icons/unordered-list-icon';
import OrderedListIcon from './markdown-toolbar-icons/ordered-list-icon';

Expand All @@ -22,6 +23,7 @@ const codeLabel = 'Insert a code';
const linkLabel = 'Add a link <cmd-k>';
const unorderedListLabel = 'Add a bulleted list';
const orderedListLabel = 'Add a numbered list';
const attachImageLabel = 'Attach an image';

export default class MarkdownToolbar extends Component<Props> {
render(props: RenderableProps<Props>) {
Expand All @@ -48,6 +50,9 @@ export default class MarkdownToolbar extends Component<Props> {
<md-link className="input__toolbar-item" title={linkLabel} aria-label={linkLabel}>
<LinkIcon />
</md-link>
<md-link className="input__toolbar-item" title={attachImageLabel} aria-label={attachImageLabel}>
<ImageIcon />
</md-link>
</div>
<div className="input__toolbar-group">
<md-unordered-list className="input__toolbar-item" title={unorderedListLabel} aria-label={unorderedListLabel}>
Expand Down

0 comments on commit 1d16c2a

Please sign in to comment.