From 947e7e5abdddee239f3984b35630750ae810e7f1 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 12 Feb 2021 13:37:57 +0100 Subject: basic media attachments --- src/ui/Note.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ui/Note.js') 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 (
+ {attachment.map(a => )}
); }; -- cgit v1.2.3