@oxyhq/services 6.9.45 → 6.9.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ui/components/OxyProvider.js +6 -5
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +271 -102
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +24 -15
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +0 -35
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +26 -13
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +50 -28
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +83 -48
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +11 -10
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +38 -23
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +4 -3
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +1 -3
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +47 -63
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +90 -68
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +72 -63
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +5 -5
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +57 -51
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +25 -36
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +31 -31
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +15 -8
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +60 -54
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +12 -9
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +159 -190
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +20 -22
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +16 -17
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +26 -4
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +13 -29
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +110 -52
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +3 -5
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -5
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +271 -100
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +24 -15
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/index.js +0 -5
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +26 -13
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js +49 -26
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +84 -48
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +11 -9
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +38 -22
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +4 -3
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +1 -3
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +46 -62
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +90 -68
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +73 -64
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +6 -6
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +48 -42
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +25 -36
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +32 -32
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +16 -9
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +61 -55
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +12 -9
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +161 -192
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +21 -23
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +17 -18
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +27 -5
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +15 -31
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +110 -52
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +4 -6
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/index.d.ts +0 -5
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/index.d.ts +0 -5
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/OxyProvider.tsx +6 -5
- package/src/ui/components/SignInModal.tsx +186 -42
- package/src/ui/components/fileManagement/FileViewer.tsx +25 -15
- package/src/ui/components/index.ts +0 -5
- package/src/ui/components/payment/PaymentDetailsStep.tsx +16 -19
- package/src/ui/components/payment/PaymentMethodStep.tsx +33 -35
- package/src/ui/components/payment/PaymentReviewStep.tsx +63 -67
- package/src/ui/components/payment/PaymentSuccessStep.tsx +4 -12
- package/src/ui/components/payment/PaymentSummaryStep.tsx +26 -33
- package/src/ui/context/hooks/useAuthOperations.ts +4 -3
- package/src/ui/screens/AccountCenterScreen.tsx +2 -3
- package/src/ui/screens/AccountOverviewScreen.tsx +44 -65
- package/src/ui/screens/AccountSettingsScreen.tsx +121 -149
- package/src/ui/screens/AccountSwitcherScreen.tsx +94 -115
- package/src/ui/screens/AccountVerificationScreen.tsx +10 -9
- package/src/ui/screens/FeedbackScreen.tsx +50 -38
- package/src/ui/screens/FileManagementScreen.tsx +26 -34
- package/src/ui/screens/HistoryViewScreen.tsx +29 -10
- package/src/ui/screens/LanguageSelectorScreen.tsx +19 -7
- package/src/ui/screens/LegalDocumentsScreen.tsx +46 -63
- package/src/ui/screens/PaymentGatewayScreen.tsx +11 -12
- package/src/ui/screens/PrivacySettingsScreen.tsx +81 -193
- package/src/ui/screens/SavesCollectionsScreen.tsx +23 -23
- package/src/ui/screens/SearchSettingsScreen.tsx +11 -19
- package/src/ui/screens/SessionManagementScreen.tsx +29 -3
- package/src/ui/screens/UserLinksScreen.tsx +15 -32
- package/src/ui/screens/WelcomeNewUserScreen.tsx +46 -20
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +4 -6
- package/lib/commonjs/ui/components/GroupedItem.js +0 -138
- package/lib/commonjs/ui/components/GroupedItem.js.map +0 -1
- package/lib/commonjs/ui/components/GroupedSection.js +0 -41
- package/lib/commonjs/ui/components/GroupedSection.js.map +0 -1
- package/lib/commonjs/ui/components/Section.js +0 -39
- package/lib/commonjs/ui/components/Section.js.map +0 -1
- package/lib/commonjs/ui/components/SectionTitle.js +0 -29
- package/lib/commonjs/ui/components/SectionTitle.js.map +0 -1
- package/lib/commonjs/ui/components/SettingRow.js +0 -96
- package/lib/commonjs/ui/components/SettingRow.js.map +0 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +0 -208
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +0 -1
- package/lib/module/ui/components/GroupedItem.js +0 -135
- package/lib/module/ui/components/GroupedItem.js.map +0 -1
- package/lib/module/ui/components/GroupedSection.js +0 -37
- package/lib/module/ui/components/GroupedSection.js.map +0 -1
- package/lib/module/ui/components/Section.js +0 -34
- package/lib/module/ui/components/Section.js.map +0 -1
- package/lib/module/ui/components/SectionTitle.js +0 -25
- package/lib/module/ui/components/SectionTitle.js.map +0 -1
- package/lib/module/ui/components/SettingRow.js +0 -91
- package/lib/module/ui/components/SettingRow.js.map +0 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +0 -204
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/GroupedItem.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/GroupedItem.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts +0 -30
- package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/Section.d.ts +0 -12
- package/lib/typescript/commonjs/ui/components/Section.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SectionTitle.d.ts +0 -10
- package/lib/typescript/commonjs/ui/components/SectionTitle.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SettingRow.d.ts +0 -20
- package/lib/typescript/commonjs/ui/components/SettingRow.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/GroupedItem.d.ts +0 -24
- package/lib/typescript/module/ui/components/GroupedItem.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/GroupedSection.d.ts +0 -30
- package/lib/typescript/module/ui/components/GroupedSection.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/Section.d.ts +0 -12
- package/lib/typescript/module/ui/components/Section.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SectionTitle.d.ts +0 -10
- package/lib/typescript/module/ui/components/SectionTitle.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SettingRow.d.ts +0 -20
- package/lib/typescript/module/ui/components/SettingRow.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts +0 -24
- package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +0 -1
- package/src/ui/components/GroupedItem.tsx +0 -161
- package/src/ui/components/GroupedSection.tsx +0 -60
- package/src/ui/components/Section.tsx +0 -42
- package/src/ui/components/SectionTitle.tsx +0 -27
- package/src/ui/components/SettingRow.tsx +0 -105
- package/src/ui/components/internal/GroupedPillButtons.tsx +0 -253
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { memo, useMemo } from 'react';
|
|
3
|
-
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
4
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
5
|
-
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
6
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
7
|
-
import { darkenColor } from '../utils/colorUtils';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
interface GroupedItemProps {
|
|
11
|
-
icon?: string;
|
|
12
|
-
iconColor?: string;
|
|
13
|
-
title: string;
|
|
14
|
-
subtitle?: string;
|
|
15
|
-
onPress?: () => void;
|
|
16
|
-
isFirst?: boolean;
|
|
17
|
-
isLast?: boolean;
|
|
18
|
-
showChevron?: boolean;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
customContent?: React.ReactNode;
|
|
21
|
-
customIcon?: React.ReactNode;
|
|
22
|
-
/** Accessibility label (defaults to title) */
|
|
23
|
-
accessibilityLabel?: string;
|
|
24
|
-
/** Accessibility hint for what happens on press */
|
|
25
|
-
accessibilityHint?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const GroupedItemComponent = ({
|
|
29
|
-
icon,
|
|
30
|
-
iconColor,
|
|
31
|
-
title,
|
|
32
|
-
subtitle,
|
|
33
|
-
onPress,
|
|
34
|
-
isFirst = false,
|
|
35
|
-
isLast = false,
|
|
36
|
-
showChevron = false,
|
|
37
|
-
disabled = false,
|
|
38
|
-
customContent,
|
|
39
|
-
customIcon,
|
|
40
|
-
accessibilityLabel,
|
|
41
|
-
accessibilityHint,
|
|
42
|
-
}: GroupedItemProps) => {
|
|
43
|
-
const { colors } = useTheme();
|
|
44
|
-
// Use fallback color when iconColor is not provided
|
|
45
|
-
const finalIconColor = iconColor || colors.icon;
|
|
46
|
-
|
|
47
|
-
const itemStyles = useMemo(
|
|
48
|
-
() => [
|
|
49
|
-
styles.groupedItem,
|
|
50
|
-
isFirst && styles.firstGroupedItem,
|
|
51
|
-
isLast && styles.lastGroupedItem,
|
|
52
|
-
],
|
|
53
|
-
[isFirst, isLast],
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const content = (
|
|
57
|
-
<View style={styles.groupedItemContent}>
|
|
58
|
-
{customIcon ? (
|
|
59
|
-
<View style={styles.actionIcon}>{customIcon}</View>
|
|
60
|
-
) : icon ? (
|
|
61
|
-
<View style={[styles.iconContainer, { backgroundColor: finalIconColor }]}>
|
|
62
|
-
<MaterialCommunityIcons name={icon} size={22} color={darkenColor(finalIconColor)} />
|
|
63
|
-
</View>
|
|
64
|
-
) : null}
|
|
65
|
-
<View style={styles.actionTextContainer}>
|
|
66
|
-
<Text className="text-foreground" style={styles.actionButtonText}>{title}</Text>
|
|
67
|
-
{subtitle && (
|
|
68
|
-
<Text className="text-muted-foreground" style={styles.actionButtonSubtext}>
|
|
69
|
-
{subtitle}
|
|
70
|
-
</Text>
|
|
71
|
-
)}
|
|
72
|
-
</View>
|
|
73
|
-
{customContent}
|
|
74
|
-
{showChevron && (
|
|
75
|
-
<Ionicons name="chevron-forward" size={20} color={colors.icon} />
|
|
76
|
-
)}
|
|
77
|
-
</View>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
if (onPress && !disabled) {
|
|
81
|
-
return (
|
|
82
|
-
<TouchableOpacity
|
|
83
|
-
className="bg-card"
|
|
84
|
-
style={itemStyles}
|
|
85
|
-
onPress={onPress}
|
|
86
|
-
activeOpacity={0.7}
|
|
87
|
-
accessibilityRole="button"
|
|
88
|
-
accessibilityLabel={accessibilityLabel || title}
|
|
89
|
-
accessibilityHint={accessibilityHint || subtitle}
|
|
90
|
-
accessibilityState={{ disabled }}
|
|
91
|
-
>
|
|
92
|
-
{content}
|
|
93
|
-
</TouchableOpacity>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
<View
|
|
99
|
-
className="bg-card"
|
|
100
|
-
style={itemStyles}
|
|
101
|
-
accessibilityRole="text"
|
|
102
|
-
accessibilityLabel={accessibilityLabel || title}
|
|
103
|
-
>
|
|
104
|
-
{content}
|
|
105
|
-
</View>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
GroupedItemComponent.displayName = 'GroupedItem';
|
|
110
|
-
|
|
111
|
-
export const GroupedItem = memo(GroupedItemComponent);
|
|
112
|
-
|
|
113
|
-
const styles = StyleSheet.create({
|
|
114
|
-
groupedItem: {
|
|
115
|
-
flexDirection: 'row',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
justifyContent: 'space-between',
|
|
118
|
-
overflow: 'hidden',
|
|
119
|
-
width: '100%',
|
|
120
|
-
},
|
|
121
|
-
firstGroupedItem: {
|
|
122
|
-
borderTopLeftRadius: 18,
|
|
123
|
-
borderTopRightRadius: 18,
|
|
124
|
-
},
|
|
125
|
-
lastGroupedItem: {
|
|
126
|
-
borderBottomLeftRadius: 18,
|
|
127
|
-
borderBottomRightRadius: 18,
|
|
128
|
-
},
|
|
129
|
-
groupedItemContent: {
|
|
130
|
-
flexDirection: 'row',
|
|
131
|
-
alignItems: 'center',
|
|
132
|
-
paddingVertical: 8,
|
|
133
|
-
paddingHorizontal: 10,
|
|
134
|
-
width: '100%',
|
|
135
|
-
gap: 10,
|
|
136
|
-
},
|
|
137
|
-
actionIcon: {
|
|
138
|
-
// marginRight handled by gap
|
|
139
|
-
},
|
|
140
|
-
iconContainer: {
|
|
141
|
-
width: 36,
|
|
142
|
-
height: 36,
|
|
143
|
-
borderRadius: 18,
|
|
144
|
-
alignItems: 'center',
|
|
145
|
-
justifyContent: 'center',
|
|
146
|
-
// marginRight handled by gap
|
|
147
|
-
},
|
|
148
|
-
actionTextContainer: {
|
|
149
|
-
flex: 1,
|
|
150
|
-
},
|
|
151
|
-
actionButtonText: {
|
|
152
|
-
fontSize: 14,
|
|
153
|
-
fontWeight: '400',
|
|
154
|
-
},
|
|
155
|
-
actionButtonSubtext: {
|
|
156
|
-
fontSize: 12,
|
|
157
|
-
marginTop: 2,
|
|
158
|
-
},
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
export default GroupedItem;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
import { GroupedItem } from './GroupedItem';
|
|
5
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
-
|
|
7
|
-
interface GroupedSectionItem {
|
|
8
|
-
id: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
iconColor?: string;
|
|
11
|
-
title: string;
|
|
12
|
-
subtitle?: string;
|
|
13
|
-
onPress?: () => void;
|
|
14
|
-
onLongPress?: () => void;
|
|
15
|
-
showChevron?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
selected?: boolean;
|
|
18
|
-
customContent?: React.ReactNode;
|
|
19
|
-
customIcon?: React.ReactNode;
|
|
20
|
-
multiRow?: boolean;
|
|
21
|
-
dense?: boolean;
|
|
22
|
-
customContentBelow?: React.ReactNode;
|
|
23
|
-
theme?: string;
|
|
24
|
-
/** Allow additional properties for extensibility */
|
|
25
|
-
[key: string]: unknown;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface GroupedSectionProps {
|
|
29
|
-
items: GroupedSectionItem[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const GroupedSectionComponent = ({ items }: GroupedSectionProps) => {
|
|
33
|
-
return (
|
|
34
|
-
<View style={{ width: '100%' }}>
|
|
35
|
-
{items.map((item, index) => (
|
|
36
|
-
<View key={`${item.id}-${index}`} style={{ marginBottom: index < items.length - 1 ? 4 : 0 }}>
|
|
37
|
-
<GroupedItem
|
|
38
|
-
icon={item.icon}
|
|
39
|
-
iconColor={item.iconColor}
|
|
40
|
-
title={item.title}
|
|
41
|
-
subtitle={item.subtitle}
|
|
42
|
-
onPress={item.onPress}
|
|
43
|
-
isFirst={index === 0}
|
|
44
|
-
isLast={index === items.length - 1}
|
|
45
|
-
showChevron={item.showChevron}
|
|
46
|
-
disabled={item.disabled}
|
|
47
|
-
customContent={item.customContent}
|
|
48
|
-
customIcon={item.customIcon}
|
|
49
|
-
/>
|
|
50
|
-
</View>
|
|
51
|
-
))}
|
|
52
|
-
</View>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
GroupedSectionComponent.displayName = 'GroupedSection';
|
|
57
|
-
|
|
58
|
-
export const GroupedSection = memo(GroupedSectionComponent);
|
|
59
|
-
|
|
60
|
-
export default GroupedSection;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { View, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import SectionTitle from './SectionTitle';
|
|
4
|
-
import { useColorScheme } from '../hooks/useColorScheme';
|
|
5
|
-
import { normalizeColorScheme } from '../utils/themeUtils';
|
|
6
|
-
|
|
7
|
-
interface SectionProps {
|
|
8
|
-
title?: string;
|
|
9
|
-
theme?: 'light' | 'dark';
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
isFirst?: boolean;
|
|
12
|
-
style?: StyleProp<ViewStyle>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Section: React.FC<SectionProps> = ({
|
|
16
|
-
title,
|
|
17
|
-
theme,
|
|
18
|
-
children,
|
|
19
|
-
isFirst = false,
|
|
20
|
-
style
|
|
21
|
-
}) => {
|
|
22
|
-
const colorScheme = normalizeColorScheme(useColorScheme(), theme);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<View style={[styles.section, isFirst && styles.firstSection, style]}>
|
|
26
|
-
{title && <SectionTitle title={title} theme={colorScheme} />}
|
|
27
|
-
{children}
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const styles = StyleSheet.create({
|
|
33
|
-
section: {
|
|
34
|
-
marginBottom: 10,
|
|
35
|
-
gap: 12,
|
|
36
|
-
},
|
|
37
|
-
firstSection: {
|
|
38
|
-
marginTop: 8,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export default Section;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { Text, StyleSheet, type StyleProp, type TextStyle } from 'react-native';
|
|
3
|
-
import { fontFamilies } from '../styles/fonts';
|
|
4
|
-
|
|
5
|
-
interface SectionTitleProps {
|
|
6
|
-
title: string;
|
|
7
|
-
theme?: 'light' | 'dark';
|
|
8
|
-
style?: StyleProp<TextStyle>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const SectionTitle: React.FC<SectionTitleProps> = ({ title, theme, style }) => {
|
|
12
|
-
return (
|
|
13
|
-
<Text className="text-foreground" style={[styles.sectionTitle, style]}>
|
|
14
|
-
{title}
|
|
15
|
-
</Text>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const styles = StyleSheet.create({
|
|
20
|
-
sectionTitle: {
|
|
21
|
-
fontSize: 16,
|
|
22
|
-
fontWeight: '600',
|
|
23
|
-
fontFamily: fontFamilies.interSemiBold,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export default SectionTitle;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, Switch, StyleSheet } from 'react-native';
|
|
3
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
4
|
-
|
|
5
|
-
export interface SettingRowProps {
|
|
6
|
-
title: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
value: boolean;
|
|
9
|
-
onValueChange: (value: boolean) => void;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
textColor?: string;
|
|
12
|
-
mutedTextColor?: string;
|
|
13
|
-
borderColor?: string;
|
|
14
|
-
/** Active color for the switch track */
|
|
15
|
-
activeColor?: string;
|
|
16
|
-
/** Inactive color for the switch track */
|
|
17
|
-
inactiveColor?: string;
|
|
18
|
-
/** Accessibility label for the switch */
|
|
19
|
-
accessibilityLabel?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Reusable setting row component with switch
|
|
24
|
-
* Extracted from PrivacySettingsScreen for reuse across settings screens
|
|
25
|
-
*/
|
|
26
|
-
const SettingRow: React.FC<SettingRowProps> = ({
|
|
27
|
-
title,
|
|
28
|
-
description,
|
|
29
|
-
value,
|
|
30
|
-
onValueChange,
|
|
31
|
-
disabled = false,
|
|
32
|
-
textColor,
|
|
33
|
-
mutedTextColor,
|
|
34
|
-
borderColor,
|
|
35
|
-
activeColor,
|
|
36
|
-
inactiveColor,
|
|
37
|
-
accessibilityLabel,
|
|
38
|
-
}) => {
|
|
39
|
-
const theme = useTheme();
|
|
40
|
-
|
|
41
|
-
const resolvedActiveColor = activeColor ?? theme.colors.primary;
|
|
42
|
-
const resolvedInactiveColor = inactiveColor ?? theme.colors.textTertiary;
|
|
43
|
-
const thumbOn = theme.colors.background;
|
|
44
|
-
const thumbOff = theme.colors.backgroundSecondary;
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<View
|
|
48
|
-
style={[styles.settingRow, borderColor ? { borderBottomColor: borderColor } : undefined]}
|
|
49
|
-
accessibilityRole="none"
|
|
50
|
-
>
|
|
51
|
-
<View style={styles.settingInfo}>
|
|
52
|
-
<Text
|
|
53
|
-
style={[styles.settingTitle, textColor ? { color: textColor } : undefined]}
|
|
54
|
-
accessibilityRole="text"
|
|
55
|
-
>
|
|
56
|
-
{title}
|
|
57
|
-
</Text>
|
|
58
|
-
{description && (
|
|
59
|
-
<Text
|
|
60
|
-
style={[styles.settingDescription, mutedTextColor ? { color: mutedTextColor } : undefined]}
|
|
61
|
-
accessibilityRole="text"
|
|
62
|
-
>
|
|
63
|
-
{description}
|
|
64
|
-
</Text>
|
|
65
|
-
)}
|
|
66
|
-
</View>
|
|
67
|
-
<Switch
|
|
68
|
-
value={value}
|
|
69
|
-
onValueChange={onValueChange}
|
|
70
|
-
disabled={disabled}
|
|
71
|
-
trackColor={{ false: resolvedInactiveColor, true: resolvedActiveColor }}
|
|
72
|
-
thumbColor={value ? thumbOn : thumbOff}
|
|
73
|
-
accessibilityRole="switch"
|
|
74
|
-
accessibilityLabel={accessibilityLabel || title}
|
|
75
|
-
accessibilityState={{ checked: value, disabled }}
|
|
76
|
-
accessibilityHint={description}
|
|
77
|
-
/>
|
|
78
|
-
</View>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const styles = StyleSheet.create({
|
|
83
|
-
settingRow: {
|
|
84
|
-
flexDirection: 'row',
|
|
85
|
-
justifyContent: 'space-between',
|
|
86
|
-
alignItems: 'center',
|
|
87
|
-
paddingVertical: 16,
|
|
88
|
-
borderBottomWidth: 1,
|
|
89
|
-
},
|
|
90
|
-
settingInfo: {
|
|
91
|
-
flex: 1,
|
|
92
|
-
marginRight: 16,
|
|
93
|
-
},
|
|
94
|
-
settingTitle: {
|
|
95
|
-
fontSize: 16,
|
|
96
|
-
fontWeight: '500',
|
|
97
|
-
marginBottom: 4,
|
|
98
|
-
},
|
|
99
|
-
settingDescription: {
|
|
100
|
-
fontSize: 14,
|
|
101
|
-
opacity: 0.7,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export default React.memo(SettingRow);
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { View, TouchableOpacity, Text, ActivityIndicator, StyleSheet, Platform } from 'react-native';
|
|
3
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
5
|
-
|
|
6
|
-
type IoniconsName = React.ComponentProps<typeof Ionicons>['name'];
|
|
7
|
-
|
|
8
|
-
interface ButtonConfig {
|
|
9
|
-
text: string;
|
|
10
|
-
onPress: () => void;
|
|
11
|
-
icon?: string;
|
|
12
|
-
variant?: 'primary' | 'secondary' | 'transparent';
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
testID?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface GroupedPillButtonColors {
|
|
19
|
-
primary: string;
|
|
20
|
-
secondary?: string;
|
|
21
|
-
border: string;
|
|
22
|
-
text: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface GroupedPillButtonsProps {
|
|
26
|
-
buttons: ButtonConfig[];
|
|
27
|
-
colors: GroupedPillButtonColors;
|
|
28
|
-
gap?: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
32
|
-
buttons,
|
|
33
|
-
colors,
|
|
34
|
-
gap = 8,
|
|
35
|
-
}) => {
|
|
36
|
-
const theme = useTheme();
|
|
37
|
-
|
|
38
|
-
const getButtonStyle = (button: ButtonConfig, index: number, totalButtons: number) => {
|
|
39
|
-
const baseStyle = {
|
|
40
|
-
flexDirection: 'row' as const,
|
|
41
|
-
alignItems: 'center' as const,
|
|
42
|
-
paddingVertical: 6,
|
|
43
|
-
paddingHorizontal: 12,
|
|
44
|
-
gap: 6,
|
|
45
|
-
minWidth: 70,
|
|
46
|
-
borderWidth: 1,
|
|
47
|
-
flexShrink: 0,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// Determine border radius based on position
|
|
51
|
-
let borderRadius = {
|
|
52
|
-
borderTopLeftRadius: 35,
|
|
53
|
-
borderBottomLeftRadius: 35,
|
|
54
|
-
borderTopRightRadius: 35,
|
|
55
|
-
borderBottomRightRadius: 35,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
if (totalButtons > 1) {
|
|
59
|
-
if (index === 0) {
|
|
60
|
-
// First button
|
|
61
|
-
borderRadius = {
|
|
62
|
-
borderTopLeftRadius: 35,
|
|
63
|
-
borderBottomLeftRadius: 35,
|
|
64
|
-
borderTopRightRadius: 12,
|
|
65
|
-
borderBottomRightRadius: 12,
|
|
66
|
-
};
|
|
67
|
-
} else if (index === totalButtons - 1) {
|
|
68
|
-
// Last button
|
|
69
|
-
borderRadius = {
|
|
70
|
-
borderTopLeftRadius: 12,
|
|
71
|
-
borderBottomLeftRadius: 12,
|
|
72
|
-
borderTopRightRadius: 35,
|
|
73
|
-
borderBottomRightRadius: 35,
|
|
74
|
-
};
|
|
75
|
-
} else {
|
|
76
|
-
// Middle button (if 3 buttons)
|
|
77
|
-
borderRadius = {
|
|
78
|
-
borderTopLeftRadius: 12,
|
|
79
|
-
borderBottomLeftRadius: 12,
|
|
80
|
-
borderTopRightRadius: 12,
|
|
81
|
-
borderBottomRightRadius: 12,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Determine colors based on variant
|
|
87
|
-
let backgroundColor = 'transparent';
|
|
88
|
-
let borderColor = colors.border;
|
|
89
|
-
const isDisabled = button.disabled || button.loading;
|
|
90
|
-
|
|
91
|
-
switch (button.variant) {
|
|
92
|
-
case 'primary':
|
|
93
|
-
backgroundColor = isDisabled ? theme.colors.borderLight : colors.primary;
|
|
94
|
-
borderColor = isDisabled ? theme.colors.borderLight : colors.primary;
|
|
95
|
-
break;
|
|
96
|
-
case 'secondary':
|
|
97
|
-
backgroundColor = isDisabled ? theme.colors.borderLight : (colors.secondary || colors.primary);
|
|
98
|
-
borderColor = isDisabled ? theme.colors.borderLight : (colors.secondary || colors.primary);
|
|
99
|
-
break;
|
|
100
|
-
default:
|
|
101
|
-
backgroundColor = 'transparent';
|
|
102
|
-
borderColor = isDisabled ? theme.colors.borderLight : colors.border;
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
...baseStyle,
|
|
108
|
-
...borderRadius,
|
|
109
|
-
backgroundColor,
|
|
110
|
-
borderColor,
|
|
111
|
-
opacity: isDisabled ? 0.6 : 1,
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const getTextStyle = (button: ButtonConfig, colors: GroupedPillButtonColors) => {
|
|
116
|
-
const baseTextStyle = {
|
|
117
|
-
fontSize: 15,
|
|
118
|
-
fontWeight: '600' as const,
|
|
119
|
-
// Avoid stretching that can cause wraps on native
|
|
120
|
-
flexShrink: 1,
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const isDisabled = button.disabled || button.loading;
|
|
124
|
-
let textColor = colors.text;
|
|
125
|
-
|
|
126
|
-
switch (button.variant) {
|
|
127
|
-
case 'primary':
|
|
128
|
-
case 'secondary':
|
|
129
|
-
textColor = isDisabled ? theme.colors.textTertiary : '#FFFFFF';
|
|
130
|
-
break;
|
|
131
|
-
default:
|
|
132
|
-
textColor = isDisabled ? theme.colors.textTertiary : colors.text;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return {
|
|
137
|
-
...baseTextStyle,
|
|
138
|
-
color: textColor,
|
|
139
|
-
...(Platform.OS === 'web' ? { whiteSpace: 'nowrap' as const } : null),
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const getIconColor = (button: ButtonConfig, colors: GroupedPillButtonColors) => {
|
|
144
|
-
const isDisabled = button.disabled || button.loading;
|
|
145
|
-
|
|
146
|
-
switch (button.variant) {
|
|
147
|
-
case 'primary':
|
|
148
|
-
case 'secondary':
|
|
149
|
-
return isDisabled ? theme.colors.textTertiary : '#FFFFFF';
|
|
150
|
-
default:
|
|
151
|
-
return isDisabled ? theme.colors.textTertiary : colors.text;
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const isBackButton = (button: ButtonConfig) => {
|
|
156
|
-
const text = typeof button.text === 'string' ? button.text.toLowerCase() : '';
|
|
157
|
-
return text.includes('back') ||
|
|
158
|
-
button.icon === 'arrow-back' ||
|
|
159
|
-
button.icon === 'chevron-back';
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
const renderButtonContent = (button: ButtonConfig, colors: GroupedPillButtonColors, index: number) => {
|
|
163
|
-
const iconColor = getIconColor(button, colors);
|
|
164
|
-
const isBack = isBackButton(button);
|
|
165
|
-
const isFirstButton = index === 0;
|
|
166
|
-
const isSingleButton = buttons.length === 1;
|
|
167
|
-
|
|
168
|
-
if (button.loading) {
|
|
169
|
-
return (
|
|
170
|
-
<ActivityIndicator
|
|
171
|
-
color={iconColor}
|
|
172
|
-
size="small"
|
|
173
|
-
/>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Auto-detect icon placement based on button order and type
|
|
178
|
-
if (isSingleButton) {
|
|
179
|
-
// Single button: icon on right
|
|
180
|
-
return (
|
|
181
|
-
<>
|
|
182
|
-
<Text style={getTextStyle(button, colors)} numberOfLines={1} ellipsizeMode="tail">
|
|
183
|
-
{button.text}
|
|
184
|
-
</Text>
|
|
185
|
-
{button.icon && (
|
|
186
|
-
<Ionicons
|
|
187
|
-
name={button.icon as IoniconsName}
|
|
188
|
-
size={16}
|
|
189
|
-
color={iconColor}
|
|
190
|
-
/>
|
|
191
|
-
)}
|
|
192
|
-
</>
|
|
193
|
-
);
|
|
194
|
-
}if (isFirstButton || isBack) {
|
|
195
|
-
// First button or back button: icon on left, text on right
|
|
196
|
-
return (
|
|
197
|
-
<>
|
|
198
|
-
{button.icon && (
|
|
199
|
-
<Ionicons
|
|
200
|
-
name={button.icon as IoniconsName}
|
|
201
|
-
size={16}
|
|
202
|
-
color={iconColor}
|
|
203
|
-
/>
|
|
204
|
-
)}
|
|
205
|
-
<Text style={getTextStyle(button, colors)} numberOfLines={1} ellipsizeMode="tail">
|
|
206
|
-
{button.text}
|
|
207
|
-
</Text>
|
|
208
|
-
</>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
// Second button or forward/action button: text on left, icon on right
|
|
212
|
-
return (
|
|
213
|
-
<>
|
|
214
|
-
<Text style={getTextStyle(button, colors)} numberOfLines={1} ellipsizeMode="tail">
|
|
215
|
-
{button.text}
|
|
216
|
-
</Text>
|
|
217
|
-
{button.icon && (
|
|
218
|
-
<Ionicons
|
|
219
|
-
name={button.icon as IoniconsName}
|
|
220
|
-
size={16}
|
|
221
|
-
color={iconColor}
|
|
222
|
-
/>
|
|
223
|
-
)}
|
|
224
|
-
</>
|
|
225
|
-
);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<View style={[styles.container, { gap }]}>
|
|
230
|
-
{buttons.map((button, index) => (
|
|
231
|
-
<TouchableOpacity
|
|
232
|
-
key={index}
|
|
233
|
-
style={getButtonStyle(button, index, buttons.length)}
|
|
234
|
-
onPress={button.onPress}
|
|
235
|
-
disabled={button.disabled || button.loading}
|
|
236
|
-
testID={button.testID}
|
|
237
|
-
>
|
|
238
|
-
{renderButtonContent(button, colors, index)}
|
|
239
|
-
</TouchableOpacity>
|
|
240
|
-
))}
|
|
241
|
-
</View>
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
const styles = StyleSheet.create({
|
|
246
|
-
container: {
|
|
247
|
-
flexDirection: 'row',
|
|
248
|
-
justifyContent: 'flex-end',
|
|
249
|
-
width: '100%',
|
|
250
|
-
},
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
export default GroupedPillButtons;
|