@@ -15,6 +15,7 @@ import Qonversion, {
1515 ScreenPresentationConfig ,
1616 NoCodes ,
1717 NoCodesError ,
18+ NoCodesTheme ,
1819 type PurchaseDelegate ,
1920 Product
2021} from '@qonversion/react-native-sdk' ;
@@ -35,6 +36,7 @@ const NoCodesScreen: React.FC = () => {
3536 ) ;
3637 const [ animated , setAnimated ] = useState ( false ) ;
3738 const [ locale , setLocale ] = useState ( '' ) ;
39+ const [ theme , setTheme ] = useState < NoCodesTheme > ( NoCodesTheme . AUTO ) ;
3840
3941 useEffect ( ( ) => {
4042 // Initialize No-Codes SDK once
@@ -216,6 +218,22 @@ const NoCodesScreen: React.FC = () => {
216218 }
217219 } ;
218220
221+ const applyTheme = ( selectedTheme : NoCodesTheme ) => {
222+ try {
223+ console . log ( '🔄 [NoCodes] Setting theme to:' , selectedTheme ) ;
224+ setTheme ( selectedTheme ) ;
225+ NoCodes . getSharedInstance ( ) . setTheme ( selectedTheme ) ;
226+ console . log ( '✅ [NoCodes] setTheme() call successful' ) ;
227+ Snackbar . show ( {
228+ text : `Theme set to: ${ selectedTheme } ` ,
229+ duration : Snackbar . LENGTH_SHORT ,
230+ } ) ;
231+ } catch ( error : any ) {
232+ console . error ( '❌ [NoCodes] setTheme() call failed:' , error ) ;
233+ Alert . alert ( 'Error' , error . message ) ;
234+ }
235+ } ;
236+
219237 return (
220238 < ScrollView
221239 style = { styles . container }
@@ -283,6 +301,23 @@ const NoCodesScreen: React.FC = () => {
283301 </ TouchableOpacity >
284302 </ View >
285303
304+ < View style = { styles . inputContainer } >
305+ < Text style = { styles . sectionTitle } > Theme</ Text >
306+ < Text style = { styles . inputLabel } > Select theme mode:</ Text >
307+ { Object . values ( NoCodesTheme ) . map ( ( themeOption ) => (
308+ < TouchableOpacity
309+ key = { themeOption }
310+ style = { [
311+ styles . radioButton ,
312+ theme === themeOption && styles . radioButtonSelected ,
313+ ] }
314+ onPress = { ( ) => applyTheme ( themeOption ) }
315+ >
316+ < Text style = { styles . radioButtonText } > { themeOption } </ Text >
317+ </ TouchableOpacity >
318+ ) ) }
319+ </ View >
320+
286321 < TouchableOpacity style = { styles . button } onPress = { close } >
287322 < Text style = { styles . buttonText } > Close</ Text >
288323 </ TouchableOpacity >
0 commit comments