fix: fixes no-typography-in-styles violations [PERA-4132]#382
Merged
Conversation
wjbeau
approved these changes
Apr 24, 2026
|
|
||
| const titleStyle = { | ||
| lineHeight: TITLE_LINE_HEIGHT, | ||
| flexWrap: 'nowrap' as const, |
| ...getTypography(theme, 'body'), | ||
| fontWeight: '600' as const, | ||
| textTransform: 'none' as const, | ||
| } |
| export const useStyles = makeStyles(theme => { | ||
| const activeTitle = { | ||
| color: theme.colors.textMain, | ||
| fontSize: TITLE_FONT_SIZE, |
Contributor
There was a problem hiding this comment.
Can we just use one of the existing styles here?
Comment on lines
+17
to
+20
| const TITLE_FONT_SIZE = 17 | ||
| const LIST_TITLE_FONT_SIZE = 16 | ||
| const DATE_VALUE_FONT_SIZE = 16 | ||
| const DONE_BUTTON_FONT_SIZE = 17 |
Contributor
There was a problem hiding this comment.
Again, do we really need these weird font sizes? I reckon we should just snap to an existing font size for now?
| variant='h4' | ||
| style={styles.title} | ||
| > | ||
| Custom Range |
Contributor
There was a problem hiding this comment.
We should have these i18n (not necessarily this PR but since you're here...
| variant='body' | ||
| style={styles.dateLabel} | ||
| > | ||
| From |
| variant='body' | ||
| style={styles.dateLabel} | ||
| > | ||
| To |
| alignItems: 'center', | ||
| gap: theme.spacing.sm, | ||
| }, | ||
| const TAG_FONT_SIZE = 12 |
Contributor
There was a problem hiding this comment.
can we just use a standard size?
| learnMoreText: { | ||
| fontSize: 16, | ||
| fontWeight: '500', | ||
| const LEARN_MORE_FONT_SIZE = 16 |
| marginBottom: theme.spacing.xxs, | ||
| }, | ||
| itemSubtitle: { | ||
| const ITEM_SUBTITLE_FONT_SIZE = 12 |
Replace `as const` annotations with explicit TextStyle typing where typography props are extracted to dodge no-typography-in-styles. Drop custom font-size overrides on PWText variants so the variant typography applies, and remove dead style entries that were never referenced.
yasin-ce
added a commit
that referenced
this pull request
Apr 27, 2026
Three fixes for runtime/style regressions inherited via the latest
main merge:
- PWText: drop the redundant h1/h2/h3/h4 booleans that were forwarded
to RNEUI's Text. RNEUI flattens its theme h{n}Style at the END of
the style chain, which silently overrode any color the caller put
on `style`. The flags were a no-op for callers using `variant='body'`
(the default), but PR #382 added `variant='h4'` to PWButton's title
PWText — making every primary button's title color get stomped to
textMain. In dark mode buttonPrimaryText (gray[900]) was overridden
by textMain (gray[100]), producing washed-out text on yellow.
styles.text already applies the full typography via getTypography,
so the h{n} flags were both redundant and harmful.
- App.tsx: PR #383 changed the pre-bootstrap loading label from
<Text> to <PWText>, but PWText's makeStyles needs a ThemeProvider
in the tree, and the only ThemeProvider lives inside RootComponent
which only mounts after `bootstrapped && persister`. Crash in
typography.ts:46 when accessing `theme.colors.textMain`. Wrap the
pre-bootstrap branch in its own ThemeProvider (using getTheme +
useIsDarkMode) so PWText has the context it needs while keeping
the no-primitive-rn-components guardrail satisfied.
- ViewContactScreen styles.ts: replace divider `height: 1` with
`theme.borders.sm` to satisfy the no-numeric-sizes guardrail
introduced upstream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
no-typography-in-stylesviolations in the codebase.Related Issues
Checklist
Additional Notes