manage theme

This commit is contained in:
Jaanu423
2025-09-22 10:48:14 +05:30
parent 04f91c0b03
commit e7158df0f8
9 changed files with 122 additions and 87 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ const BecomeOrg = () => {
<TouchableOpacity onPress={() => navigation.replace("Home" as never)} >
<Ionicons name="arrow-back" size={24} color={'#000'} />
</TouchableOpacity>
<Text style={styles.headerTitle}>User Profile</Text>
<Text style={styles.headerTitle}>Become Organizer</Text>
</View>
<KeyboardAvoidingView
+30 -29
View File
@@ -22,13 +22,11 @@ import colors from "../../components/colors";
import SwitchNavigator from "./SwitchNavigator";
import { useFocusEffect, useNavigation } from "@react-navigation/native";
import { ApiResponse } from "../home/UserProfileStatus";
import { BASE_URL } from "../../utils/ApiUrls";
import { BASE_URL, PUT_USER_PROFILE, PUT_USER_PROFILE_IMG, PUT_USER_STATUS } from "../../utils/ApiUrls";
import AppView from "../../components/AppView";
import { useDispatch } from "react-redux";
import { setUserData } from "../../redux/userSlice";
type UserProfile = {
id: string;
userId: number;
@@ -85,27 +83,27 @@ const Profile = () => {
console.log("👤 Profile Response:", result);
if (result.status === "success") {
setUser(result.data);
dispatch(setUserData({
id: result?.data.id,
userId: result?.data.userId,
username: result?.data.username,
firstName: result?.data.firstName,
lastName: result?.data.lastName,
gender: result?.data.gender,
mobile: result?.data.mobile,
email: result?.data.email,
address: result?.data.address,
bankAccountNumber: result?.data.bankAccountNumber,
bankName: result?.data.bankName,
branchCode: result?.data.branchCode,
profilePicture: result?.data.filePath, // or keep as `filePath`
filePath: result?.data.filePath,
imageBlob: result?.data.imageBlob,
role: result?.data.role,
organizerId: result?.data.organizerId,
organizerStatus: result?.data.organizerStatus,
profileStatus: true, // set true once profile is fetched
}));
dispatch(setUserData({
id: result?.data.id,
userId: result?.data.userId,
username: result?.data.username,
firstName: result?.data.firstName,
lastName: result?.data.lastName,
gender: result?.data.gender,
mobile: result?.data.mobile,
email: result?.data.email,
address: result?.data.address,
bankAccountNumber: result?.data.bankAccountNumber,
bankName: result?.data.bankName,
branchCode: result?.data.branchCode,
profilePicture: result?.data.filePath, // or keep as `filePath`
filePath: result?.data.filePath,
imageBlob: result?.data.imageBlob,
role: result?.data.role,
organizerId: result?.data.organizerId,
organizerStatus: result?.data.organizerStatus,
profileStatus: true, // set true once profile is fetched
}));
} else {
Alert.alert("Error", "Failed to fetch user profile");
}
@@ -127,7 +125,7 @@ const Profile = () => {
const token = credentials.password;
const response = await fetch(
`${BASE_URL}user/profile/update`,
PUT_USER_PROFILE,
{
method: "PUT",
headers: {
@@ -198,7 +196,7 @@ const Profile = () => {
} as any);
const response = await fetch(
`${BASE_URL}user/update/userImg`,
PUT_USER_PROFILE_IMG,
{
method: "PUT",
headers: {
@@ -245,7 +243,7 @@ const Profile = () => {
setLoading(true);
setError(null);
const response = await fetch(`${BASE_URL}user/profile/status`, {
const response = await fetch(PUT_USER_STATUS, {
method: "GET",
headers: {
Accept: "*/*",
@@ -350,7 +348,7 @@ const Profile = () => {
<View style={styles.header}>
<Text style={styles.headerTitle}>User Profile</Text>
<TouchableOpacity onPress={() => confirmLogout(navigation)} style={styles.refreshButton}>
<Ionicons name="log-out-outline" size={24} color={'#000'} />
<Ionicons name="log-out-outline" size={24} color={colors.Profile} />
</TouchableOpacity>
</View>
<KeyboardAvoidingView
@@ -426,6 +424,9 @@ const Profile = () => {
</View> */}
</View>
<View>
<TouchableOpacity onPress={()=>navigation.navigate('Transaction')}>
<Text>View Transaction</Text>
</TouchableOpacity>
<CustomButton
title="Edit Profile"
onPress={() => setEditing(true)}
@@ -692,7 +693,7 @@ const styles = StyleSheet.create({
paddingHorizontal: 8,
},
editSection: {
marginBottom: '40%',
marginBottom: '100%',
flex: 1,
},
editButtons: {
+17
View File
@@ -0,0 +1,17 @@
import { StyleSheet, Text, View } from 'react-native'
import React from 'react'
import AppView from '../../components/AppView'
const Transaction = () => {
return (
<AppView barStyle='dark-content'>
<Text>Transaction</Text>
</AppView>
)
}
export default Transaction
const styles = StyleSheet.create({
})