Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
e2f587252a
2 changed files with 12 additions and 3 deletions
|
|
@ -29,6 +29,10 @@ export const enum BadgePosition {
|
|||
}
|
||||
|
||||
export interface ProfileBadge {
|
||||
/**
|
||||
* Badge id, unused by vencord, required by discord
|
||||
*/
|
||||
id: string,
|
||||
/** The tooltip to show on hover. Required for image badges */
|
||||
description?: string;
|
||||
/** Custom component for the badge (tooltip not included) */
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ const EQUICORD_CONTRIBUTOR_BADGE = "https://equicord.org/assets/favicon.png";
|
|||
const USERPLUGIN_CONTRIBUTOR_BADGE = "https://equicord.org/assets/icons/misc/userplugin.png";
|
||||
|
||||
const ContributorBadge: ProfileBadge = {
|
||||
id: "vencord_contributor_badge",
|
||||
description: "Vencord Contributor",
|
||||
iconSrc: CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
|
|
@ -45,6 +46,7 @@ const ContributorBadge: ProfileBadge = {
|
|||
};
|
||||
|
||||
const EquicordContributorBadge: ProfileBadge = {
|
||||
id: "equicord_contributor_badge",
|
||||
description: "Equicord Contributor",
|
||||
iconSrc: EQUICORD_CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
|
|
@ -59,6 +61,7 @@ const EquicordContributorBadge: ProfileBadge = {
|
|||
};
|
||||
|
||||
const UserPluginContributorBadge: ProfileBadge = {
|
||||
id: "user_plugin_contributor_badge",
|
||||
description: "User Plugin Contributor",
|
||||
iconSrc: USERPLUGIN_CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
|
|
@ -99,7 +102,7 @@ async function loadAllBadges(noCache = false) {
|
|||
|
||||
let intervalId: any;
|
||||
|
||||
export function BadgeContextMenu({ badge }: { badge: ProfileBadge & BadgeUserArgs; }) {
|
||||
export function BadgeContextMenu({ badge }: { badge: Omit<ProfileBadge, "id"> & BadgeUserArgs; }) {
|
||||
return (
|
||||
<Menu.Menu
|
||||
navId="vc-badge-context"
|
||||
|
|
@ -219,7 +222,8 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
getDonorBadges(userId: string) {
|
||||
return DonorBadges[userId]?.map(badge => ({
|
||||
return DonorBadges[userId]?.map((badge, idx) => ({
|
||||
id: `vencord_donor_badge_${idx}`,
|
||||
iconSrc: badge.badge,
|
||||
description: badge.tooltip,
|
||||
position: BadgePosition.START,
|
||||
|
|
@ -239,7 +243,8 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
getEquicordDonorBadges(userId: string) {
|
||||
return EquicordDonorBadges[userId]?.map(badge => ({
|
||||
return EquicordDonorBadges[userId]?.map((badge, idx) => ({
|
||||
id: `equicord_donor_badge_${idx}`,
|
||||
iconSrc: badge.badge,
|
||||
description: badge.tooltip,
|
||||
position: BadgePosition.START,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue