From b5b7c79dc86a4a46b4d5d0d6384f98a39ac3256e Mon Sep 17 00:00:00 2001 From: ChrisScreams <103491518+ChrisScr3ams@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:40:59 +0200 Subject: [PATCH] Adding link to emote creator's 7TV profile to emote cards (#1084) --- CHANGELOG-nightly.md | 1 + locale/en_US.yaml | 1 + src/site/global/components/EmoteCard.vue | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/CHANGELOG-nightly.md b/CHANGELOG-nightly.md index 6e8d1602f..9b843fee7 100644 --- a/CHANGELOG-nightly.md +++ b/CHANGELOG-nightly.md @@ -2,6 +2,7 @@ - Fixed some settings on kick - Added more drop shadow settings +- Added link to creators 7TV profile to emote cards of 7TV emotes ### 3.1.2.1000 diff --git a/locale/en_US.yaml b/locale/en_US.yaml index e91e93d1c..344e9f0ab 100644 --- a/locale/en_US.yaml +++ b/locale/en_US.yaml @@ -24,6 +24,7 @@ user_card: highlight: Highlight messages of this user stop_highlight: Stop highlighting of this user no_messages: "{user} has not chatted here" + no_warnings: "{user} has not been warned before" no_timeouts: "{user} hasn't been timed out before" no_bans: "{user} hasn't been banned before" no_comments: "No mod comments have been written for {user}" diff --git a/src/site/global/components/EmoteCard.vue b/src/site/global/components/EmoteCard.vue index fd24e8f32..d30943b0c 100644 --- a/src/site/global/components/EmoteCard.vue +++ b/src/site/global/components/EmoteCard.vue @@ -134,6 +134,16 @@ watchEffect(async () => { }), ); + const { result: emoteArtistResult } = useQuery( + userQuery, + { + id: props.emote.data?.owner?.id ?? "", + }, + () => ({ + enabled: !!props.emote.data?.owner?.id, + }), + ); + watch( emoteActorResult, (value) => { @@ -147,10 +157,24 @@ watchEffect(async () => { { immediate: true }, ); + watch( + emoteArtistResult, + (value) => { + if (!value?.user) return; + artist.id = value?.user.id; + artist.username = value?.user.username; + artist.displayName = value?.user.display_name; + artist.avatarURL = value?.user.avatar_url; + artist.url = `https://7tv.app/users/${value?.user.id}`; + }, + { immediate: true }, + ); + timestamp.value = new Date(props.emote.timestamp ?? 0).toLocaleDateString(); emoteLink.value = `//7tv.app/emotes/${props.emote.id}`; } else if (props.emote.provider === "BTTV") emoteLink.value = `//betterttv.com/emotes/${props.emote.id}`; else if (props.emote.provider === "FFZ") emoteLink.value = `//frankerfacez.com/emoticon/${props.emote.id}`; + else if (props.emote.provider === "EMOJI") emoteLink.value = ""; }); watch(