mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-01 18:19:43 +00:00
feat(mobile): align store-safe experience
Remove client-side adult-content preferences and badges so the centrally reviewed catalogue is the single visibility boundary.\n\nUse neutral relationship-focused copy across onboarding, discovery, paywall, and login surfaces, and retain biometric controls under App Lock for both native platforms.
This commit is contained in:
1 parent
72e031eb84
commit
7a0de45482
18 files changed
+68
-368
No files matched your search
@@ -160,9 +160,9 @@ export function ProfileScreen() {
|
||||
/>
|
||||
<View style={styles.divider} />
|
||||
<MenuItem
|
||||
icon="options-outline"
|
||||
label="Preferences"
|
||||
description="Comfort zone and security"
|
||||
icon="lock-closed-outline"
|
||||
label="App Lock"
|
||||
description="Biometric access controls"
|
||||
onPress={() => router.push('/(app)/settings/preferences')}
|
||||
/>
|
||||
</SettingsSection>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Text, View, StyleSheet } from 'react-native';
|
||||
import { SettingsSection } from './SettingsSection';
|
||||
import { SwitchItem } from './SwitchItem';
|
||||
import { colors, spacing } from '../../../theme';
|
||||
@@ -10,9 +10,6 @@ interface PrivacySettingsProps {
|
||||
biometricType: string;
|
||||
isUpdatingBiometric: boolean;
|
||||
onBiometricToggle: (value: boolean) => void;
|
||||
hideNsfw: boolean;
|
||||
isUpdatingHideNsfw: boolean;
|
||||
onHideNsfwToggle: (value: boolean) => void;
|
||||
}
|
||||
|
||||
export const PrivacySettings: React.FC<PrivacySettingsProps> = ({
|
||||
@@ -21,44 +18,37 @@ export const PrivacySettings: React.FC<PrivacySettingsProps> = ({
|
||||
biometricType,
|
||||
isUpdatingBiometric,
|
||||
onBiometricToggle,
|
||||
hideNsfw,
|
||||
isUpdatingHideNsfw,
|
||||
onHideNsfwToggle,
|
||||
}) => {
|
||||
return (
|
||||
<SettingsSection title="Preferences" delay={375}>
|
||||
{/* Hide Adult Content Toggle */}
|
||||
<SwitchItem
|
||||
icon="eye-off-outline"
|
||||
label="Hide Adult Content"
|
||||
description="Only show mild, family-friendly question packs"
|
||||
value={hideNsfw}
|
||||
onValueChange={onHideNsfwToggle}
|
||||
disabled={isUpdatingHideNsfw}
|
||||
/>
|
||||
|
||||
{/* Biometric Toggle */}
|
||||
<SettingsSection title="Security" delay={375}>
|
||||
{biometricAvailable && (
|
||||
<>
|
||||
<View style={styles.divider} />
|
||||
<SwitchItem
|
||||
icon={biometricType === "Face ID" || biometricType === "Face Recognition" ? "scan-outline" : "finger-print-outline"}
|
||||
label={biometricType}
|
||||
description="Require unlock when opening app"
|
||||
value={biometricEnabled}
|
||||
onValueChange={onBiometricToggle}
|
||||
disabled={isUpdatingBiometric}
|
||||
/>
|
||||
</>
|
||||
<SwitchItem
|
||||
icon={biometricType === "Face ID" || biometricType === "Face Recognition" ? "scan-outline" : "finger-print-outline"}
|
||||
label={biometricType}
|
||||
description="Require unlock when opening app"
|
||||
value={biometricEnabled}
|
||||
onValueChange={onBiometricToggle}
|
||||
disabled={isUpdatingBiometric}
|
||||
/>
|
||||
)}
|
||||
{!biometricAvailable && (
|
||||
<View style={styles.unavailableRow}>
|
||||
<Text style={styles.unavailableText}>
|
||||
Biometric app lock is not available on this device.
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</SettingsSection>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
divider: {
|
||||
height: 1,
|
||||
backgroundColor: colors.border,
|
||||
marginVertical: spacing.lg,
|
||||
unavailableRow: {
|
||||
paddingHorizontal: spacing.lg,
|
||||
paddingVertical: spacing.md,
|
||||
},
|
||||
unavailableText: {
|
||||
color: colors.textSecondary,
|
||||
lineHeight: 20,
|
||||
},
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { Alert, Linking, Platform } from 'react-native';
|
||||
import { useAuthStore, useSubscriptionStore, usePacksStore } from '../../../store';
|
||||
import { useAuthStore, useSubscriptionStore } from '../../../store';
|
||||
import { supabase } from '../../../lib/supabase';
|
||||
import { Events } from '../../../lib/analytics';
|
||||
import { useAvatarPicker } from '../../../hooks/useAvatarPicker';
|
||||
@@ -16,15 +16,8 @@ import {
|
||||
getBiometricType,
|
||||
} from '../../../lib/biometricAuth';
|
||||
|
||||
// Intensity thresholds for backwards compatibility
|
||||
// When hide_nsfw=true, max_intensity=2 (mild content only)
|
||||
// When hide_nsfw=false, max_intensity=5 (all content)
|
||||
const NSFW_OFF_INTENSITY = 2;
|
||||
const NSFW_ON_INTENSITY = 5;
|
||||
|
||||
export function useProfileSettings() {
|
||||
const { user, fetchUser } = useAuthStore();
|
||||
const { fetchPacks } = usePacksStore();
|
||||
const { restorePurchases, isPurchasing } = useSubscriptionStore();
|
||||
|
||||
// Name Editing
|
||||
@@ -69,10 +62,6 @@ export function useProfileSettings() {
|
||||
onUploadError: handleAvatarUploadError,
|
||||
});
|
||||
|
||||
// Hide NSFW
|
||||
const [hideNsfw, setHideNsfw] = useState(!!user?.hide_nsfw);
|
||||
const [isUpdatingHideNsfw, setIsUpdatingHideNsfw] = useState(false);
|
||||
|
||||
// Notifications
|
||||
const [pushEnabled, setPushEnabled] = useState(!!user?.push_token);
|
||||
const [isUpdatingPush, setIsUpdatingPush] = useState(false);
|
||||
@@ -92,7 +81,6 @@ export function useProfileSettings() {
|
||||
setNewName(user.name);
|
||||
}
|
||||
setPushEnabled(!!user?.push_token);
|
||||
setHideNsfw(!!user?.hide_nsfw);
|
||||
}, [user]);
|
||||
|
||||
// Check biometric availability
|
||||
@@ -229,43 +217,6 @@ export function useProfileSettings() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleHideNsfwToggle = async (value: boolean) => {
|
||||
if (!user?.id) return;
|
||||
|
||||
const previous = hideNsfw;
|
||||
setHideNsfw(value);
|
||||
setIsUpdatingHideNsfw(true);
|
||||
|
||||
// Derive intensity from hide_nsfw for backwards compatibility
|
||||
const maxIntensity = value ? NSFW_OFF_INTENSITY : NSFW_ON_INTENSITY;
|
||||
const showExplicitContent = !value;
|
||||
|
||||
try {
|
||||
const { error } = await supabase
|
||||
.from('profiles')
|
||||
.update({
|
||||
hide_nsfw: value,
|
||||
max_intensity: maxIntensity,
|
||||
show_explicit_content: showExplicitContent,
|
||||
updated_at: new Date().toISOString(),
|
||||
})
|
||||
.eq('id', user.id);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
// Refresh user data and packs to reflect the change
|
||||
await fetchUser();
|
||||
await fetchPacks();
|
||||
Events.profileUpdated(["hide_nsfw", "max_intensity", "show_explicit_content"]);
|
||||
} catch (error) {
|
||||
// Revert on error
|
||||
setHideNsfw(previous);
|
||||
Alert.alert("Error", "Failed to update preference. Please try again.");
|
||||
} finally {
|
||||
setIsUpdatingHideNsfw(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Subscription Actions
|
||||
const handleRestorePurchases = async () => {
|
||||
const restored = await restorePurchases();
|
||||
@@ -294,8 +245,6 @@ export function useProfileSettings() {
|
||||
biometricEnabled: biometricEnabledState,
|
||||
biometricType,
|
||||
isUpdatingBiometric,
|
||||
hideNsfw,
|
||||
isUpdatingHideNsfw,
|
||||
showPaywall,
|
||||
setShowPaywall,
|
||||
isPurchasing,
|
||||
@@ -306,7 +255,6 @@ export function useProfileSettings() {
|
||||
handleAvatarPress,
|
||||
handlePushToggle,
|
||||
handleBiometricToggle,
|
||||
handleHideNsfwToggle,
|
||||
handleRestorePurchases,
|
||||
handleManageSubscription,
|
||||
};
|
||||
|
||||
@@ -7,14 +7,14 @@ import { useProfileSettings } from '../hooks';
|
||||
import { ScreenHeader, PrivacySettings } from '../components';
|
||||
|
||||
/**
|
||||
* Preferences sub-screen for content and biometric settings.
|
||||
* App-lock settings shared by iOS and Android.
|
||||
*/
|
||||
export function PreferencesScreen() {
|
||||
const settings = useProfileSettings();
|
||||
|
||||
return (
|
||||
<GradientBackground>
|
||||
<ScreenHeader title="Preferences" />
|
||||
<ScreenHeader title="App Lock" />
|
||||
<ScrollView
|
||||
style={styles.container}
|
||||
contentContainerStyle={styles.content}
|
||||
@@ -26,10 +26,7 @@ export function PreferencesScreen() {
|
||||
biometricType={settings.biometricType}
|
||||
isUpdatingBiometric={settings.isUpdatingBiometric}
|
||||
onBiometricToggle={settings.handleBiometricToggle}
|
||||
hideNsfw={settings.hideNsfw}
|
||||
isUpdatingHideNsfw={settings.isUpdatingHideNsfw}
|
||||
onHideNsfwToggle={settings.handleHideNsfwToggle}
|
||||
/>
|
||||
/>
|
||||
</ScrollView>
|
||||
</GradientBackground>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user