|
|
@ -1,4 +1,4 @@
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import React, { useContext, useState } from 'react';
|
|
|
|
import { StyleSheet, View, Modal, Pressable, Text, Image, ScrollView, useWindowDimensions } from 'react-native';
|
|
|
|
import { StyleSheet, View, Modal, Pressable, Text, Image, ScrollView, useWindowDimensions } from 'react-native';
|
|
|
|
|
|
|
|
|
|
|
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
|
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
|
@ -6,8 +6,11 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
|
|
|
|
|
|
|
|
|
|
import ProfileDetails from '../components/ProfileDetails';
|
|
|
|
import ProfileDetails from '../components/ProfileDetails';
|
|
|
|
import ProfileDelete from '../components/ProfileDelete';
|
|
|
|
import ProfileDelete from '../components/ProfileDelete';
|
|
|
|
|
|
|
|
import ColorContext from '../theme/ColorContext';
|
|
|
|
|
|
|
|
|
|
|
|
export default function Profiles({navigation, props}) {
|
|
|
|
export default function Profiles({navigation, props}) {
|
|
|
|
|
|
|
|
const { colors, toggleColors } = useContext(ColorContext)
|
|
|
|
|
|
|
|
|
|
|
|
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"}]
|
|
|
|
|
|
|
|
|
|
|
@ -31,75 +34,6 @@ export default function Profiles({navigation, props}) {
|
|
|
|
setOpacity(1)
|
|
|
|
setOpacity(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<SafeAreaProvider style={{flex: 1}}>
|
|
|
|
|
|
|
|
<ScrollView>
|
|
|
|
|
|
|
|
<View style={{opacity: opacity, height: "100%", width: "100%", flex: 1, backgroundColor: '#3F3C42',}}>
|
|
|
|
|
|
|
|
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Johnny Silverhand"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieJohnny}
|
|
|
|
|
|
|
|
allergies={allJohnny}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp}/>
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Jackie Welles"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieJackie}
|
|
|
|
|
|
|
|
allergies={allJackie}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Goro Takemura"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieGoro}
|
|
|
|
|
|
|
|
allergies={allGoro}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Viktor Vector"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieViktor}
|
|
|
|
|
|
|
|
allergies={allViktor}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.modal}>
|
|
|
|
|
|
|
|
<Modal visible={visible} onRequestClose={erasePopUp} animationType="fade" transparent={true}>
|
|
|
|
|
|
|
|
<View style={styles.modal}>
|
|
|
|
|
|
|
|
<View style={styles.viewModal}>
|
|
|
|
|
|
|
|
<View style={styles.profileValidation}>
|
|
|
|
|
|
|
|
<ProfileDelete name="Johnny Silverhand" avatar="plus_small.png" diets={dieJohnny} allergies={allJohnny}></ProfileDelete>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.decisionBarVertical}>
|
|
|
|
|
|
|
|
<Text style={styles.validationQuestion}>Do you really want to delete this profile?</Text>
|
|
|
|
|
|
|
|
<View style={styles.decisionBar}>
|
|
|
|
|
|
|
|
<Pressable onPress={erasePopUp} style={{flex:0.5}}>
|
|
|
|
|
|
|
|
<View style={styles.yesButton}>
|
|
|
|
|
|
|
|
<Image source={require("../assets/images/validate.png")} style={{tintColor: "#2DE04A", height: "100%", flex: 0.2, margin: "5%", resizeMode: "contain"}}/>
|
|
|
|
|
|
|
|
<Text style={styles.yesText}>Yes</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Pressable>
|
|
|
|
|
|
|
|
<Pressable onPress={erasePopUp} style={{flex:0.5}}>
|
|
|
|
|
|
|
|
<View style={styles.noButton}>
|
|
|
|
|
|
|
|
<Image source={require("../assets/images/cross.png")} style={{tintColor: "#E02D2D", height: "100%", flex: 0.2, margin: "5%", resizeMode: "contain"}}/>
|
|
|
|
|
|
|
|
<Text style={styles.noText}>No</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Pressable>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginBottom: "20%"}}/>
|
|
|
|
|
|
|
|
</LinearGradient>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
|
|
</SafeAreaProvider>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
container: {
|
|
|
|
height: "100%",
|
|
|
|
height: "100%",
|
|
|
@ -208,3 +142,72 @@ const styles = StyleSheet.create({
|
|
|
|
padding: "4%",
|
|
|
|
padding: "4%",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<SafeAreaProvider style={{flex: 1}}>
|
|
|
|
|
|
|
|
<ScrollView>
|
|
|
|
|
|
|
|
<View style={{opacity: opacity, height: "100%", width: "100%", flex: 1}}>
|
|
|
|
|
|
|
|
<LinearGradient colors={[colors.primary, colors.primaryComplement]} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Johnny Silverhand"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieJohnny}
|
|
|
|
|
|
|
|
allergies={allJohnny}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp}/>
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Jackie Welles"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieJackie}
|
|
|
|
|
|
|
|
allergies={allJackie}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Goro Takemura"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieGoro}
|
|
|
|
|
|
|
|
allergies={allGoro}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.separator}/>
|
|
|
|
|
|
|
|
<ProfileDetails
|
|
|
|
|
|
|
|
name="Viktor Vector"
|
|
|
|
|
|
|
|
avatar="plus_small.png"
|
|
|
|
|
|
|
|
diets={dieViktor}
|
|
|
|
|
|
|
|
allergies={allViktor}
|
|
|
|
|
|
|
|
onDeleteProfile={raisePopUp} />
|
|
|
|
|
|
|
|
<View style={styles.modal}>
|
|
|
|
|
|
|
|
<Modal visible={visible} onRequestClose={erasePopUp} animationType="fade" transparent={true}>
|
|
|
|
|
|
|
|
<View style={styles.modal}>
|
|
|
|
|
|
|
|
<View style={styles.viewModal}>
|
|
|
|
|
|
|
|
<View style={styles.profileValidation}>
|
|
|
|
|
|
|
|
<ProfileDelete name="Johnny Silverhand" avatar="plus_small.png" diets={dieJohnny} allergies={allJohnny}></ProfileDelete>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.decisionBarVertical}>
|
|
|
|
|
|
|
|
<Text style={styles.validationQuestion}>Do you really want to delete this profile?</Text>
|
|
|
|
|
|
|
|
<View style={styles.decisionBar}>
|
|
|
|
|
|
|
|
<Pressable onPress={erasePopUp} style={{flex:0.5}}>
|
|
|
|
|
|
|
|
<View style={styles.yesButton}>
|
|
|
|
|
|
|
|
<Image source={require("../assets/images/validate.png")} style={{tintColor: "#2DE04A", height: "100%", flex: 0.2, margin: "5%", resizeMode: "contain"}}/>
|
|
|
|
|
|
|
|
<Text style={styles.yesText}>Yes</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Pressable>
|
|
|
|
|
|
|
|
<Pressable onPress={erasePopUp} style={{flex:0.5}}>
|
|
|
|
|
|
|
|
<View style={styles.noButton}>
|
|
|
|
|
|
|
|
<Image source={require("../assets/images/cross.png")} style={{tintColor: "#E02D2D", height: "100%", flex: 0.2, margin: "5%", resizeMode: "contain"}}/>
|
|
|
|
|
|
|
|
<Text style={styles.noText}>No</Text>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Pressable>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={{marginBottom: "20%"}}/>
|
|
|
|
|
|
|
|
</LinearGradient>
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
|
|
</SafeAreaProvider>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|