A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(app): show custom guild badges in place of built-in ones (#3712)
Hampus535f3f8d53b1
diff --git a/fluxer_app/src/features/guild/components/GuildBadge.tsx b/fluxer_app/src/features/guild/components/GuildBadge.tsxindex 92ec626a1..a84f94e50 100644--- a/fluxer_app/src/features/guild/components/GuildBadge.tsx+++ b/fluxer_app/src/features/guild/components/GuildBadge.tsx@@ -207,28 +207,26 @@ export const GuildBadge = observer(function GuildBadge({onLightSurface = false,}: GuildBadgeProps) {const size = variant === 'large' ? 24 : 20;- const builtIn = (- <BuiltInGuildBadge- features={features}- variant={variant}- size={size}- tooltipPosition={tooltipPosition}- showTooltip={showTooltip}- forceDarkTheme={forceDarkTheme}- onLightSurface={onLightSurface}- data-flx="guild.guild-badge.built-in-guild-badge"- />- );useEffect(() => {if (badgeIds.length > 0) revalidateUnknownBadges(badgeIds);}, [badgeIds]);const customBadges = assignedCustomBadges(badgeIds).slice(0, customBadgeLimit);if (customBadges.length === 0) {- return builtIn;+ return (+ <BuiltInGuildBadge+ features={features}+ variant={variant}+ size={size}+ tooltipPosition={tooltipPosition}+ showTooltip={showTooltip}+ forceDarkTheme={forceDarkTheme}+ onLightSurface={onLightSurface}+ data-flx="guild.guild-badge.built-in-guild-badge"+ />+ );}return (<span className={styles.badgeRow} data-flx="guild.guild-badge.badge-row">- {builtIn}{customBadges.map((badge) => (<CustomGuildBadgekey={badge.id}diff --git a/fluxer_docs/src/content/docs/admin-api/badges.mdx b/fluxer_docs/src/content/docs/admin-api/badges.mdxindex 65084240f..de62e5cab 100644--- a/fluxer_docs/src/content/docs/admin-api/badges.mdx+++ b/fluxer_docs/src/content/docs/admin-api/badges.mdx@@ -6,7 +6,7 @@ description: Admin API routes for making custom badges and giving them to usersimport RouteHeader from '@/components/RouteHeader.astro';-A custom badge is an image that instance admins make and give out. A user badge shows on the [profile](/http-api/users/#profile-badge-object) of each account it's given to, after the built-in badges. A guild badge shows next to the guild name, after its verified, partnered or discoverable badge, and [instance discovery](/http-api/instance/#guild-badge-object) lists every guild badge for clients.+A custom badge is an image that instance admins make and give out. A user badge shows on the [profile](/http-api/users/#profile-badge-object) of each account it's given to, after the built-in badges. A guild badge shows next to the guild name in place of its verified, partnered or discoverable badge, and [instance discovery](/http-api/instance/#guild-badge-object) lists every guild badge for clients.You can make up to 100 badges of each type, and an account or guild can have up to 10. Give badges with [Update user badges](/admin-api/users/#update-user-badges) and the `badge_ids` field of [Update guild](/admin-api/guilds/#update-guild). Deleting a badge takes it off everyone who had it. You can change the display order with [Reorder badges](#reorder-badges) or the Move up and Move down buttons on the Badges page of the admin panel.