maintainance: applied new Theme context to component

This commit is contained in:
Jakob Stornig 2023-12-20 22:54:06 +01:00
parent d64db4d316
commit 37b38d33fc
2 changed files with 7 additions and 5 deletions

View file

@ -3,6 +3,7 @@ import { Image, Text, View, ViewProps } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler' import { TouchableOpacity } from 'react-native-gesture-handler'
import { MARGINS, SIZES } from '../../../constants/theme' import { MARGINS, SIZES } from '../../../constants/theme'
import { useThemeColor } from '../../../hooks/useThemeColor' import { useThemeColor } from '../../../hooks/useThemeColor'
import { useTheme } from '../../../app/contexts/ThemeContext'
type WelcomeProps = ViewProps & {name: string, image : any, onPress: () => void | undefined} 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) { export default function Welcome(props: WelcomeProps) {
const {colors} = useTheme()
const date = new Date() const date = new Date()
const dateString = formatDate(date) const dateString = formatDate(date)
const timeOfDay = getTimeOfDay(date) const timeOfDay = getTimeOfDay(date)
const onpress = props.onPress const onpress = props.onPress
const textcolor = useThemeColor("primaryText") const textcolor = colors.primaryText
//const backgroundColor: string = useThemeColor("backgroundColor") //const backgroundColor: string = useThemeColor("backgroundColor")
return ( return (

View file

@ -4,10 +4,10 @@ import Welcome from "./home/Welcome/Welcome"
import { ToggleSetting, ButtonSetting } from "./home/userSettings/Setting" import { ToggleSetting, ButtonSetting } from "./home/userSettings/Setting"
//common //common
import LoadingSymbol from "./common/loadingSymbol/loadingSymbol" import LoadingSymbol from "./common/loadingSymbol"
import Plus from "./common/plus/plus" import Plus from "./common/plus"
import SearchBar from "./common/searchBar/SearchBar" import SearchBar from "./common/SearchBar"
import CustomCard from "./common/customCard/CustomCard" import CustomCard from "./common/CustomCard"
//login //login