Skip to content

Commit

Permalink
fix: show tooltips when hovering over hints
Browse files Browse the repository at this point in the history
Once we switched to SVGR the existing tooltip children were incompatible and needed to leverage forwardRef. However, wrapping these in <span> is a much simpler workaround.
  • Loading branch information
RevolutionTech committed Aug 6, 2022
1 parent 156c1cd commit 4f506fc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/client/display/NonPlayerDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export const NonPlayerDisplay = (props: Props) => {
title="This hint becomes available once this non-player pile is exhausted."
PopperProps={{ disablePortal: true }}
>
<LockedHint style={HINT_STYLES} />
<span>
<LockedHint style={HINT_STYLES} />
</span>
</Tooltip>
</Hints>
)}
Expand Down
12 changes: 9 additions & 3 deletions src/client/display/PlayerHints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const PlayerHints = (props: Props) => {
title={`This hint was used by ${playerName}.`}
PopperProps={{ disablePortal: true }}
>
<UsedHint style={HINT_STYLES} />
<span>
<UsedHint style={HINT_STYLES} />
</span>
</Tooltip>
))}
{_.range(hintsUnused).map((_, i) => (
Expand All @@ -38,15 +40,19 @@ export const PlayerHints = (props: Props) => {
title={`This hint is available only to ${playerName}.`}
PopperProps={{ disablePortal: true }}
>
<UnusedHint style={HINT_STYLES} />
<span>
<UnusedHint style={HINT_STYLES} />
</span>
</Tooltip>
))}
{hintsUnused === 0 && teamHintsAvailable > 0 && (
<Tooltip
title={`${playerName} can still give a clue by using one of the team's shared hints.`}
PopperProps={{ disablePortal: true }}
>
<AvailableHint style={HINT_STYLES} />
<span>
<AvailableHint style={HINT_STYLES} />
</span>
</Tooltip>
)}
</Hints>
Expand Down
8 changes: 6 additions & 2 deletions src/client/display/TeamDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const TeamDisplay = (props: Props) => {
title="This hint is available to players that have used all of their own hints."
PopperProps={{ disablePortal: true }}
>
<UnusedHint style={HINT_STYLES} />
<span>
<UnusedHint style={HINT_STYLES} />
</span>
</Tooltip>
))}
{_.range(hints.locked).map((_, i) => (
Expand All @@ -57,7 +59,9 @@ export const TeamDisplay = (props: Props) => {
title="This hint becomes available once every player uses all of their own hints."
PopperProps={{ disablePortal: true }}
>
<LockedHint style={HINT_STYLES} />
<span>
<LockedHint style={HINT_STYLES} />
</span>
</Tooltip>
))}
</Hints>
Expand Down

0 comments on commit 4f506fc

Please sign in to comment.