Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-090 frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-090
2021-090 frontend
Commits
2f5a1693
Commit
2f5a1693
authored
Nov 16, 2021
by
IT18111170-Silva S.H.I
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uncomment commit
parent
4985522b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
95 deletions
+13
-95
screen/Leaderboard.js
screen/Leaderboard.js
+3
-85
screen/PriceScreen.js
screen/PriceScreen.js
+10
-10
No files found.
screen/Leaderboard.js
View file @
2f5a1693
...
@@ -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
>
...
...
screen/PriceScreen.js
View file @
2f5a1693
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment