Update: Buttons on homescreen

parent 7ffaece9
...@@ -32,7 +32,7 @@ export function HomeScreen({ navigation }) { ...@@ -32,7 +32,7 @@ export function HomeScreen({ navigation }) {
style={styles.images} style={styles.images}
> >
<ImageSliderz <ImageSliderz
height={430} height={425}
dataSource={[ dataSource={[
{ {
url: require("../assets/d.jpg"), url: require("../assets/d.jpg"),
...@@ -45,6 +45,8 @@ export function HomeScreen({ navigation }) { ...@@ -45,6 +45,8 @@ export function HomeScreen({ navigation }) {
}, },
]} ]}
/> />
<View style={styles.HomeBtn}>
<View> <View>
<TouchableOpacity <TouchableOpacity
style={styles.saveExam} style={styles.saveExam}
...@@ -56,17 +58,43 @@ export function HomeScreen({ navigation }) { ...@@ -56,17 +58,43 @@ export function HomeScreen({ navigation }) {
</View> </View>
<View> <View>
<TouchableOpacity <TouchableOpacity
style={styles.saveExam} style={styles.Auction}
onPress={() => navigation.navigate("Leaderboard")} onPress={() => navigation.navigate("gamification")}
> >
<Ionicons name="game-controller" size={24} color="black" />
<Text style={styles.buttonText}>Auction</Text>
</TouchableOpacity>
</View>
</View>
<View style={styles.HomeBtn}>
<View >
<TouchableOpacity
style={styles.IOT}
onPress={() => navigation.navigate("gamification")}
>
<Ionicons name="game-controller" size={24} color="black" />
<Text style={styles.buttonText}>IOT</Text>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity
style={styles.Leaderboard}
onPress={() => navigation.navigate("Leaderboard")}
>
<MaterialIcons name="leaderboard" size={24} color="black" /> <MaterialIcons name="leaderboard" size={24} color="black" />
<Text style={styles.buttonText}>Leaderboard</Text> <Text style={styles.buttonText}>Leaderboard</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View>
{/*
<Text style={styles.heading}> <Text style={styles.heading}>
AGRIPRENEURS. Agriculture solution provider. AGRIPRENEURS. Agriculture solution provider.
</Text> </Text>
<Text style={styles.heading1}>Build to Empower Entrepreneurs</Text> <Text style={styles.heading1}>Build to Empower Entrepreneurs</Text> */}
<Text style={styles.heading2}>All Right Reserved.</Text> <Text style={styles.heading2}>All Right Reserved.</Text>
</ImageBackground> </ImageBackground>
...@@ -87,16 +115,16 @@ const styles = StyleSheet.create({ ...@@ -87,16 +115,16 @@ const styles = StyleSheet.create({
marginTop: 5, marginTop: 5,
}, },
heading2: { heading2: {
fontSize: 10, fontSize: 15,
alignSelf: "center", alignSelf: "center",
marginTop: 5, marginTop: 5,
}, },
saveExam: { saveExam: {
width: "90%", width: "70%",
padding: 10, padding: 20,
marginTop: 25, marginTop: 25,
marginLeft: 20, marginLeft: 20,
marginHorizontal: 10, // marginHorizontal: 10,
backgroundColor: "#ff426e", backgroundColor: "#ff426e",
flexDirection: "row", flexDirection: "row",
marginBottom: 15, marginBottom: 15,
...@@ -116,4 +144,43 @@ const styles = StyleSheet.create({ ...@@ -116,4 +144,43 @@ const styles = StyleSheet.create({
height: "100%", height: "100%",
justifyContent: "center", justifyContent: "center",
}, },
HomeBtn:{
flexDirection: "row",
alignItems: "flex-start",
justifyContent:"space-evenly",
marginLeft:20
},
Auction:{
width: "80%",
padding: 20,
marginTop: 25,
backgroundColor: "#ff426e",
flexDirection: "row",
marginBottom: 15,
justifyContent: "center",
borderRadius: 10,
},
Leaderboard:{
width: "75%",
padding: 20,
// marginTop: 25,
backgroundColor: "#ff426e",
flexDirection: "row",
marginBottom: 15,
justifyContent: "center",
borderRadius: 10,
marginLeft:20
},
IOT:{
width: "78%",
padding: 20,
// marginTop: 25,
backgroundColor: "#ff426e",
flexDirection: "row",
marginBottom: 15,
justifyContent: "center",
borderRadius: 10,
marginLeft:20
}
}); });
...@@ -5,6 +5,21 @@ import axios from 'axios' ...@@ -5,6 +5,21 @@ import axios from 'axios'
import { ScrollView } from "react-native-gesture-handler"; import { ScrollView } from "react-native-gesture-handler";
import { FontAwesome } from "@expo/vector-icons"; import { FontAwesome } from "@expo/vector-icons";
// function getDetails(params) {
// axios.get("http://192.168.8.126:5000/getDetails")
// .then(function (response) {
// const stngobj = JSON.stringify(response.data)
// console.log(stngobj);
// alert("Successfully Update")
// // navigation.navigate("HomeScreen")
// // return response;
// })
// .catch(function (error) {
// console.log(error);
// alert("update error")
// })
// }
export function Leaderboard({ navigation, data }) { export function Leaderboard({ navigation, data }) {
...@@ -14,7 +29,7 @@ export function Leaderboard({ navigation, data }) { ...@@ -14,7 +29,7 @@ export function Leaderboard({ navigation, data }) {
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
{/* <ImageBackground source={require('../assets/gamification.jpg')} style={styles.images}> */} {/* <ImageBackground source={require('../assets/gamification.jpg')} style={styles.images}> */}
{/* {stngobj.map((stngobj) => */}
<TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}> <TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}>
<View style={styles.card}> <View style={styles.card}>
...@@ -29,6 +44,9 @@ export function Leaderboard({ navigation, data }) { ...@@ -29,6 +44,9 @@ export function Leaderboard({ navigation, data }) {
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
{/* )} */}
<TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}> <TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}>
<View style={styles.card}> <View style={styles.card}>
......
...@@ -96,7 +96,7 @@ export function PriceScreen({ navigation, data }) { ...@@ -96,7 +96,7 @@ export function PriceScreen({ navigation, data }) {
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
alert("Login failed") alert("Please Insert new Data")
}) } }) }
] ]
); );
...@@ -162,7 +162,7 @@ export function PriceScreen({ navigation, data }) { ...@@ -162,7 +162,7 @@ export function PriceScreen({ navigation, data }) {
)} )}
</View> </View>
<View style={styles.SectionStyle}> {/* <View style={styles.SectionStyle}>
<View style={styles.textinputicon}> <View style={styles.textinputicon}>
<FontAwesome name="money" size={30} color="white" /> <FontAwesome name="money" size={30} color="white" />
<TextInput <TextInput
...@@ -181,7 +181,7 @@ export function PriceScreen({ navigation, data }) { ...@@ -181,7 +181,7 @@ export function PriceScreen({ navigation, data }) {
Email must be 4 characters long Email must be 4 characters long
</Text> </Text>
)} )}
</View> </View> */}
<View style={styles.SectionStyle}> <View style={styles.SectionStyle}>
<View style={styles.textinputicon}> <View style={styles.textinputicon}>
<Entypo name="location-pin" size={30} color="white" /> <Entypo name="location-pin" size={30} color="white" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment