From 50024fbc1dca2f314b627d41294cf3d98c7d4b49 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 12 Oct 2024 18:44:12 +0300 Subject: [PATCH] web/timeline: add better placeholder for redactions and undecryptable events --- web/src/icons/delete.svg | 1 + web/src/icons/lock-clock.svg | 1 + web/src/icons/lock.svg | 1 + web/src/ui/timeline/TimelineEvent.css | 20 +++++++++++++++++++ web/src/ui/timeline/content/EncryptedBody.tsx | 6 ++++-- web/src/ui/timeline/content/RedactedBody.tsx | 4 +++- 6 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 web/src/icons/delete.svg create mode 100644 web/src/icons/lock-clock.svg create mode 100644 web/src/icons/lock.svg diff --git a/web/src/icons/delete.svg b/web/src/icons/delete.svg new file mode 100644 index 0000000..a5dfc5c --- /dev/null +++ b/web/src/icons/delete.svg @@ -0,0 +1 @@ + diff --git a/web/src/icons/lock-clock.svg b/web/src/icons/lock-clock.svg new file mode 100644 index 0000000..d703df7 --- /dev/null +++ b/web/src/icons/lock-clock.svg @@ -0,0 +1 @@ + diff --git a/web/src/icons/lock.svg b/web/src/icons/lock.svg new file mode 100644 index 0000000..d4fe312 --- /dev/null +++ b/web/src/icons/lock.svg @@ -0,0 +1 @@ + diff --git a/web/src/ui/timeline/TimelineEvent.css b/web/src/ui/timeline/TimelineEvent.css index 141c9d3..259b58c 100644 --- a/web/src/ui/timeline/TimelineEvent.css +++ b/web/src/ui/timeline/TimelineEvent.css @@ -126,6 +126,26 @@ div.date-separator { } } +div.decryption-error-body { + display: flex; + align-items: center; + + > svg { + height: 20px; + color: red; + } +} + +div.redacted-body, div.decryption-pending-body { + display: flex; + align-items: center; + color: #888; + + > svg { + height: 20px; + } +} + div.html-body { overflow: hidden; img[data-mx-emoticon] { diff --git a/web/src/ui/timeline/content/EncryptedBody.tsx b/web/src/ui/timeline/content/EncryptedBody.tsx index 54d2e61..32da177 100644 --- a/web/src/ui/timeline/content/EncryptedBody.tsx +++ b/web/src/ui/timeline/content/EncryptedBody.tsx @@ -14,12 +14,14 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import { EventContentProps } from "./props.ts" +import LockIcon from "../../../icons/lock.svg?react" +import LockClockIcon from "../../../icons/lock.svg?react" const EncryptedBody = ({ event }: EventContentProps) => { if (event.decryption_error) { - return `Failed to decrypt: ${event.decryption_error}` + return
Failed to decrypt: {event.decryption_error}
} - return `Waiting for message` + return
Waiting for message
} export default EncryptedBody diff --git a/web/src/ui/timeline/content/RedactedBody.tsx b/web/src/ui/timeline/content/RedactedBody.tsx index ec95dbc..8846e11 100644 --- a/web/src/ui/timeline/content/RedactedBody.tsx +++ b/web/src/ui/timeline/content/RedactedBody.tsx @@ -13,8 +13,10 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +import DeleteIcon from "../../../icons/delete.svg?react" + const RedactedBody = () => { - return `Message deleted` + return
Message deleted
} export default RedactedBody