diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2021-02-12 12:37:57 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2021-02-12 12:46:51 +0000 |
| commit | 947e7e5abdddee239f3984b35630750ae810e7f1 (patch) | |
| tree | 91195491f5764cce61b476914554b71a6b0fc0b9 /src/ui/Note.js | |
| parent | fix title display (diff) | |
| download | fedidag-947e7e5abdddee239f3984b35630750ae810e7f1.tar.gz fedidag-947e7e5abdddee239f3984b35630750ae810e7f1.zip | |
basic media attachments
Diffstat (limited to 'src/ui/Note.js')
| -rw-r--r-- | src/ui/Note.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/Note.js b/src/ui/Note.js index 404979c..e35171a 100644 --- a/src/ui/Note.js +++ b/src/ui/Note.js @@ -4,6 +4,7 @@ import ColorHash from 'color-hash'; import { formatRelative } from 'date-fns'; import cn from 'classnames'; import css from './css'; +import { Attachment } from './Attachment'; const now = new Date(); const Time = ({ time }) => { @@ -180,7 +181,7 @@ section.type-Tombstone.ellipsis > main::after { const colors = new ColorHash({ lightness: 0.8 }); export const Note = ({ - id, type, attributedTo, published, content, + id, type, attributedTo, published, content, attachment, smallHeader = false, collapsed = false, ellipsis = false, position, onCollapse, onSelect, onSize, }) => { @@ -196,6 +197,10 @@ export const Note = ({ onSize(id, root.current.offsetWidth, root.current.offsetHeight); }); + attachment ||= []; + if (!Array.isArray(attachment)) + attachment = [attachment]; + return ( <section style={{ @@ -227,6 +232,7 @@ export const Note = ({ innerHTML={content} onClick={onClick} /> + {attachment.map(a => <Attachment {...a} />)} </section> ); }; |
