From 4c3b6371972f9538068a2530c668763822380061 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 4 Nov 2024 22:45:54 +0100 Subject: [PATCH] feat: :sparkles: Improve note design --- components/social-elements/notes/header.vue | 86 ++++++++++++------- .../notes/interactions/row.vue | 7 +- 2 files changed, 60 insertions(+), 33 deletions(-) diff --git a/components/social-elements/notes/header.vue b/components/social-elements/notes/header.vue index 3977811..a4d5d09 100644 --- a/components/social-elements/notes/header.vue +++ b/components/social-elements/notes/header.vue @@ -9,8 +9,7 @@
- {{ - note?.account.display_name }} + {{ note?.account.display_name }} @@ -33,36 +32,43 @@
- {{ - note?.account.display_name }} + {{ note?.account.display_name }} - - - {{ timeAgo }} - + +
- - - - @{{ - note?.account.acct - }} - - - - +
+ + +
+ @{{ username }}{{ instance && "@" }}{{ instance }} + · + + {{ timeAgo }} + + +
+ + +
+
+
@@ -78,9 +84,12 @@ const props = defineProps<{ small?: boolean; }>(); +const username = props.note?.account.acct.split("@")[0]; +const instance = props.note?.account.acct.split("@")[1]; + const noteUrl = props.note && `/@${props.note.account.acct}/${props.note.id}`; const accountUrl = props.note && `/@${props.note.account.acct}`; -const timeAgo = useTimeAgo(props.note?.created_at ?? 0); +const timeAgo = useTimeAgo(props.note?.created_at ?? 0, {}); const fullTime = Intl.DateTimeFormat("default", { dateStyle: "medium", timeStyle: "short", @@ -97,4 +106,23 @@ const copyAccount = () => { }, 2000); } }; + +const visibilities = { + public: { + icon: "tabler:world", + text: "This note is public: it can be seen by anyone.", + }, + unlisted: { + icon: "tabler:lock-open", + text: "This note is unlisted: it can be seen by anyone with the link.", + }, + private: { + icon: "tabler:lock", + text: "This note is private: it can only be seen by followers.", + }, + direct: { + icon: "tabler:mail", + text: "This note is direct: it can only be seen by mentioned users.", + }, +}; \ No newline at end of file diff --git a/components/social-elements/notes/interactions/row.vue b/components/social-elements/notes/interactions/row.vue index a84b016..94f1603 100644 --- a/components/social-elements/notes/interactions/row.vue +++ b/components/social-elements/notes/interactions/row.vue @@ -5,27 +5,26 @@ :disabled="!identity">