handle notification type and navigate using deeplinking
This commit is contained in:
@@ -110,7 +110,7 @@ const GroupList = () => {
|
||||
}
|
||||
}, [search, groups]);
|
||||
|
||||
if (loading) return <ActivityIndicator size="large" color={colors.Home} />;
|
||||
if (loading) return <ActivityIndicator size="large" color={colors.pastelBlue} />;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -175,10 +175,10 @@ const styles = StyleSheet.create({
|
||||
alignItems: "center",
|
||||
marginRight: 12,
|
||||
},
|
||||
avatarText: { fontSize: 18, fontWeight: "700", color: colors.Home },
|
||||
avatarText: { fontSize: 18, fontWeight: "700", color: colors.black },
|
||||
groupName: { fontSize: 16, fontWeight: "600", color: colors.textDark },
|
||||
groupDescription: { fontSize: 13, color: colors.textLight, marginTop: 2 },
|
||||
groupMeta: { fontSize: 12, color: colors.Home, marginTop: 2 },
|
||||
groupMeta: { fontSize: 12, color: colors.black, marginTop: 2 },
|
||||
detailsBox: {
|
||||
marginTop: 10,
|
||||
padding: 10,
|
||||
|
||||
@@ -63,6 +63,9 @@ const userActions: ActionItem[] = [
|
||||
|
||||
const Home: React.FC = () => {
|
||||
const user = useSelector((state: any) => state.user);
|
||||
const notifications = useSelector(
|
||||
(state: any) => state.notifications.notifications
|
||||
);
|
||||
const navigation = useNavigation<TabNavigationProp>();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -98,6 +101,8 @@ const Home: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const unreadCount = notifications.filter((item: any) => !item.read).length;
|
||||
|
||||
const renderGridItem: ListRenderItem<ActionItem> = ({ item }) => (
|
||||
<View style={styles.cardWrapper}>
|
||||
<AnimatedCard
|
||||
@@ -126,6 +131,7 @@ const Home: React.FC = () => {
|
||||
</View>
|
||||
<TouchableOpacity onPress={() => navigation.navigate("Notification" as never)}>
|
||||
{/* <Image source={getProfileImageUri()} style={styles.profileImage} /> */}
|
||||
<Text style={{position: 'absolute', right: -6, top: -4, backgroundColor: colors.danger, color: colors.white, borderRadius: 8, width: 16, height: 16, textAlign: 'center', fontSize: 10, fontWeight: 'bold', lineHeight: 16, zIndex: 1}}>{unreadCount > 0 ? unreadCount : ''}</Text>
|
||||
<Ionicons name="notifications-outline" size={30} color={colors.textDark} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
@@ -125,7 +125,7 @@ const RequestList: React.FC = () => {
|
||||
|
||||
// Make API call to approve the request
|
||||
const response = await fetch(
|
||||
`https://api.godemo.in/FundCollect/api/fund/requests/${requestId}/approve`,
|
||||
`http://192.168.1.5:9060/api/fund/requests/${requestId}/approve`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
@@ -171,7 +171,7 @@ const RequestList: React.FC = () => {
|
||||
|
||||
// Make API call to decline the request
|
||||
const response = await fetch(
|
||||
`https://api.godemo.in/FundCollect/api/fund/requests/${requestedId}/reject?reason=/${reason}`,
|
||||
`http://192.168.1.5:9060/api/fund/requests/${requestedId}/reject?reason=/${reason}`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user