Skip to content

Commit

Permalink
feat: support displaying best buddy badge in gym defenders
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed May 11, 2024
1 parent 0c571d3 commit 5f53b8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/locales/lib/human/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
"starts": "Starts",
"ends": "Ends",
"defender": "Defender",
"best_buddy": "Best buddy",
"cp": "CP",
"kilogram": "kg",
"meter": "m",
Expand Down
14 changes: 14 additions & 0 deletions src/features/gym/GymPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,19 @@ const GymFooter = ({ lat, lon, hasRaid }) => {
)
}

const BestBuddyBadge = () => {
const { t } = useTranslation()
const Icons = useMemory((s) => s.Icons)
return (
<Img
src={Icons.getMisc('bestbuddy')}
alt={t('best_buddy')}
maxHeight="15"
maxWidth="15"
/>
)
}

/**
*
* @param {import('@rm/types').Gym} props
Expand Down Expand Up @@ -661,6 +674,7 @@ const ExtraGymInfo = ({
gpd.shiny,
)}
>
{gpd.badge === 1 && BestBuddyBadge()}
{t(`poke_${guarding_pokemon_id}`)}
</TextWithIcon>
</ExtraInfo>
Expand Down

0 comments on commit 5f53b8f

Please sign in to comment.