apply theme
This commit is contained in:
parent
6cee616ad5
commit
3c458c964b
6 changed files with 29 additions and 26 deletions
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
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,13 +28,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 backgroundColor: string = useThemeColor("backgroundColor")
|
||||
|
||||
return (
|
||||
<View style={{
|
||||
|
|
@ -57,7 +57,7 @@ export default function Welcome(props: WelcomeProps) {
|
|||
</TouchableOpacity>
|
||||
<Text style={{
|
||||
fontSize: SIZES.xlarge,
|
||||
color: textcolor
|
||||
color: colors.primaryText
|
||||
}}>{dateString}</Text>
|
||||
</View>
|
||||
<View style={{
|
||||
|
|
@ -65,7 +65,7 @@ export default function Welcome(props: WelcomeProps) {
|
|||
}}>
|
||||
<Text style={{
|
||||
fontSize: SIZES.xlarge,
|
||||
color: textcolor
|
||||
color: colors.primaryText
|
||||
}}>Good {timeOfDay}, {props.name}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
|||
Reference in a new issue