diff --git a/mobile/app/projects/[id].tsx b/mobile/app/projects/[id].tsx index 0a62e7f3..bc19ace6 100644 --- a/mobile/app/projects/[id].tsx +++ b/mobile/app/projects/[id].tsx @@ -146,7 +146,7 @@ export default function ProjectDetailScreen() { if (loading) { return ( - + Loading project... ); @@ -154,21 +154,21 @@ export default function ProjectDetailScreen() { if (!project) { return ( - + Project not found ); } return ( - - + + {project.category} {project.name} 📍 {project.location} - + {parseFloat(project.raisedXLM).toFixed(2)} @@ -185,9 +185,9 @@ export default function ProjectDetailScreen() { - + Fundraising Progress - + - + {progressPercent(project.raisedXLM, project.goalXLM)}% complete - + Goal: {parseFloat(project.goalXLM).toFixed(2)} XLM diff --git a/mobile/utils/notifications.ts b/mobile/utils/notifications.ts index ddbbb498..bfa655d0 100644 --- a/mobile/utils/notifications.ts +++ b/mobile/utils/notifications.ts @@ -152,17 +152,17 @@ export async function checkNotificationPermissions(): Promise { const { status: existingStatus, canAskAgain } = await Notifications.getPermissionsAsync(); let finalStatus = existingStatus; - + if (existingStatus !== 'granted' && canAskAgain !== false) { const { status } = await Notifications.requestPermissionsAsync(); finalStatus = status; } - + if (finalStatus !== 'granted') { console.log('Push notification permission denied by user'); return null; } - + return finalStatus; } @@ -232,11 +232,11 @@ export async function getPushToken(): Promise { await setupNotificationChannel(); const permissionStatus = await requestNotificationPermissions(); if (!permissionStatus) return null; - + const tokenResult = await Notifications.getExpoPushTokenAsync({ projectId: process.env.EXPO_PUBLIC_PROJECT_ID || '', }); - + const token = tokenResult?.data; if (token) { await saveStoredPushToken(token); @@ -257,7 +257,7 @@ export async function registerDeviceToken( ): Promise { try { const platform = Platform.OS; - + const registered = await postJson('/api/notifications/register', { token, platform, @@ -348,7 +348,7 @@ export async function followProject( }); if (!followed) return false; - + console.log(`Followed project ${projectId}`); return true; } catch (error) { @@ -371,7 +371,7 @@ export async function unfollowProject( }); if (!unfollowed) return false; - + console.log(`Unfollowed project ${projectId}`); return true; } catch (error) { @@ -433,7 +433,7 @@ export function setupNotificationListener(options?: { retryPendingRegistration(); } }); - + return { remove: () => { notificationSubscription.remove();