Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding link to emote creator's 7TV profile to emote cards #1084

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading