From 234aa4dc59966f0be5ee26606f54b81a211e1ff3 Mon Sep 17 00:00:00 2001 From: Jacek Pudysz Date: Thu, 12 Dec 2024 13:48:20 +0100 Subject: [PATCH] feat: dynamic function with rt withunsityles --- example/App.tsx | 35 +++++++++++++++++-- .../withUnistyles/withUnistyles.native.tsx | 8 ++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/example/App.tsx b/example/App.tsx index 401f60a6..3d187871 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,5 +1,14 @@ import React, { useRef } from 'react' -import { Button, Pressable, PressableStateCallbackType, ScrollView, Text, TextInput, View } from 'react-native' +import { + Button, + ImageBackground, + Pressable, + PressableStateCallbackType, + ScrollView, + Text, + TextInput, + View +} from 'react-native' import { Blurhash } from 'react-native-blurhash' import { StyleSheet, @@ -69,7 +78,14 @@ export const App = () => { ))} - + + + + + setCount(prevState => prevState + 1)} @@ -144,10 +160,25 @@ const styles = StyleSheet.create((theme, rt) => ({ borderWidth: 5, borderColor: theme.colors.test }, + blurhashWithColor: (color: Record) => ({ + height: 100, + width: 100, + borderWidth: 5, + borderColor: rt.colorScheme === 'dark' ? color.dark : color.light + }), + imageBackground: (color: Record) => ({ + height: 100, + width: 100, + borderWidth: 5, + borderColor: rt.colorScheme === 'dark' ? color.dark : color.light + }), scrollView: { width: '100%', backgroundColor: theme.colors.accent }, + row: { + flexDirection: 'row', + }, contentContainerStyle: { transform: [{ translateX: rt.colorScheme === 'dark' ? 100 : 200 diff --git a/src/core/withUnistyles/withUnistyles.native.tsx b/src/core/withUnistyles/withUnistyles.native.tsx index d6336040..bc02ff47 100644 --- a/src/core/withUnistyles/withUnistyles.native.tsx +++ b/src/core/withUnistyles/withUnistyles.native.tsx @@ -48,6 +48,10 @@ export const withUnistyles =