removing unused variables

pull/23/head
Rémi REGNAULT 1 year ago
parent c204a2a542
commit 995095f20a

@ -16,7 +16,7 @@ import DarkIcon from '../assets/images/moon.png';
export default function BottomBar({ state, descriptors, navigation }) { export default function BottomBar({ state, descriptors, navigation }) {
const {theme, toggleTheme} = useContext(ThemeContext); const {theme, toggleTheme} = useContext(ThemeContext);
const {colors, toggleColors} = useContext(ColorContext) const toggleColors = useContext(ColorContext).toggleColors;
const [iconThemeButton, setThemeIconButton] = useState(( theme === 'dark' ) ? LightIcon : DarkIcon) const [iconThemeButton, setThemeIconButton] = useState(( theme === 'dark' ) ? LightIcon : DarkIcon)
const [textThemeButton, setTextThemeButton] = useState(( theme === 'dark' ) ? 'Light' : 'Dark'); const [textThemeButton, setTextThemeButton] = useState(( theme === 'dark' ) ? 'Light' : 'Dark');

@ -8,7 +8,7 @@ import ThemeContext from '../theme/ThemeContext';
const CookingStack = createNativeStackNavigator() const CookingStack = createNativeStackNavigator()
export default function CookingStackScreen() { export default function CookingStackScreen() {
const {theme, toggleTheme} = useContext(ThemeContext); const theme = useContext(ThemeContext).theme;
return ( return (
<CookingStack.Navigator> <CookingStack.Navigator>

@ -23,8 +23,7 @@ function AppIcon() {
} }
export default function HomeStackScreen() { export default function HomeStackScreen() {
const {theme, toggleTheme} = useContext(ThemeContext) const colors = useContext(ColorContext).colors
const {colors, toggleColors} = useContext(ColorContext)
return ( return (
<HomeStack.Navigator> <HomeStack.Navigator>

@ -5,7 +5,7 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Profiles from '../screens/Profiles'; import Profiles from '../screens/Profiles';
import CreateProfile from '../screens/CreateProfile'; import CreateProfile from '../screens/CreateProfile';
import ModifyProfile from '../screens/ModifyProfile'; import ModifyProfile from '../screens/ModifyProfile';
import ThemeContext from '../theme/ThemeContext'; import ColorContext from '../theme/ColorContext';
import { HeaderTitle } from './Utils'; import { HeaderTitle } from './Utils';
@ -15,11 +15,11 @@ import AddIcon from '../assets/images/plus.png'
const ProfilesStack = createNativeStackNavigator() const ProfilesStack = createNativeStackNavigator()
export default function ProfilesStackScreen({ navigation }) { export default function ProfilesStackScreen({ navigation }) {
const {theme, toggleTheme} = useContext(ThemeContext); const colors = useContext(ColorContext).colors;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
headerBarContainer: { headerBarContainer: {
backgroundColor: theme === 'light' ? '#F2F0E4' : '#3F3C42', backgroundColor: colors.cardBackground,
}, },
headerBarRightContainer: { headerBarRightContainer: {
display: 'flex', display: 'flex',
@ -53,13 +53,13 @@ export default function ProfilesStackScreen({ navigation }) {
<Image <Image
source={SearchIcon} source={SearchIcon}
style={styles.headerBarIcon} style={styles.headerBarIcon}
tintColor={theme === 'light' ? '#3F3C42' : '#F2F0E4'}/> tintColor={colors.cardDetail}/>
</Pressable> </Pressable>
<Pressable onPress={_handleHeaderAdd}> <Pressable onPress={_handleHeaderAdd}>
<Image <Image
source={AddIcon} source={AddIcon}
style={styles.headerBarIcon} style={styles.headerBarIcon}
tintColor={theme === 'light' ? '#3F3C42' : '#F2F0E4'}/> tintColor={colors.cardDetail}/>
</Pressable> </Pressable>
</View> </View>
) )

@ -4,7 +4,7 @@ import { Text, StyleSheet } from 'react-native';
import ColorContext from '../theme/ColorContext'; import ColorContext from '../theme/ColorContext';
export function HeaderTitle(props) { export function HeaderTitle(props) {
const {colors, toggleColors} = useContext(ColorContext) const colors = useContext(ColorContext).colors
const styles = StyleSheet.create({ const styles = StyleSheet.create({
headerTitle: { headerTitle: {

@ -8,7 +8,7 @@ import ValidateButton from '../components/ValidateButton';
import ColorContext from '../theme/ColorContext'; import ColorContext from '../theme/ColorContext';
export default function CreateProfile(props) { export default function CreateProfile(props) {
const { colors, toggleColors } = useContext(ColorContext) const colors = useContext(ColorContext).colors
const all = [] const all = []
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}] const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]

@ -9,7 +9,7 @@ import ProfileDelete from '../components/ProfileDelete';
import ColorContext from '../theme/ColorContext'; import ColorContext from '../theme/ColorContext';
export default function Profiles({navigation, props}) { export default function Profiles({navigation, props}) {
const { colors, toggleColors } = useContext(ColorContext) const colors = useContext(ColorContext).colors
const allJohnny = [{value: "Coconut"}, {value: "Skimmed Milk"}, {value: "Nuts"}] const allJohnny = [{value: "Coconut"}, {value: "Skimmed Milk"}, {value: "Nuts"}]
const dieJohnny = [{value: "Gluten free"}, {value: "Porkless"}, {value: "Pescatarian"}] const dieJohnny = [{value: "Gluten free"}, {value: "Porkless"}, {value: "Pescatarian"}]

Loading…
Cancel
Save