Skip to content

Commit f304f89

Browse files
authored
Merge pull request #37 from metaversecloud-com/dev
add description to tooltip
2 parents 186d4af + f4c5c7f commit f304f89

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

client/src/components/BadgesScreen/BadgesScreen.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ export const BadgesScreen = () => {
5252
<div className="grid grid-cols-3 gap-2 pt-4">
5353
{badges &&
5454
Object.values(badges).map((badge) => {
55-
const hasBadge = visitorInventory && Object.keys(visitorInventory).includes(badge.name);
56-
const style = { width: "90px" };
55+
const { name, description, icon } = badge;
56+
const hasBadge = visitorInventory && Object.keys(visitorInventory).includes(name);
57+
const style = { width: "90px", filter: "none" };
5758
if (!hasBadge) style.filter = "grayscale(1)";
5859
return (
59-
<div className="tooltip m-auto" key={badge.id}>
60-
<span className="tooltip-content">{badge.name}</span>
61-
<img src={badge.icon} alt={badge.name} style={style} />
60+
<div className="tooltip" key={name}>
61+
<span className="tooltip-content" style={{ width: "115px" }}>
62+
{name} {description && `- ${description}`}
63+
</span>
64+
<img src={icon} alt={name} style={style} />
6265
</div>
6366
);
6467
})}

0 commit comments

Comments
 (0)