Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formula text being janky #2618

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading