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 {
PROFILE
:
'
UserProfile
'
,
HOME
:
'
Home
'
,
HOME_TAB
:
'
Home_Tab
'
,
WALLET
:
'
Wallet
'
,
NOTIFICATIONS
:
'
Notifications
'
,
SETTINGS
:
'
Settings
'
,
SETTINGS_NAVIGATOR
:
'
Welcome
'
,
SETTINGS_DETAIL
:
'
Settings_Detail
'
,
//EXERCISES
...
...
@@ -29,7 +25,6 @@ export default {
EXERCISE_NEW_PROGRESS
:
'
Exercise_NEW_PROGRESS
'
,
//skin
SKIN_WELCOME
:
'
Skin_Welcome
'
,
SKIN_UPLOAD
:
'
Skin_Upload
'
,
SKIN_RISK
:
'
Skin_Risk
'
,
...
...
@@ -39,8 +34,7 @@ export default {
SKIN_VIDEO3
:
'
Skin_Video3
'
,
SKIN_VIDEO4
:
'
Skin_Video4
'
,
SKIN_VIDEO5
:
'
Skin_Video5
'
,
SKIN_INFO
:
'
skin_info
'
,
SKIN_INFO
:
'
skin_info
'
,
//GAMES
GAME_HOME
:
'
Game_Home
'
,
...
...
@@ -92,4 +86,3 @@ export default {
Game02ProgressLevel08
:
'
Game02ProgressLevel08
'
,
Game02ProgressLevel07
:
'
Game02ProgressLevel07
'
,
};
src/screens/auth/ProfilePage.js
View file @
92167ac7
...
...
@@ -22,7 +22,6 @@ const UserProfile = ({navigation}) => {
try
{
setLoading
(
true
);
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
console
.
log
(
email
,
'
email___1
'
);
if
(
!
email
)
{
setError
(
'
Email not found
'
);
setLoading
(
false
);
...
...
@@ -43,8 +42,6 @@ const UserProfile = ({navigation}) => {
}
};
console
.
log
(
userDetails
,
'
userDetails_____2
'
);
useEffect
(()
=>
{
handleFetchDetails
();
},
[]);
...
...
@@ -131,13 +128,13 @@ const styles = StyleSheet.create({
paddingVertical
:
20
,
},
profileImage
:
{
width
:
8
0
,
height
:
8
0
,
width
:
14
0
,
height
:
14
0
,
borderRadius
:
40
,
marginBottom
:
1
0
,
marginBottom
:
2
0
,
},
name
:
{
fontSize
:
18
,
fontSize
:
20
,
fontWeight
:
'
bold
'
,
color
:
COLORS
.
navyBlue
,
},
...
...
@@ -160,9 +157,12 @@ const styles = StyleSheet.create({
infoLabel
:
{
fontWeight
:
'
bold
'
,
color
:
'
gray
'
,
fontSize
:
16
,
},
infoContent
:
{
color
:
'
black
'
,
fontSize
:
16
,
fontWeight
:
'
bold
'
,
},
button
:
{
flexDirection
:
'
row
'
,
...
...
@@ -173,7 +173,7 @@ const styles = StyleSheet.create({
width
:
'
90%
'
,
padding
:
15
,
marginVertical
:
5
,
marginTop
:
4
0
,
marginTop
:
2
0
,
},
button2
:
{
flexDirection
:
'
row
'
,
...
...
@@ -184,7 +184,7 @@ const styles = StyleSheet.create({
width
:
'
90%
'
,
padding
:
15
,
marginVertical
:
5
,
marginTop
:
23
0
,
marginTop
:
15
0
,
},
buttonText
:
{
textAlign
:
'
center
'
,
...
...
src/screens/home/Home.js
View file @
92167ac7
...
...
@@ -3,7 +3,6 @@ import React from 'react';
import
{
Image
,
TouchableOpacity
,
Text
,
View
,
FlatList
}
from
'
react-native
'
;
import
{
COLORS
,
IMGS
,
ROUTES
}
from
'
../../constants
'
;
import
LinearGradient
from
'
react-native-linear-gradient
'
;
import
Icon
from
'
react-native-vector-icons/Ionicons
'
;
const
Home
=
({
navigation
})
=>
{
const
cards
=
[
...
...
@@ -51,7 +50,15 @@ const Home = ({navigation}) => {
zIndex
:
5
,
}}
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
>
<
View
style
=
{{
...
...
src/services/auth/index.js
View file @
92167ac7
...
...
@@ -48,19 +48,17 @@ export let signup = async (name, password, email, age, week) => {
export
const
getUserDetails
=
async
()
=>
{
try
{
const
email
=
await
AsyncStorage
.
getItem
(
'
userEmail
'
);
console
.
log
(
email
,
'
email
'
);
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
(
BASE_PATH
+
`/user-details?email=
${
encodeURIComponent
(
email
)}
`
,
{
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
)
{
await
AsyncStorage
.
setItem
(
'
userDetails
'
,
...
...
@@ -70,6 +68,6 @@ export const getUserDetails = async () => {
return
response
.
data
;
}
catch
(
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