uncomment commit

parent 4985522b
...@@ -5,20 +5,7 @@ import axios from 'axios' ...@@ -5,20 +5,7 @@ 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 }) { export function Leaderboard({ navigation }) {
...@@ -94,77 +81,8 @@ const fetchData = async () => { ...@@ -94,77 +81,8 @@ const fetchData = async () => {
{/* ) )} */} {/* ) )} */}
{/* <TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}>
<View style={styles.card}> */}
{/* <View style={styles.left}>
<FontAwesome name="user-circle-o" size={75} size={75} color="black" />
</View> */}
{/* <View style={styles.con}>
<Text>
{
image && <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />
}
</Text>
</View>
<View style={styles.right}>
<Text >Name: Husmitha Silva</Text>
<Text >Earns: 4500</Text>
<Text >District: Colombo</Text>
<Text >Points: 10</Text>
</View>
</View>
</TouchableOpacity> */}
{/* <TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}>
<View style={styles.card}> */}
{/* <View style={styles.left}>
<FontAwesome name="user-circle-o" size={75} size={75} color="black" />
</View> */}
{/* <View style={styles.con}>
<Text>
{
image && <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />
}
</Text>
</View>
<View style={styles.right}>
<Text >Name: Husmitha Silva</Text>
<Text >Earns: 4500</Text>
<Text >District: Colombo</Text>
<Text >Points: 5</Text>
</View>
</View>
</TouchableOpacity> */}
{/* <TouchableOpacity style={styles.touchable} onPress={() => navigation.navigate('PriceScreen')}>
<View style={styles.card}> */}
{/* <View style={styles.left}>
<FontAwesome name="user-circle-o" size={75} size={75} color="black" />
</View> */}
{/* <View style={styles.con}>
<Text>
{
image && <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />
}
</Text>
</View>
<View style={styles.right}>
<Text >Name: Husmitha Silva</Text>
<Text >Earns: 4500</Text>
<Text >District: Colombo</Text>
<Text >Points: 5</Text>
</View>
</View>
</TouchableOpacity> */}
{/* </ImageBackground> */} {/* </ImageBackground> */}
</ScrollView> </ScrollView>
......
...@@ -54,19 +54,19 @@ function name() { ...@@ -54,19 +54,19 @@ function name() {
axios axios
} }
// const [image, setImage] = useState(''); const [image, setImage] = useState('');
//get the token and id from headers //get the token and id from headers
//from the id get the //from the id get the
// const getImage = async (name) => { const getImage = async (name) => {
// console.log(name) console.log(name)
// const q = name.split(' ').join('+') const q = name.split(' ').join('+')
// const img = await fetch(`http://192.168.8.126:5000/getimage/${name}`) const img = await fetch(`http://192.168.8.126:5000/getimage/${name}`)
// const image = await img.json(); const image = await img.json();
// console.log(image) console.log(image)
// setImage(image.previewURL) setImage(image.previewURL)
// } }
const [details, setDetails] = useState({ const [details, setDetails] = useState({
name: "", name: "",
...@@ -180,7 +180,7 @@ function name() { ...@@ -180,7 +180,7 @@ function name() {
<View style={styles.con}> <View style={styles.con}>
<Text> <Text>
{ {
<Image source={{}} style={{ width: 200, height: 200 }} /> <Image source={{uri: `http://192.168.8.126:5000/getimage/${name}`}} style={{ width: 200, height: 200 }} />
} }
</Text> </Text>
......
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