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/Attachment.js | 27 +++++++++++++++++++++++++++ src/ui/Discussion.js | 3 ++- src/ui/Note.js | 8 +++++++- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/ui/Attachment.js (limited to 'src') diff --git a/src/ui/Attachment.js b/src/ui/Attachment.js new file mode 100644 index 0000000..829dc8a --- /dev/null +++ b/src/ui/Attachment.js @@ -0,0 +1,27 @@ +import { h } from 'preact'; +import css from './css'; + +css` +.attachment { + margin: 1rem; + + width: 18rem; + height: 10rem; + object-fit: contain; +} + +.attachment + .attachment { + margin-top: 0; +} +`; + +export const Attachment = ({ type, mediaType, url, style }) => { + let content; + if (mediaType.startsWith('video/')) { + content =