Skip to content

Commit cf9e412

Browse files
committed
fix: support light mode for motivation display
Thanks Claude Sonnet 4!
1 parent 4c755b2 commit cf9e412

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/features/gym/GymPopup.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Typography from '@mui/material/Typography'
1313
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew'
1414
import ShieldIcon from '@mui/icons-material/Shield'
1515
import FavoriteIcon from '@mui/icons-material/Favorite'
16+
import { useTheme } from '@mui/material/styles'
1617
import { useTranslation } from 'react-i18next'
1718

1819
import { useSyncData } from '@features/webhooks'
@@ -149,6 +150,7 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
149150
*/
150151
function DefendersModal({ gym, onClose }) {
151152
const { t } = useTranslation()
153+
const theme = useTheme()
152154
const Icons = useMemory((s) => s.Icons)
153155
const defenders = gym.defenders || []
154156

@@ -279,7 +281,7 @@ function DefendersModal({ gym, onClose }) {
279281
position: 'absolute',
280282
width: 28,
281283
height: 28,
282-
stroke: 'white',
284+
stroke: theme.palette.text.primary,
283285
strokeWidth: 1,
284286
filter: 'drop-shadow(0 0 1px #0008)',
285287
}}
@@ -288,7 +290,7 @@ function DefendersModal({ gym, onClose }) {
288290
{/* Heart background */}
289291
<FavoriteIcon
290292
style={{
291-
color: 'white',
293+
color: theme.palette.mode === 'dark' ? 'white' : '#f0f0f0',
292294
opacity: 0.18,
293295
position: 'absolute',
294296
width: 28,
@@ -321,7 +323,7 @@ function DefendersModal({ gym, onClose }) {
321323
// Always show top crack if percent <= 2/3
322324
<path
323325
d="M2,9 Q7,11 14,9 Q21,11 26,9"
324-
stroke="white"
326+
stroke={theme.palette.text.primary}
325327
strokeWidth={1.5}
326328
fill="none"
327329
strokeLinejoin="round"
@@ -331,7 +333,7 @@ function DefendersModal({ gym, onClose }) {
331333
// Show bottom crack only if percent <= 1/3
332334
<path
333335
d="M7,19 Q11,17 14,19 Q17,17 21,19"
334-
stroke="white"
336+
stroke={theme.palette.text.primary}
335337
strokeWidth={1.5}
336338
fill="none"
337339
strokeLinejoin="round"

0 commit comments

Comments
 (0)