manage theme
This commit is contained in:
@@ -13,6 +13,7 @@ import BottomTabs from "./BottomTabs";
|
|||||||
import BecomeOrg from "../screens/profile/BecomeOrg";
|
import BecomeOrg from "../screens/profile/BecomeOrg";
|
||||||
import EditGroupScreen from "../screens/management/EditGroupScreen";
|
import EditGroupScreen from "../screens/management/EditGroupScreen";
|
||||||
import YourContacts from "../screens/management/YourContacts";
|
import YourContacts from "../screens/management/YourContacts";
|
||||||
|
import Transaction from "../screens/profile/Transaction";
|
||||||
|
|
||||||
const Stack = createNativeStackNavigator();
|
const Stack = createNativeStackNavigator();
|
||||||
export type RootStackParamList = {
|
export type RootStackParamList = {
|
||||||
@@ -64,6 +65,7 @@ export default function AppNavigator() {
|
|||||||
<Stack.Screen name="GroupReview" component={GroupReview} options={{ headerShown: false }} />
|
<Stack.Screen name="GroupReview" component={GroupReview} options={{ headerShown: false }} />
|
||||||
<Stack.Screen name="BecomeOrg" component={BecomeOrg} options={{ headerShown: false }} />
|
<Stack.Screen name="BecomeOrg" component={BecomeOrg} options={{ headerShown: false }} />
|
||||||
<Stack.Screen name="YourContacts" component={YourContacts} options={{ headerShown: false }} />
|
<Stack.Screen name="YourContacts" component={YourContacts} options={{ headerShown: false }} />
|
||||||
|
<Stack.Screen name="Transaction" component={Transaction} options={{ headerShown: false }} />
|
||||||
{/* <Stack.Screen name="EditGroup" component={EditGroupScreen} options={{ headerShown: false }} /> */}
|
{/* <Stack.Screen name="EditGroup" component={EditGroupScreen} options={{ headerShown: false }} /> */}
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
Alert,
|
Alert,
|
||||||
|
RefreshControl,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { FAB } from "react-native-paper";
|
import { FAB } from "react-native-paper";
|
||||||
import { Ionicons } from "@react-native-vector-icons/ionicons";
|
import { Ionicons } from "@react-native-vector-icons/ionicons";
|
||||||
@@ -20,7 +21,7 @@ import { StackNavigationProp } from "@react-navigation/stack";
|
|||||||
import { RootStackParamList } from "../navigation/AppNavigator";
|
import { RootStackParamList } from "../navigation/AppNavigator";
|
||||||
import AppView from "../components/AppView";
|
import AppView from "../components/AppView";
|
||||||
import { apiCall } from "../utils/ApiHelper";
|
import { apiCall } from "../utils/ApiHelper";
|
||||||
import { BASE_URL, JOIN_GROUP_URL } from "../utils/ApiUrls";
|
import { BASE_URL, JOIN_GROUP_URL, PUT_USER_STATUS } from "../utils/ApiUrls";
|
||||||
import colors from "../components/colors";
|
import colors from "../components/colors";
|
||||||
import { ApiResponse } from "./home/UserProfileStatus";
|
import { ApiResponse } from "./home/UserProfileStatus";
|
||||||
import * as Keychain from "react-native-keychain";
|
import * as Keychain from "react-native-keychain";
|
||||||
@@ -92,6 +93,7 @@ export default function GroupScreen() {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [role, setRole] = useState<string | null>(null);
|
const [role, setRole] = useState<string | null>(null);
|
||||||
|
const [refreshing, setRefreshing] = useState<boolean>(false)
|
||||||
|
|
||||||
const fetchGroups = async () => {
|
const fetchGroups = async () => {
|
||||||
if (loading) return;
|
if (loading) return;
|
||||||
@@ -151,7 +153,7 @@ export default function GroupScreen() {
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const response = await fetch(`${BASE_URL}user/profile/status`, {
|
const response = await fetch(PUT_USER_STATUS, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "*/*",
|
Accept: "*/*",
|
||||||
@@ -190,6 +192,14 @@ export default function GroupScreen() {
|
|||||||
Alert.alert("View Group", `Viewing details for ${group.groupName}`);
|
Alert.alert("View Group", `Viewing details for ${group.groupName}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRefresh = () => {
|
||||||
|
setRefreshing(true)
|
||||||
|
fetchGroups()
|
||||||
|
setTimeout(() => {
|
||||||
|
setRefreshing(false)
|
||||||
|
}, 20000);
|
||||||
|
}
|
||||||
|
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
let data: Group[];
|
let data: Group[];
|
||||||
switch (activeTab) {
|
switch (activeTab) {
|
||||||
@@ -226,6 +236,10 @@ export default function GroupScreen() {
|
|||||||
)}
|
)}
|
||||||
columnWrapperStyle={isGridView ? { justifyContent: 'space-between' } : null}
|
columnWrapperStyle={isGridView ? { justifyContent: 'space-between' } : null}
|
||||||
contentContainerStyle={{ paddingBottom: 150 }}
|
contentContainerStyle={{ paddingBottom: 150 }}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
|
||||||
|
}
|
||||||
|
ListFooterComponent={<ActivityIndicator size={'large'} color={colors.Group}/>}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -289,7 +303,7 @@ const styles = StyleSheet.create({
|
|||||||
searchContainer: { flexDirection: 'row', alignItems: 'center', backgroundColor: '#fff', borderRadius: 12, paddingHorizontal: 10, elevation: 2, marginVertical: 20 },
|
searchContainer: { flexDirection: 'row', alignItems: 'center', backgroundColor: '#fff', borderRadius: 12, paddingHorizontal: 10, elevation: 2, marginVertical: 20 },
|
||||||
searchIcon: { marginRight: 8 },
|
searchIcon: { marginRight: 8 },
|
||||||
searchInput: { flex: 1, height: 45, fontSize: 16, color: '#333' },
|
searchInput: { flex: 1, height: 45, fontSize: 16, color: '#333' },
|
||||||
sectionTitle: { fontSize: 20, fontWeight: 'bold', color: '#333', marginBottom: 12, paddingHorizontal: 16 },
|
sectionTitle: { fontSize: 20, fontWeight: 'bold', color: colors.Group, marginBottom: 12, paddingHorizontal: 16 },
|
||||||
featuredList: { paddingLeft: 16, marginBottom: 20 },
|
featuredList: { paddingLeft: 16, marginBottom: 20 },
|
||||||
featuredCard: { width: width * 0.45, marginRight: 15, backgroundColor: '#fff', borderRadius: 12, elevation: 3, overflow: 'hidden' },
|
featuredCard: { width: width * 0.45, marginRight: 15, backgroundColor: '#fff', borderRadius: 12, elevation: 3, overflow: 'hidden' },
|
||||||
featuredImage: { width: '100%', height: 100 },
|
featuredImage: { width: '100%', height: 100 },
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as Keychain from "react-native-keychain";
|
|||||||
import { StackNavigationProp } from "@react-navigation/stack";
|
import { StackNavigationProp } from "@react-navigation/stack";
|
||||||
import { useNavigation } from "@react-navigation/native";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
import { RootStackParamList } from "../navigation/AppNavigator"; // adjust path
|
import { RootStackParamList } from "../navigation/AppNavigator"; // adjust path
|
||||||
import { BASE_URL } from "../utils/ApiUrls";
|
import { BASE_URL, PUT_USER_STATUS } from "../utils/ApiUrls";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { setUserData } from "../redux/userSlice";
|
import { setUserData } from "../redux/userSlice";
|
||||||
import colors from "../components/colors";
|
import colors from "../components/colors";
|
||||||
@@ -30,7 +30,7 @@ const SplashScreen = () => {
|
|||||||
}
|
}
|
||||||
const token = credentials.password;
|
const token = credentials.password;
|
||||||
|
|
||||||
const response = await fetch(`${BASE_URL}user/profile/status`, {
|
const response = await fetch(PUT_USER_STATUS, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "*/*",
|
Accept: "*/*",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from "react-native";
|
} from "react-native";
|
||||||
import * as Keychain from "react-native-keychain";
|
import * as Keychain from "react-native-keychain";
|
||||||
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
||||||
import { BASE_URL } from "../../utils/ApiUrls";
|
import { BASE_URL, PUT_USER_STATUS } from "../../utils/ApiUrls";
|
||||||
import colors from "../../components/colors";
|
import colors from "../../components/colors";
|
||||||
|
|
||||||
export type ApiResponse = {
|
export type ApiResponse = {
|
||||||
@@ -44,7 +44,7 @@ const UserProfileStatus: React.FC = () => {
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const response = await fetch(`${BASE_URL}user/profile/status`, {
|
const response = await fetch(PUT_USER_STATUS, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "*/*",
|
Accept: "*/*",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
Alert,
|
Alert,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import AppView from "../../components/AppView";
|
import AppView from "../../components/AppView";
|
||||||
|
import colors from "../../components/colors";
|
||||||
|
|
||||||
const { ContactsModule } = NativeModules;
|
const { ContactsModule } = NativeModules;
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ const styles = StyleSheet.create({
|
|||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
borderRadius: 25,
|
borderRadius: 25,
|
||||||
backgroundColor: "#25D366",
|
backgroundColor: colors.pastelOrange,
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
marginRight: 12,
|
marginRight: 12,
|
||||||
@@ -213,10 +214,10 @@ const styles = StyleSheet.create({
|
|||||||
paddingVertical: 6,
|
paddingVertical: 6,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#25D366",
|
borderColor: colors.Settings,
|
||||||
},
|
},
|
||||||
inviteText: {
|
inviteText: {
|
||||||
color: "#25D366",
|
color: colors.Settings,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
},
|
},
|
||||||
modalOverlay: {
|
modalOverlay: {
|
||||||
@@ -264,7 +265,7 @@ const styles = StyleSheet.create({
|
|||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
backgroundColor: "#25D366",
|
backgroundColor: colors.pastelOrange,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
sendText: {
|
sendText: {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const BecomeOrg = () => {
|
|||||||
<TouchableOpacity onPress={() => navigation.replace("Home" as never)} >
|
<TouchableOpacity onPress={() => navigation.replace("Home" as never)} >
|
||||||
<Ionicons name="arrow-back" size={24} color={'#000'} />
|
<Ionicons name="arrow-back" size={24} color={'#000'} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<Text style={styles.headerTitle}>User Profile</Text>
|
<Text style={styles.headerTitle}>Become Organizer</Text>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
|
|||||||
@@ -22,13 +22,11 @@ import colors from "../../components/colors";
|
|||||||
import SwitchNavigator from "./SwitchNavigator";
|
import SwitchNavigator from "./SwitchNavigator";
|
||||||
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
||||||
import { ApiResponse } from "../home/UserProfileStatus";
|
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 AppView from "../../components/AppView";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { setUserData } from "../../redux/userSlice";
|
import { setUserData } from "../../redux/userSlice";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type UserProfile = {
|
type UserProfile = {
|
||||||
id: string;
|
id: string;
|
||||||
userId: number;
|
userId: number;
|
||||||
@@ -127,7 +125,7 @@ const Profile = () => {
|
|||||||
const token = credentials.password;
|
const token = credentials.password;
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${BASE_URL}user/profile/update`,
|
PUT_USER_PROFILE,
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -198,7 +196,7 @@ const Profile = () => {
|
|||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${BASE_URL}user/update/userImg`,
|
PUT_USER_PROFILE_IMG,
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -245,7 +243,7 @@ const Profile = () => {
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const response = await fetch(`${BASE_URL}user/profile/status`, {
|
const response = await fetch(PUT_USER_STATUS, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "*/*",
|
Accept: "*/*",
|
||||||
@@ -350,7 +348,7 @@ const Profile = () => {
|
|||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
<Text style={styles.headerTitle}>User Profile</Text>
|
<Text style={styles.headerTitle}>User Profile</Text>
|
||||||
<TouchableOpacity onPress={() => confirmLogout(navigation)} style={styles.refreshButton}>
|
<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>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
@@ -426,6 +424,9 @@ const Profile = () => {
|
|||||||
</View> */}
|
</View> */}
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
|
<TouchableOpacity onPress={()=>navigation.navigate('Transaction')}>
|
||||||
|
<Text>View Transaction</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
<CustomButton
|
<CustomButton
|
||||||
title="Edit Profile"
|
title="Edit Profile"
|
||||||
onPress={() => setEditing(true)}
|
onPress={() => setEditing(true)}
|
||||||
@@ -692,7 +693,7 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 8,
|
paddingHorizontal: 8,
|
||||||
},
|
},
|
||||||
editSection: {
|
editSection: {
|
||||||
marginBottom: '40%',
|
marginBottom: '100%',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
editButtons: {
|
editButtons: {
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|
||||||
|
})
|
||||||
@@ -6,11 +6,11 @@ export const GROUP_CREATION_URL = `${BASE_URL}fund/groups/{organizerId}`
|
|||||||
export const PROFILE_URL =`${BASE_URL}user/profile/view`
|
export const PROFILE_URL =`${BASE_URL}user/profile/view`
|
||||||
export const PUBLIC_GROUPS_URL =`${BASE_URL}fund/user/public`
|
export const PUBLIC_GROUPS_URL =`${BASE_URL}fund/user/public`
|
||||||
export const JOIN_GROUP_URL = `${BASE_URL}fund/`;
|
export const JOIN_GROUP_URL = `${BASE_URL}fund/`;
|
||||||
export const MY_GROUPS_URL =`https://api.godemo.in/FundCollect/api/fund/getAll/my/groups`
|
export const MY_GROUPS_URL =`${BASE_URL}fund/getAll/my/groups`
|
||||||
|
export const REQUESTS_URL =`${BASE_URL}fund/group/pending/request`
|
||||||
export const REQUESTS_URL =`https://api.godemo.in/FundCollect/api/fund/group/pending/request`
|
export const APPROVE_REQUEST_URL =`${BASE_URL}fund/requests/`
|
||||||
//https://api.godemo.in/FundCollect/api/fund/groups/2a80cdaa-8532-4b8a-87f0-9c1023d18a7f/join/64
|
export const DECLINE_REQUEST_URL =`${BASE_URL}fund/user/my/groups`
|
||||||
export const APPROVE_REQUEST_URL =`https://api.godemo.in/FundCollect/api/fund/requests/`
|
export const GET_JOINED_GROUP_URL = `${BASE_URL}fund/my/join/groups`
|
||||||
export const DECLINE_REQUEST_URL =`https://api.godemo.in/FundCollect/api/fund/user/my/groups`
|
export const PUT_USER_PROFILE_IMG = `${BASE_URL}user/update/userImg`
|
||||||
// https://api.godemo.in/FundCollect/api/fund/groups/b89f56a1-952d-41b3-ab8d-3c28c91697f5/join/100005
|
export const PUT_USER_PROFILE = `${BASE_URL}user/profile/update`
|
||||||
export const GET_JOINED_GROUP_URL = `https://api.godemo.in/FundCollect/api/fund/my/join/groups`
|
export const PUT_USER_STATUS = `${BASE_URL}user/profile/status`
|
||||||
Reference in New Issue
Block a user