Skip to content

Commit

Permalink
clean up active/hint JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Jan 1, 2024
1 parent 29689a1 commit 5c30049
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions src/components/mahjongTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function MahjongTile({
alt={getTileFriendlyName(tile)}
style={{ height: 64, position: 'absolute' }}
/>
{active && (
{(active || hint) && (
<svg
width={53}
height={64}
Expand All @@ -39,29 +39,9 @@ export default function MahjongTile({
y={0}
height={64}
width={53}
fill="#ff0000"
fill={active ? '#ff0000' : '#00ff00'}
fillOpacity={0.4}
stroke="#ff0000"
strokeWidth={2}
rx={8}
/>
</svg>
)}
{hint && (
<svg
width={53}
height={64}
viewBox="0 0 53 64"
style={{ zIndex: 10000 }}
>
<rect
x={0}
y={0}
height={64}
width={53}
fill="#00ff00"
fillOpacity={0.4}
stroke="#00ff00"
stroke={active ? '#ff0000' : '#00ff00'}
strokeWidth={2}
rx={8}
/>
Expand Down

0 comments on commit 5c30049

Please sign in to comment.