diff --git a/src/components/MyButton.tsx b/src/components/MyButton.tsx index c6a1e73..d5cb5f1 100644 --- a/src/components/MyButton.tsx +++ b/src/components/MyButton.tsx @@ -4,12 +4,14 @@ import { ImageSourcePropType, ImageStyle, StyleProp, - Text, TouchableOpacity, ViewStyle, } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import {MyIcon} from './MyIcon'; +import {useSelector} from 'react-redux'; +import {RootState} from '@redux/store'; +import { Text } from '@gluestack-ui/themed'; interface MyImageButtonProps { image: ImageSourcePropType; @@ -18,10 +20,14 @@ interface MyImageButtonProps { } export function MyImageButton({image, imageStyle, text}: MyImageButtonProps) { + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + return ( @@ -50,8 +55,12 @@ interface MyButtonProps { } export function MyButton({style, type, text, onPress}: MyButtonProps) { + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + const ButtonText = () => ( - + {text} ); @@ -67,7 +76,7 @@ export function MyButton({style, type, text, onPress}: MyButtonProps) { onPress={onPress}> {type === 'primary' ? ( ; + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + + return ( + + ); } interface MyDividerWithTextProps { @@ -9,16 +24,34 @@ interface MyDividerWithTextProps { } export function MyDividerWithText({text}: MyDividerWithTextProps) { + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + return ( - {text} + + {text} + ); } +export function MyVerticalDivider() { + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); -export function MyVerticalDivider(){ - return -} \ No newline at end of file + return ( + + ); +} diff --git a/src/components/MyInput.tsx b/src/components/MyInput.tsx index 6c12d2d..1b0f032 100644 --- a/src/components/MyInput.tsx +++ b/src/components/MyInput.tsx @@ -1,5 +1,8 @@ -import {KeyboardTypeOptions, Text, TextInput, View} from 'react-native'; +import {KeyboardTypeOptions, TextInput, View} from 'react-native'; import {MyIcon} from './MyIcon'; +import {useSelector} from 'react-redux'; +import {RootState} from '@redux/store'; +import { Text } from '@gluestack-ui/themed'; interface MyIconInputProps { text: string; @@ -11,13 +14,31 @@ interface MyIconInputProps { disableContainer?: boolean; } -export function MyIconInput({text, iconName, keyboardType, secureTextEntry, value, onChangeText, disableContainer}: MyIconInputProps) { +export function MyIconInput({ + text, + iconName, + keyboardType, + secureTextEntry, + value, + onChangeText, + disableContainer, +}: MyIconInputProps) { + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + return ( + style={[ + { + flexDirection: 'row', + alignItems: 'center', + }, + !disableContainer && { + backgroundColor: currentTheme.backgroundDark300, + borderRadius: 10, + }, + ]}> @@ -26,10 +47,10 @@ export function MyIconInput({text, iconName, keyboardType, secureTextEntry, valu {text} {text} diff --git a/src/configs/gluestack-ui.config.ts b/src/configs/gluestack-ui.config.ts index 7b9ed6c..72ebbc1 100644 --- a/src/configs/gluestack-ui.config.ts +++ b/src/configs/gluestack-ui.config.ts @@ -211,9 +211,9 @@ export const gluestackUIConfig = createConfig({ warmGray100: '#f5f5f4', warmGray200: '#e7e5e4', warmGray300: '#d6d3d1', - warmGray400: '#a8a29e', + warmGray400: '#a8a29e', // divider with text warmGray500: '#78716c', - warmGray600: '#57534e', + warmGray600: '#57534e', // vertical divider warmGray700: '#44403c', warmGray800: '#292524', warmGray900: '#1c1917', @@ -311,6 +311,8 @@ export const gluestackUIConfig = createConfig({ light700: '#44403c', light800: '#292524', light900: '#1c1917', + primary: '#6030da', + /* primary0: '#E5F1FB', primary50: '#CCE9FF', primary100: '#ADDBFF', @@ -322,8 +324,8 @@ export const gluestackUIConfig = createConfig({ primary700: '#004282', primary800: '#002851', primary900: '#011838', - primary950: '#000711', - secondary0: '#F6F6F6', + primary950: '#000711', */ + /*secondary0: '#F6F6F6', secondary50: '#F3F3F3', secondary100: '#E9E9E9', secondary200: '#DADADA', @@ -334,7 +336,8 @@ export const gluestackUIConfig = createConfig({ secondary700: '#404040', secondary800: '#262626', secondary900: '#171717', - secondary950: '#0C0C0C', + secondary950: '#0C0C0C', */ + secondary: '#931278', textLight0: '#FCFCFC', textLight50: '#F5F5F5', textLight100: '#E5E5E5', @@ -343,7 +346,7 @@ export const gluestackUIConfig = createConfig({ textLight400: '#A3A3A3', textLight500: '#8C8C8C', textLight600: '#737373', - textLight700: '#525252', + textLight700: '#fff', // text textLight800: '#404040', textLight900: '#262626', textLight950: '#171717', @@ -383,11 +386,10 @@ export const gluestackUIConfig = createConfig({ borderLight800: '#404040', borderLight900: '#262626', borderLight950: '#171717', - backgroundDark50: '#3e3e88', backgroundDark100: '#393972', - backgroundDark200: '#32325c', - backgroundDark300: '#2b2b48', + backgroundDark200: '#37375c', // divider + backgroundDark300: '#26263f', // container backgroundDark400: '#212137', // primary background backgroundDark500: '#1c1c2a', backgroundDark600: '#16161f', diff --git a/src/navigation/navigation.tsx b/src/navigation/navigation.tsx index 1b5afd0..4cd9b9c 100644 --- a/src/navigation/navigation.tsx +++ b/src/navigation/navigation.tsx @@ -13,7 +13,7 @@ import ProfileTab, { ProfileStackNavigatorParamList, } from './tabs/main/ProfileTab'; import {FadeInView} from '@helper/animations'; -import {Text, TouchableOpacity, View} from 'react-native'; +import {TouchableOpacity, View} from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { RegistrationScreenAnim, @@ -23,6 +23,7 @@ import {NativeStackNavigationProp} from '@react-navigation/native-stack'; import {MyIcon} from '@components/MyIcon'; import {useSelector} from 'react-redux'; import {RootState, store as reduxStore} from '@redux/store'; +import { Text } from '@gluestack-ui/themed'; export type RootStackNavigatorParamList = { Home: NavigatorScreenParams; @@ -90,12 +91,16 @@ function ChatsTabAnim(props: any) { const tabBarIcons = ['account-circle', 'calendar-month', 'map', 'chat']; function CustomTabBar(props: BottomTabBarProps) { - const {state, descriptors, navigation} = props; + const {state, navigation} = props; const lang = useSelector( (state: RootState) => state.appVariables.lang.navigation.home, ); + const currentTheme = useSelector( + (state: RootState) => state.nonSaveVariables.themeColors, + ); + const tabNames = [ lang.profile.tabName, lang.calendar.tabName, @@ -104,12 +109,12 @@ function CustomTabBar(props: BottomTabBarProps) { ]; return ( - + {state.routes.map((route, index) => { @@ -136,8 +141,8 @@ function CustomTabBar(props: BottomTabBarProps) { // TODO: retrieve colors from theme const gradientColors = isFocused - ? ['#931278', '#6030da'] - : ['#26263f', '#26263f']; + ? [currentTheme.secondary, currentTheme.primary] + : [currentTheme.backgroundDark300, currentTheme.backgroundDark300]; return ( {isFocused && ( - {tabNames[index]} + {tabNames[index]} )} diff --git a/src/navigation/registration/registration.tsx b/src/navigation/registration/registration.tsx index ac6762e..c4dda51 100644 --- a/src/navigation/registration/registration.tsx +++ b/src/navigation/registration/registration.tsx @@ -10,7 +10,6 @@ import { Image, ScrollView, StyleSheet, - Text, TextInput, View, } from 'react-native'; @@ -30,6 +29,7 @@ import {KeyboardAvoidingView} from 'react-native'; import {MyTitle} from '@components/MyTitle'; import {useSelector} from 'react-redux'; import {RootState} from '@redux/store'; +import { Text } from '@gluestack-ui/themed'; export type RegistrationStackNavigatorParamList = { SignUpPreview: undefined; diff --git a/src/navigation/tabs/main/ChatsTab.tsx b/src/navigation/tabs/main/ChatsTab.tsx index 682811a..c6ea69a 100644 --- a/src/navigation/tabs/main/ChatsTab.tsx +++ b/src/navigation/tabs/main/ChatsTab.tsx @@ -1,10 +1,10 @@ import {MyScreenContainer} from '@components/MyScreenContainer'; +import { Text } from '@gluestack-ui/themed'; import { createNativeStackNavigator, NativeStackNavigationProp, } from '@react-navigation/native-stack'; import {RootState} from '@redux/store'; -import {Text} from 'react-native'; import {useSelector} from 'react-redux'; export const ChatsTabName = 'Chats'; diff --git a/src/navigation/tabs/main/MapTab.tsx b/src/navigation/tabs/main/MapTab.tsx index 41e5ab6..c6268f4 100644 --- a/src/navigation/tabs/main/MapTab.tsx +++ b/src/navigation/tabs/main/MapTab.tsx @@ -1,10 +1,10 @@ import { MyScreenContainer } from '@components/MyScreenContainer'; +import { Text } from '@gluestack-ui/themed'; import { createNativeStackNavigator, NativeStackNavigationProp, } from '@react-navigation/native-stack'; import {RootState} from '@redux/store'; -import {Text} from 'react-native'; import {useSelector} from 'react-redux'; export const MapTabName = 'Map';