Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
EmidWife-New
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
2023-24-005
EmidWife-New
Commits
92167ac7
Commit
92167ac7
authored
May 19, 2024
by
Malsha Jayakody
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change profile icon
parent
fbd66e44
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
25 deletions
+23
-25
src/constants/routes.js
src/constants/routes.js
+2
-9
src/screens/auth/ProfilePage.js
src/screens/auth/ProfilePage.js
+9
-9
src/screens/home/Home.js
src/screens/home/Home.js
+9
-2
src/services/auth/index.js
src/services/auth/index.js
+3
-5
No files found.
src/constants/routes.js
View file @
92167ac7
...
@@ -5,14 +5,10 @@ export default {
...
@@ -5,14 +5,10 @@ export default {
PROFILE
:
'
UserProfile
'
,
PROFILE
:
'
UserProfile
'
,
HOME
:
'
Home
'
,
HOME
:
'
Home
'
,
HOME_TAB
:
'
Home_Tab
'
,
HOME_TAB
:
'
Home_Tab
'
,
WALLET
:
'
Wallet
'
,
WALLET
:
'
Wallet
'
,
NOTIFICATIONS
:
'
Notifications
'
,
NOTIFICATIONS
:
'
Notifications
'
,
SETTINGS
:
'
Settings
'
,
SETTINGS
:
'
Settings
'
,
SETTINGS_NAVIGATOR
:
'
Welcome
'
,
SETTINGS_NAVIGATOR
:
'
Welcome
'
,
SETTINGS_DETAIL
:
'
Settings_Detail
'
,
SETTINGS_DETAIL
:
'
Settings_Detail
'
,
//EXERCISES
//EXERCISES
...
@@ -29,7 +25,6 @@ export default {
...
@@ -29,7 +25,6 @@ export default {
EXERCISE_NEW_PROGRESS
:
'
Exercise_NEW_PROGRESS
'
,
EXERCISE_NEW_PROGRESS
:
'
Exercise_NEW_PROGRESS
'
,
//skin
//skin
SKIN_WELCOME
:
'
Skin_Welcome
'
,
SKIN_WELCOME
:
'
Skin_Welcome
'
,
SKIN_UPLOAD
:
'
Skin_Upload
'
,
SKIN_UPLOAD
:
'
Skin_Upload
'
,
SKIN_RISK
:
'
Skin_Risk
'
,
SKIN_RISK
:
'
Skin_Risk
'
,
...
@@ -39,8 +34,7 @@ export default {
...
@@ -39,8 +34,7 @@ export default {
SKIN_VIDEO3
:
'
Skin_Video3
'
,
SKIN_VIDEO3
:
'
Skin_Video3
'
,
SKIN_VIDEO4
:
'
Skin_Video4
'
,
SKIN_VIDEO4
:
'
Skin_Video4
'
,
SKIN_VIDEO5
:
'
Skin_Video5
'
,
SKIN_VIDEO5
:
'
Skin_Video5
'
,
SKIN_INFO
:
'
skin_info
'
,
SKIN_INFO
:
'
skin_info
'
,
//GAMES
//GAMES
GAME_HOME
:
'
Game_Home
'
,
GAME_HOME
:
'
Game_Home
'
,
...
@@ -92,4 +86,3 @@ export default {
...
@@ -92,4 +86,3 @@ export default {
Game02ProgressLevel08
:
'
Game02ProgressLevel08
'
,
Game02ProgressLevel08
:
'
Game02ProgressLevel08
'
,
Game02ProgressLevel07
:
'
Game02ProgressLevel07
'
,
Game02ProgressLevel07
:
'
Game02ProgressLevel07
'
,
};
};
src/screens/auth/ProfilePage.js
View file @
92167ac7
...
@@ -22,7 +22,6 @@ const UserProfile = ({navigation}) => {
...
@@ -22,7 +22,6 @@ const UserProfile = ({navigation}) => {
try
{
try
{
setLoading
(
true
);
setLoading
(
true
);
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
console
.
log
(
email
,
'
email___1
'
);
if
(
!
email
)
{
if
(
!
email
)
{
setError
(
'
Email not found
'
);
setError
(
'
Email not found
'
);
setLoading
(
false
);
setLoading
(
false
);
...
@@ -43,8 +42,6 @@ const UserProfile = ({navigation}) => {
...
@@ -43,8 +42,6 @@ const UserProfile = ({navigation}) => {
}
}
};
};
console
.
log
(
userDetails
,
'
userDetails_____2
'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
handleFetchDetails
();
handleFetchDetails
();
},
[]);
},
[]);
...
@@ -131,13 +128,13 @@ const styles = StyleSheet.create({
...
@@ -131,13 +128,13 @@ const styles = StyleSheet.create({
paddingVertical
:
20
,
paddingVertical
:
20
,
},
},
profileImage
:
{
profileImage
:
{
width
:
8
0
,
width
:
14
0
,
height
:
8
0
,
height
:
14
0
,
borderRadius
:
40
,
borderRadius
:
40
,
marginBottom
:
1
0
,
marginBottom
:
2
0
,
},
},
name
:
{
name
:
{
fontSize
:
18
,
fontSize
:
20
,
fontWeight
:
'
bold
'
,
fontWeight
:
'
bold
'
,
color
:
COLORS
.
navyBlue
,
color
:
COLORS
.
navyBlue
,
},
},
...
@@ -160,9 +157,12 @@ const styles = StyleSheet.create({
...
@@ -160,9 +157,12 @@ const styles = StyleSheet.create({
infoLabel
:
{
infoLabel
:
{
fontWeight
:
'
bold
'
,
fontWeight
:
'
bold
'
,
color
:
'
gray
'
,
color
:
'
gray
'
,
fontSize
:
16
,
},
},
infoContent
:
{
infoContent
:
{
color
:
'
black
'
,
color
:
'
black
'
,
fontSize
:
16
,
fontWeight
:
'
bold
'
,
},
},
button
:
{
button
:
{
flexDirection
:
'
row
'
,
flexDirection
:
'
row
'
,
...
@@ -173,7 +173,7 @@ const styles = StyleSheet.create({
...
@@ -173,7 +173,7 @@ const styles = StyleSheet.create({
width
:
'
90%
'
,
width
:
'
90%
'
,
padding
:
15
,
padding
:
15
,
marginVertical
:
5
,
marginVertical
:
5
,
marginTop
:
4
0
,
marginTop
:
2
0
,
},
},
button2
:
{
button2
:
{
flexDirection
:
'
row
'
,
flexDirection
:
'
row
'
,
...
@@ -184,7 +184,7 @@ const styles = StyleSheet.create({
...
@@ -184,7 +184,7 @@ const styles = StyleSheet.create({
width
:
'
90%
'
,
width
:
'
90%
'
,
padding
:
15
,
padding
:
15
,
marginVertical
:
5
,
marginVertical
:
5
,
marginTop
:
23
0
,
marginTop
:
15
0
,
},
},
buttonText
:
{
buttonText
:
{
textAlign
:
'
center
'
,
textAlign
:
'
center
'
,
...
...
src/screens/home/Home.js
View file @
92167ac7
...
@@ -3,7 +3,6 @@ import React from 'react';
...
@@ -3,7 +3,6 @@ import React from 'react';
import
{
Image
,
TouchableOpacity
,
Text
,
View
,
FlatList
}
from
'
react-native
'
;
import
{
Image
,
TouchableOpacity
,
Text
,
View
,
FlatList
}
from
'
react-native
'
;
import
{
COLORS
,
IMGS
,
ROUTES
}
from
'
../../constants
'
;
import
{
COLORS
,
IMGS
,
ROUTES
}
from
'
../../constants
'
;
import
LinearGradient
from
'
react-native-linear-gradient
'
;
import
LinearGradient
from
'
react-native-linear-gradient
'
;
import
Icon
from
'
react-native-vector-icons/Ionicons
'
;
const
Home
=
({
navigation
})
=>
{
const
Home
=
({
navigation
})
=>
{
const
cards
=
[
const
cards
=
[
...
@@ -51,7 +50,15 @@ const Home = ({navigation}) => {
...
@@ -51,7 +50,15 @@ const Home = ({navigation}) => {
zIndex
:
5
,
zIndex
:
5
,
}}
}}
onPress
=
{()
=>
navigation
.
navigate
(
ROUTES
.
PROFILE
)}
>
onPress
=
{()
=>
navigation
.
navigate
(
ROUTES
.
PROFILE
)}
>
<
Icon
name
=
"
person-circle-sharp
"
size
=
{
35
}
color
=
{
COLORS
.
black
}
/
>
<
Image
source
=
{
IMGS
.
user_profile_image
}
style
=
{{
width
:
40
,
height
:
40
,
borderRadius
:
40
,
marginBottom
:
20
,
}}
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
View
<
View
style
=
{{
style
=
{{
...
...
src/services/auth/index.js
View file @
92167ac7
...
@@ -48,19 +48,17 @@ export let signup = async (name, password, email, age, week) => {
...
@@ -48,19 +48,17 @@ export let signup = async (name, password, email, age, week) => {
export
const
getUserDetails
=
async
()
=>
{
export
const
getUserDetails
=
async
()
=>
{
try
{
try
{
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
console
.
log
(
email
,
'
email
'
);
if
(
!
email
)
throw
new
Error
(
'
Email not found in storage
'
);
if
(
!
email
)
throw
new
Error
(
'
Email not found in storage
'
);
const
token
=
await
AsyncStorage
.
getItem
(
'
userToken
'
);
// Assuming you store token after login
const
token
=
await
AsyncStorage
.
getItem
(
'
userToken
'
);
let
response
=
await
axios
.
post
(
let
response
=
await
axios
.
post
(
BASE_PATH
+
`/user-details?email=
${
encodeURIComponent
(
email
)}
`
,
BASE_PATH
+
`/user-details?email=
${
encodeURIComponent
(
email
)}
`
,
{
{
headers
:
{
headers
:
{
Authorization
:
`Bearer
${
token
}
`
,
// Assuming you use Bearer token for authentication
Authorization
:
`Bearer
${
token
}
`
,
},
},
},
},
);
);
console
.
log
(
'
userDetails___1
'
,
response
.
data
);
if
(
response
.
data
.
success
===
true
)
{
if
(
response
.
data
.
success
===
true
)
{
await
AsyncStorage
.
setItem
(
await
AsyncStorage
.
setItem
(
'
userDetails
'
,
'
userDetails
'
,
...
@@ -70,6 +68,6 @@ export const getUserDetails = async () => {
...
@@ -70,6 +68,6 @@ export const getUserDetails = async () => {
return
response
.
data
;
return
response
.
data
;
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'
Failed to fetch user details
'
,
error
);
console
.
error
(
'
Failed to fetch user details
'
,
error
);
throw
error
;
// You might want to handle this differently depending on your error handling strategy
throw
error
;
}
}
};
};
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