Skip to content

Commit

Permalink
SRO: Add traces to sheets (#2562)
Browse files Browse the repository at this point in the history
* prelim addition of traces to sheets

* add translations and enabled/disabled stat boosts

* refactor

* refactor + sheet utils

* minor fixes
  • Loading branch information
frzyc authored Dec 7, 2024
1 parent 9d567aa commit 2e1eecf
Show file tree
Hide file tree
Showing 81 changed files with 939 additions and 1,012 deletions.
8 changes: 6 additions & 2 deletions libs/pando/ui-sheet/src/components/DocumentDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CardBackgroundColor } from '@genshin-optimizer/common/ui'
import { CardThemed } from '@genshin-optimizer/common/ui'
import { evalIfFunc } from '@genshin-optimizer/common/util'
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
import { Box, Collapse } from '@mui/material'
import { Box, Collapse, Typography } from '@mui/material'
import { useContext, useState } from 'react'
import { CalcContext, TagContext } from '../context'
import type { Document, FieldsDocument, TextDocument } from '../types'
Expand Down Expand Up @@ -68,7 +68,11 @@ function TextSectionDisplay({ textDocument }: { textDocument: TextDocument }) {
const calculator = useContext(CalcContext)
const tag = useContext(TagContext)
if (!calculator) return null
return <div>{evalIfFunc(textDocument.text, calculator.withTag(tag))}</div>
return (
<Typography>
{evalIfFunc(textDocument.text, calculator.withTag(tag))}
</Typography>
)
}
function TextSectionDisplayCollapse({
textDocument,
Expand Down
9 changes: 7 additions & 2 deletions libs/pando/ui-sheet/src/components/FieldDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ export function TextFieldDisplay({
return (
<Box
width="100%"
sx={{ display: 'flex', justifyContent: 'space-between', gap: 1 }}
sx={{
display: 'flex',
justifyContent: 'space-between',
gap: 1,
py: 0.25,
}}
component={component}
>
<Typography color={`${variant}.main`}>
Expand All @@ -78,7 +83,7 @@ export function TagFieldDisplay({
field,
component = ListItem,
emphasize,
showZero = false,
showZero = process.env.NODE_ENV === 'development',
}: {
field: TagField
component?: React.ElementType
Expand Down
2 changes: 1 addition & 1 deletion libs/pando/ui-sheet/src/types/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ReactNode } from 'react'
import type { Document } from './document'

export type UISheetElement = {
img: string | StaticImageData
img?: string | StaticImageData
title: ReactNode
subtitle?: ReactNode
documents: Document[]
Expand Down
21 changes: 21 additions & 0 deletions libs/sr/dm-localization/assets/locales/chs/charSheet_gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions libs/sr/dm-localization/assets/locales/chs/sheet_gen.json

This file was deleted.

8 changes: 0 additions & 8 deletions libs/sr/dm-localization/assets/locales/chs/slotKey_gen.json

This file was deleted.

21 changes: 21 additions & 0 deletions libs/sr/dm-localization/assets/locales/cht/charSheet_gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions libs/sr/dm-localization/assets/locales/cht/sheet_gen.json

This file was deleted.

8 changes: 0 additions & 8 deletions libs/sr/dm-localization/assets/locales/cht/slotKey_gen.json

This file was deleted.

21 changes: 21 additions & 0 deletions libs/sr/dm-localization/assets/locales/de/charSheet_gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions libs/sr/dm-localization/assets/locales/de/sheet_gen.json

This file was deleted.

8 changes: 0 additions & 8 deletions libs/sr/dm-localization/assets/locales/de/slotKey_gen.json

This file was deleted.

21 changes: 21 additions & 0 deletions libs/sr/dm-localization/assets/locales/en/charSheet_gen.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions libs/sr/dm-localization/assets/locales/en/sheet_gen.json

This file was deleted.

Loading

0 comments on commit 2e1eecf

Please sign in to comment.