Skip to content

Move font and text style to theme#90

Merged
SjaakSchilperoort merged 2 commits intodevelopfrom
feature/add-font-and-text-to-theme
Apr 6, 2026
Merged

Move font and text style to theme#90
SjaakSchilperoort merged 2 commits intodevelopfrom
feature/add-font-and-text-to-theme

Conversation

@SjaakSchilperoort
Copy link
Copy Markdown
Member

@SjaakSchilperoort SjaakSchilperoort commented Mar 31, 2026

Resolves: #89

  • Moved textStyle to theme as theme.text
  • Copied font to theme. src/styles still has the static type for font. When the apps have switched completely to dynamic theme, the static type for font can be removed
  • Added three exports
    • @observation.org/react-native-components for UI components
    • @observation.org/react-native-components/theme for theme-related classes, types and objects
    • @observation.org/react-native-components/styles for static styles
  • Adapted all components to use font and text style from dynamic theme
  • Cleaned up package.json

@SjaakSchilperoort SjaakSchilperoort force-pushed the feature/add-font-and-text-to-theme branch from 8e9aa1c to 8ed8511 Compare March 31, 2026 20:45
Copy link
Copy Markdown

@barry-observation barry-observation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ziet er netjes uit 👌


const onToggle = (index: number, isExpanded: boolean) => {
Log.debug('Accordion:onToggle', index, isExpanded)
unsafeLayoutAnimation('Accordion:onToggle')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit is het enige wat me opvalt. Is de layout animation niet (meer) nodig of vangen we dit op een andere manier op? Ik heb bijvoorbeeld naar de animaties van ChallengeContentItems op de challange-resultaten in ObsIdentify gekeken en ik kon geen verschil vinden.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De animaties zijn wel nodig, maar bij overgang naar de new architecture van React Animation hebben we gebruik van LayoutAnimation op veel plekken verwijderd. Het leidde tot app crashes wegens gebruik van een component die niet meer was gemount. De app gedraagt zich op die plekken niet zo vloeiend meer. De oplossing is om deze animates te herimplementeren met reanimated.

Ik dacht dat het gebruik van layout animation in de components library een left over was die we over het hoofd hadden gezien, maar ik zie dat Observation het op nog meer plekken gebruikt. Ik zal het verwijderen van layout animation in de components library terugdraaien, en dan kunnen we separaat beslissen hoe we hiermee om gaan.

@SjaakSchilperoort SjaakSchilperoort merged commit 6bc4b12 into develop Apr 6, 2026
2 checks passed
@SjaakSchilperoort SjaakSchilperoort deleted the feature/add-font-and-text-to-theme branch April 6, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make text styles theme-aware

2 participants