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

change profile icon

parent fbd66e44
...@@ -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',
}; };
...@@ -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: 80, width: 140,
height: 80, height: 140,
borderRadius: 40, borderRadius: 40,
marginBottom: 10, marginBottom: 20,
}, },
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: 40, marginTop: 20,
}, },
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: 230, marginTop: 150,
}, },
buttonText: { buttonText: {
textAlign: 'center', textAlign: 'center',
......
...@@ -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={{
......
...@@ -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;
} }
}; };
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