This commit is contained in:
Jamie Brunton committed 2025-12-30 22:18:12 +00:00
1 parent c978a3bd28
commit 0f229211ea
19 files changed
+1625 -624

No files matched your search

+4
View File
@@ -14,6 +14,7 @@ import { decode } from 'base64-arraybuffer';
import { Database } from "../../../src/types/supabase";
import { GradientBackground } from "../../../src/components/ui";
import { colors, gradients, spacing, radius, typography } from "../../../src/theme";
import { Events } from "../../../src/lib/analytics";
type Message = Database["public"]["Tables"]["messages"]["Row"];
@@ -205,6 +206,8 @@ export default function ChatScreen() {
if (error) {
Alert.alert("Error", "Failed to send message");
setInputText(content);
} else {
Events.messageSent();
}
};
@@ -283,6 +286,7 @@ export default function ChatScreen() {
user_id: user.id,
media_path: fileName,
});
Events.mediaUploaded();
} catch (error) {
Alert.alert("Error", "Failed to upload image");
+7 -1
View File
@@ -28,7 +28,9 @@ import { GlassButton } from '../../src/components/ui/GlassButton';
import { colors, gradients, spacing, typography, radius, shadows } from '../../src/theme';
import { useAuthStore } from '../../src/store';
import { supabase } from '../../src/lib/supabase';
import { getProfileError } from '../../src/lib/errors';
import { registerForPushNotificationsAsync, savePushToken } from '../../src/lib/notifications';
import { Events } from '../../src/lib/analytics';
import type { Gender } from '../../src/types';
const GENDER_OPTIONS: { value: Gender; label: string; icon: string }[] = [
@@ -59,6 +61,7 @@ export default function OnboardingScreen() {
Keyboard.dismiss();
setError(null);
setStage('gender');
Events.onboardingStageComplete('name');
};
const handleGenderSelect = (selectedGender: Gender) => {
@@ -72,10 +75,12 @@ export default function OnboardingScreen() {
return;
}
setStage('explicit');
Events.onboardingStageComplete('gender');
};
const handleExplicitContinue = () => {
setStage('notifications');
Events.onboardingStageComplete('explicit');
};
const handleEnableNotifications = async () => {
@@ -124,10 +129,11 @@ export default function OnboardingScreen() {
console.log('[Onboarding] Profile updated successfully, fetching user...');
await fetchUser();
console.log('[Onboarding] User fetched, navigating to home...');
Events.onboardingComplete();
router.replace('/');
} catch (err: any) {
console.error('Onboarding error:', err);
setError(err.message || 'Something went wrong');
setError(getProfileError(err));
} finally {
setIsLoading(false);
}
+10 -4
View File
@@ -17,6 +17,8 @@ import Animated, { FadeInDown } from "react-native-reanimated";
import * as Clipboard from "expo-clipboard";
import { useAuthStore } from "../../src/store";
import { supabase } from "../../src/lib/supabase";
import { getPairingError } from "../../src/lib/errors";
import { Events } from "../../src/lib/analytics";
import { router } from "expo-router";
import { GradientBackground, GlassCard, GlassButton } from "../../src/components/ui";
import { colors, gradients, spacing, radius, typography, shadows } from "../../src/theme";
@@ -81,8 +83,9 @@ export default function PairingScreen() {
await fetchUser(); // Refresh user to get couple_id
await fetchCouple(); // Fetch couple data
Events.coupleCreated();
} catch (error: any) {
Alert.alert("Error", error.message);
Alert.alert("Error", getPairingError(error));
} finally {
setIsSubmitting(false);
}
@@ -92,7 +95,7 @@ export default function PairingScreen() {
// Validate invite code format (8 alphanumeric characters)
const sanitizedCode = inviteCode.trim().toUpperCase();
if (!/^[A-Z0-9]{8}$/.test(sanitizedCode)) {
Alert.alert("Error", "Please enter a valid 8-character invite code");
Alert.alert("Invalid Code", "Please enter a valid 8-character invite code.");
return;
}
@@ -118,12 +121,13 @@ export default function PairingScreen() {
await fetchUser(); // Refresh user to get couple_id
await fetchCouple(); // Fetch couple data
Events.coupleJoined();
Alert.alert("Success", "You are now paired!", [
{ text: "Let's Go", onPress: () => router.replace("/(app)/") }
]);
} catch (error: any) {
Alert.alert("Error", error.message);
Alert.alert("Error", getPairingError(error));
} finally {
setIsSubmitting(false);
}
@@ -142,6 +146,7 @@ export default function PairingScreen() {
await Share.share({
message: `Join me on Sauci! Use my invite code to pair up: ${couple.invite_code}`,
});
Events.codeShared();
} catch (error) {
console.error(error);
}
@@ -169,8 +174,9 @@ export default function PairingScreen() {
await fetchUser();
await fetchCouple();
Events.pairingCancelled();
} catch (error: any) {
Alert.alert("Error", error.message);
Alert.alert("Error", getPairingError(error));
} finally {
setIsSubmitting(false);
}
+1 -1
View File
@@ -34,7 +34,7 @@ export default function ProfileScreen() {
const [isDeleting, setIsDeleting] = useState(false);
const [showFeedbackModal, setShowFeedbackModal] = useState(false);
const [showPaywall, setShowPaywall] = useState(false);
const [showExplicit, setShowExplicit] = useState(user?.show_explicit_content ?? false);
const [showExplicit, setShowExplicit] = useState(user?.show_explicit_content ?? true);
const [isUpdatingExplicit, setIsUpdatingExplicit] = useState(false);
const [biometricAvailable, setBiometricAvailable] = useState(false);
const [biometricEnabled, setBiometricEnabledState] = useState(false);
+4
View File
@@ -11,6 +11,7 @@ import { hasSeenSwipeTutorial, markSwipeTutorialSeen } from "../../src/lib/swipe
import SwipeCard from "../../src/components/SwipeCard";
import SwipeTutorial from "../../src/components/SwipeTutorial";
import { GradientBackground, GlassCard, GlassButton } from "../../src/components/ui";
import { Events } from "../../src/lib/analytics";
import { colors, gradients, spacing, typography, radius, shadows } from "../../src/theme";
export default function SwipeScreen() {
@@ -102,6 +103,7 @@ export default function SwipeScreen() {
// Handle skip - don't submit a response, just store it for later
if (direction === "down") {
await skipQuestion(question.id);
Events.questionSkipped();
return;
}
@@ -127,6 +129,8 @@ export default function SwipeScreen() {
if (error) {
console.error("Submit response error:", error);
} else {
Events.questionAnswered(answer, question.pack_id);
}
} catch (error) {
console.error("Failed to submit response", error);