Commit 92167ac7 authored by Malsha Jayakody's avatar Malsha Jayakody

change profile icon

parent fbd66e44
......@@ -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
......@@ -27,9 +23,8 @@ export default {
EXERCISE_NEW_VIEW: 'Exercise_NEW_View',
EXERCISE_NEW_ACTION_VIEW: 'Exercise_NEW_ACTION_View',
EXERCISE_NEW_PROGRESS: 'Exercise_NEW_PROGRESS',
//skin
//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',
};
......@@ -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: 80,
height: 80,
width: 140,
height: 140,
borderRadius: 40,
marginBottom: 10,
marginBottom: 20,
},
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: 40,
marginTop: 20,
},
button2: {
flexDirection: 'row',
......@@ -184,7 +184,7 @@ const styles = StyleSheet.create({
width: '90%',
padding: 15,
marginVertical: 5,
marginTop: 230,
marginTop: 150,
},
buttonText: {
textAlign: 'center',
......
......@@ -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={{
......
......@@ -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;
}
};
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