fix: some error message on ValidateButton props todo is not assigned
continuous-integration/drone/push Build is failing Details

pull/20/head
Rémi REGNAULT 1 year ago
parent 908162d016
commit 49790445e1

@ -19,7 +19,8 @@ export default function ValidateButton(props: ValidateButtonProps) {
borderRadius: 20, borderRadius: 20,
}} }}
onPress={props.todo}> onPress={props.todo}>
<View style={{ <View
style={{
borderRadius: 30, borderRadius: 30,
borderWidth: 2, borderWidth: 2,
borderColor: props.colour, borderColor: props.colour,
@ -29,7 +30,9 @@ export default function ValidateButton(props: ValidateButtonProps) {
flexDirection: "row", flexDirection: "row",
padding: 5, padding: 5,
paddingRight: 10,}}> paddingRight: 10,}}>
<Image source={require('../assets/images/'+props.image)} style={{ <Image
source={require('../assets/images/'+props.image)}
style={{
height: 20, height: 20,
width: 20, width: 20,
marginLeft: 5, marginLeft: 5,

@ -1,4 +1,5 @@
import {React, useState} from 'react'; import React from 'react';
import { useState } from 'react';
import {StyleSheet, View, Text, Pressable, Image} from 'react-native'; import {StyleSheet, View, Text, Pressable, Image} from 'react-native';
import ProfileModification from '../components/ProfileModification'; import ProfileModification from '../components/ProfileModification';
import ValidateButton from '../components/ValidateButton'; import ValidateButton from '../components/ValidateButton';
@ -72,7 +73,7 @@ export default function HomePage({ navigation , props}) {
<Text style={styles.filters}>Ingredient Stocks</Text> <Text style={styles.filters}>Ingredient Stocks</Text>
</View> </View>
<View style={{marginTop: 10}}/> <View style={{marginTop: 10}}/>
<ValidateButton title="Manage Stocks" image="warehouse.png" colour="#59BDCD" backColour="#E3DEC9"/> <ValidateButton title="Manage Stocks" image="warehouse.png" colour="#59BDCD" backColour="#E3DEC9" todo={() => console.log('ManageStocks')}/>
</View> </View>
<View style={{marginTop: 20}}/> <View style={{marginTop: 20}}/>
<View style={styles.profilesSelection}> <View style={styles.profilesSelection}>
@ -93,9 +94,9 @@ export default function HomePage({ navigation , props}) {
</View> </View>
</View> </View>
<View style={{marginTop: 15}}/> <View style={{marginTop: 15}}/>
<ValidateButton title="Change Selected Ingredients" image="cook.png" colour="#59BDCD" backColour="#E3DEC9"/> <ValidateButton title="Change Selected Ingredients" image="cook.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log('Chnge Selected Ingredient')}/>
<View style={{marginTop: 10}}/> <View style={{marginTop: 10}}/>
<ValidateButton title="Search Recipes" image="search.png" colour="#59BDCD" backColour="#E3DEC9"/> <ValidateButton title="Search Recipes" image="search.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log('Go and search for recipe')}/>
</View> </View>
</LinearGradient> </LinearGradient>
</View> </View>

Loading…
Cancel
Save