From 37b38d33fcfa304568e5373bf5f8ea9e08852ce6 Mon Sep 17 00:00:00 2001 From: Jakob Stornig Date: Wed, 20 Dec 2023 22:54:06 +0100 Subject: [PATCH] maintainance: applied new Theme context to component --- components/home/Welcome/Welcome.tsx | 4 +++- components/index.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/home/Welcome/Welcome.tsx b/components/home/Welcome/Welcome.tsx index 265cce4..41a52fa 100644 --- a/components/home/Welcome/Welcome.tsx +++ b/components/home/Welcome/Welcome.tsx @@ -3,6 +3,7 @@ import { Image, Text, View, ViewProps } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' import { MARGINS, SIZES } from '../../../constants/theme' import { useThemeColor } from '../../../hooks/useThemeColor' +import { useTheme } from '../../../app/contexts/ThemeContext' type WelcomeProps = ViewProps & {name: string, image : any, onPress: () => void | undefined} @@ -28,12 +29,13 @@ function getTimeOfDay(date: Date) : string { export default function Welcome(props: WelcomeProps) { + const {colors} = useTheme() const date = new Date() const dateString = formatDate(date) const timeOfDay = getTimeOfDay(date) const onpress = props.onPress - const textcolor = useThemeColor("primaryText") + const textcolor = colors.primaryText //const backgroundColor: string = useThemeColor("backgroundColor") return ( diff --git a/components/index.tsx b/components/index.tsx index 7d697da..61d8ef7 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -4,10 +4,10 @@ import Welcome from "./home/Welcome/Welcome" import { ToggleSetting, ButtonSetting } from "./home/userSettings/Setting" //common -import LoadingSymbol from "./common/loadingSymbol/loadingSymbol" -import Plus from "./common/plus/plus" -import SearchBar from "./common/searchBar/SearchBar" -import CustomCard from "./common/customCard/CustomCard" +import LoadingSymbol from "./common/loadingSymbol" +import Plus from "./common/plus" +import SearchBar from "./common/SearchBar" +import CustomCard from "./common/CustomCard" //login