Skip to content

Commit

Permalink
Adding link to emote creator's 7TV profile to emote cards (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisScr3ams authored Oct 2, 2024
1 parent 158eb3f commit b5b7c79
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions locale/en_US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
24 changes: 24 additions & 0 deletions src/site/global/components/EmoteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ watchEffect(async () => {
}),
);
const { result: emoteArtistResult } = useQuery<userQuery.Result, userQuery.Variables>(
userQuery,
{
id: props.emote.data?.owner?.id ?? "",
},
() => ({
enabled: !!props.emote.data?.owner?.id,
}),
);
watch(
emoteActorResult,
(value) => {
Expand All @@ -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(
Expand Down

0 comments on commit b5b7c79

Please sign in to comment.