useTheme applied globally
This commit is contained in:
parent
1f304d41f2
commit
9de2678922
12 changed files with 31 additions and 39 deletions
|
|
@ -2,7 +2,6 @@ import { Stack } from "expo-router";
|
|||
|
||||
import { View, Text } from 'react-native'
|
||||
import React from 'react'
|
||||
import { useThemeColor } from "../../../hooks/useThemeColor";
|
||||
import { useTheme } from "../../contexts/ThemeContext";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { FlatList } from 'react-native-gesture-handler';
|
|||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
import { ExpenseItem, LoadingSymbol, Plus, SearchBar, Welcome } from '../../../components';
|
||||
import useFetch from '../../../hooks/useFetch';
|
||||
import { useThemeColor } from "../../../hooks/useThemeColor";
|
||||
import { addExpense } from "../../../services/database";
|
||||
import { useAuth } from '../../contexts/AuthContext';
|
||||
import { useRouter } from "expo-router";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { View, Text, StyleSheet, Image, Appearance } from 'react-native'
|
||||
import React, { useState } from 'react'
|
||||
import { useThemeColor } from '../../../hooks/useThemeColor'
|
||||
import { SIZES } from '../../../constants/theme'
|
||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||
import { ButtonSetting, ToggleSetting } from '../../../components'
|
||||
|
|
@ -9,18 +8,13 @@ import { deleteExpenses, DEV_populateDatabase } from '../../../services/database
|
|||
import { useAuth } from '../../contexts/AuthContext'
|
||||
import { TouchableOpacity } from 'react-native-gesture-handler'
|
||||
|
||||
const generateStyles = (): void => {
|
||||
styles.text = {
|
||||
color: useThemeColor('primaryText')
|
||||
}
|
||||
}
|
||||
|
||||
export default function userSettings() {
|
||||
const {onLogout} = useAuth();
|
||||
const {theme, colors, isSystemTheme, applyTheme, applySystemTheme} = useTheme();
|
||||
|
||||
const backgroundColor = useThemeColor("backgroundColor");
|
||||
styles.text = {...styles.text, color: useThemeColor("primaryText")}
|
||||
const backgroundColor = colors.backgroundColor
|
||||
styles.text = {...styles.text, color: colors.primaryText}
|
||||
|
||||
const [systemTheme, setSystemTheme] = useState<boolean>(isSystemTheme!)
|
||||
const [darkMode, setDarkMode] = useState<boolean>(theme === "dark" ? true : false)
|
||||
|
|
|
|||
Reference in a new issue