Skip to content

Commit

Permalink
Fix formula text being janky
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentvan7 committed Jan 25, 2025
1 parent 234d0cd commit c584309
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions libs/gi/ui/src/util/getCalcDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import { Translate } from '@genshin-optimizer/gi/i18n'
import type { CalcResult } from '@genshin-optimizer/gi/uidata'
import type { Info, InfoExtra, KeyMapPrefix } from '@genshin-optimizer/gi/wr'
import { Typography } from '@mui/material'
import { useContext, type ReactNode } from 'react'
import { SillyContext } from '../context'
import { resolveInfo } from './resolveInfo'
Expand Down Expand Up @@ -221,15 +220,18 @@ function computeFormulaDisplay(

components.filter((c) => c)
result.formula = (
<Typography
sx={{
textDecoration: info.strikethrough ? 'line-through' : undefined,
}}
>
<>
{components.map((x, i) => (
<span key={i}>{x}</span>
<span
style={{
textDecoration: info.strikethrough ? 'line-through' : undefined,
}}
key={i}
>
{x}
</span>
))}
</Typography>
</>
)

return result
Expand Down

0 comments on commit c584309

Please sign in to comment.