File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
apps/src/tests/issue-tests Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { StyleSheet } from 'react-native' ;
3+ import { ThemedText , ThemedView } from '@apps/shared' ;
4+ import { ThemeProvider } from '@apps/shared/styling/theme-provider/ThemeProvider' ;
5+ import { SafeAreaView } from 'react-native-safe-area-context' ;
6+
7+ export default function TestThemeProvider ( ) {
8+ return (
9+ < SafeAreaView style = { styles . container } >
10+ < ThemedView style = { styles . section } >
11+ < ThemedText style = { styles . heading } > Without ThemeProvider</ ThemedText >
12+ < ThemedText > This text uses the theme from parent NavigationContainer.</ ThemedText >
13+ </ ThemedView >
14+
15+ < ThemeProvider theme = "dark" >
16+ < ThemedView style = { styles . section } >
17+ < ThemedText style = { styles . heading } > With ThemeProvider (dark)</ ThemedText >
18+ < ThemedText > This text should use dark theme colors (light text, dark background).</ ThemedText >
19+ </ ThemedView >
20+ </ ThemeProvider >
21+
22+ < ThemeProvider theme = "light" >
23+ < ThemedView style = { styles . section } >
24+ < ThemedText style = { styles . heading } > With ThemeProvider (light)</ ThemedText >
25+ < ThemedText > This text should use light theme colors explicitly.</ ThemedText >
26+ </ ThemedView >
27+ </ ThemeProvider >
28+ </ SafeAreaView >
29+ ) ;
30+ }
31+
32+ const styles = StyleSheet . create ( {
33+ container : {
34+ flex : 1 ,
35+ padding : 16 ,
36+ gap : 16 ,
37+ } ,
38+ section : {
39+ padding : 16 ,
40+ borderRadius : 8 ,
41+ } ,
42+ heading : {
43+ fontSize : 16 ,
44+ fontWeight : 'bold' ,
45+ marginBottom : 8 ,
46+ } ,
47+ } ) ;
Original file line number Diff line number Diff line change @@ -205,3 +205,4 @@ export { default as TestScreenStack } from './TestScreenStack';
205205export { default as TestSplit } from './TestSplit' ;
206206export { default as TestSafeAreaViewIOS } from './TestSafeAreaViewIOS' ;
207207export { default as TestStackNesting } from './TestStackNesting' ;
208+ export { default as TestThemeProvider } from './TestThemeProvider' ;
You can’t perform that action at this time.
0 commit comments