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,23 +19,26 @@ export default function ValidateButton(props: ValidateButtonProps) {
borderRadius: 20, borderRadius: 20,
}} }}
onPress={props.todo}> onPress={props.todo}>
<View style={{ <View
borderRadius: 30, style={{
borderWidth: 2, borderRadius: 30,
borderColor: props.colour, borderWidth: 2,
backgroundColor: props.backColour, borderColor: props.colour,
alignItems: 'center', backgroundColor: props.backColour,
justifyContent: "center", alignItems: 'center',
flexDirection: "row", justifyContent: "center",
padding: 5, flexDirection: "row",
paddingRight: 10,}}> padding: 5,
<Image source={require('../assets/images/'+props.image)} style={{ paddingRight: 10,}}>
height: 20, <Image
width: 20, source={require('../assets/images/'+props.image)}
marginLeft: 5, style={{
marginRight: 10, height: 20,
resizeMode: "center", width: 20,
tintColor: props.colour,}}> marginLeft: 5,
marginRight: 10,
resizeMode: "center",
tintColor: props.colour,}}>
</Image> </Image>
<Text style={{ <Text style={{
fontSize: 20, fontSize: 20,

@ -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';
@ -14,10 +15,10 @@ import bracketRight from '../assets/images/angle_bracket_right.png';
export default function HomePage({ navigation , props}) { export default function HomePage({ navigation , props}) {
const profiles = [ const profiles = [
{name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"}, {name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"},
{name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"}, {name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"},
{name: "Goro Takemura", avatar: "plus_small.png", isActive: "none"}, {name: "Goro Takemura", avatar: "plus_small.png", isActive: "none"},
{name: "David Martinez", avatar: "plus_small.png", isActive: "flex"}, {name: "David Martinez", avatar: "plus_small.png", isActive: "flex"},
] ]
const ingredientList = [{title: "Carrot"}, {title: "Potato"}, {title: "Peach"}] const ingredientList = [{title: "Carrot"}, {title: "Potato"}, {title: "Peach"}]
@ -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