@oxyhq/services 5.4.3 → 5.4.5
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/README.md +14 -0
- package/lib/commonjs/assets/assets/illustrations/HighFive.tsx +41 -0
- package/lib/commonjs/assets/icons/OxyServices.js +1 -1
- package/lib/commonjs/assets/illustrations/HighFive.js +61 -0
- package/lib/commonjs/assets/illustrations/HighFive.js.map +1 -0
- package/lib/commonjs/core/index.js +24 -5
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +72 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/createAuth.js +95 -0
- package/lib/commonjs/node/createAuth.js.map +1 -0
- package/lib/commonjs/node/index.js +15 -6
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/ui/components/Avatar.js +3 -3
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +82 -34
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +1 -1
- package/lib/commonjs/ui/components/OxyLogo.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +146 -141
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +4 -4
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +2 -2
- package/lib/commonjs/ui/components/Section.js +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -1
- package/lib/commonjs/ui/components/icon/index.js +1 -1
- package/lib/commonjs/ui/components/index.js +12 -12
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +213 -0
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -0
- package/lib/commonjs/ui/components/internal/TextField.js +576 -0
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +12 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +13 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -0
- package/lib/commonjs/ui/hooks/useFollow.js +184 -0
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -0
- package/lib/commonjs/ui/index.js +44 -12
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +23 -18
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +21 -20
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +11 -10
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +8 -7
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +6 -5
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +12 -14
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +3 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js +1169 -0
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +3 -3
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +2 -2
- package/lib/commonjs/ui/screens/SignInScreen.js +183 -305
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +811 -712
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +8 -7
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/commonjs/ui/store/index.js +267 -0
- package/lib/commonjs/ui/store/index.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +2 -2
- package/lib/commonjs/ui/styles/theme.js +1 -1
- package/lib/commonjs/utils/index.js +1 -1
- package/lib/module/assets/assets/illustrations/HighFive.tsx +41 -0
- package/lib/module/assets/icons/OxyServices.js +1 -1
- package/lib/module/assets/icons/OxyServices.js.map +1 -1
- package/lib/module/assets/illustrations/HighFive.js +55 -0
- package/lib/module/assets/illustrations/HighFive.js.map +1 -0
- package/lib/module/core/index.js +24 -5
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +15 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/createAuth.js +90 -0
- package/lib/module/node/createAuth.js.map +1 -0
- package/lib/module/node/index.js +8 -4
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/ui/components/Avatar.js +2 -2
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +83 -35
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +1 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/OxyLogo.js +1 -1
- package/lib/module/ui/components/OxyLogo.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +143 -138
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +4 -4
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +2 -2
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/Section.js +1 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +1 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/icon/index.js +1 -1
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +12 -12
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +208 -0
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -0
- package/lib/module/ui/components/internal/TextField.js +571 -0
- package/lib/module/ui/components/internal/TextField.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +12 -2
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +4 -0
- package/lib/module/ui/hooks/index.js.map +1 -0
- package/lib/module/ui/hooks/useFollow.js +180 -0
- package/lib/module/ui/hooks/useFollow.js.map +1 -0
- package/lib/module/ui/index.js +21 -10
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +23 -18
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +9 -8
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +2 -2
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +11 -10
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +8 -7
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +6 -5
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +12 -14
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +3 -3
- package/lib/module/ui/screens/BillingManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +1164 -0
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +3 -3
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +2 -2
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +183 -305
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +810 -712
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +8 -7
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/store/index.js +255 -0
- package/lib/module/ui/store/index.js.map +1 -0
- package/lib/module/ui/styles/index.js +2 -2
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/theme.js +1 -1
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/assets/illustrations/HighFive.d.ts +9 -0
- package/lib/typescript/assets/illustrations/HighFive.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +16 -3
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/node/createAuth.d.ts +7 -0
- package/lib/typescript/node/createAuth.d.ts.map +1 -0
- package/lib/typescript/node/index.d.ts +2 -0
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/types/expo-vector-icons.d.ts +3 -0
- package/lib/typescript/types/express.d.ts +5 -0
- package/lib/typescript/types/react-redux.d.ts +5 -0
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts +18 -0
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts +25 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +2 -0
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useFollow.d.ts +43 -0
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +5 -0
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/store/index.d.ts +66 -0
- package/lib/typescript/ui/store/index.d.ts.map +1 -0
- package/package.json +10 -25
- package/src/assets/illustrations/HighFive.tsx +41 -0
- package/src/core/index.ts +88 -3
- package/src/index.ts +19 -3
- package/src/node/createAuth.ts +116 -0
- package/src/node/index.ts +4 -0
- package/src/types/expo-vector-icons.d.ts +3 -0
- package/src/types/express.d.ts +5 -0
- package/src/types/react-redux.d.ts +5 -0
- package/src/ui/components/FollowButton.tsx +114 -56
- package/src/ui/components/OxyProvider.tsx +136 -135
- package/src/ui/components/OxySignInButton.tsx +2 -2
- package/src/ui/components/internal/GroupedPillButtons.tsx +253 -0
- package/src/ui/components/internal/TextField.tsx +694 -0
- package/src/ui/context/OxyContext.tsx +12 -2
- package/src/ui/hooks/index.ts +1 -0
- package/src/ui/hooks/useFollow.ts +173 -0
- package/src/ui/index.ts +15 -2
- package/src/ui/navigation/OxyRouter.tsx +8 -3
- package/src/ui/screens/AccountCenterScreen.tsx +17 -15
- package/src/ui/screens/AccountOverviewScreen.tsx +25 -25
- package/src/ui/screens/AccountSettingsScreen.tsx +30 -30
- package/src/ui/screens/AccountSwitcherScreen.tsx +34 -33
- package/src/ui/screens/AppInfoScreen.tsx +153 -155
- package/src/ui/screens/FeedbackScreen.tsx +1042 -0
- package/src/ui/screens/SignInScreen.tsx +181 -224
- package/src/ui/screens/SignUpScreen.tsx +772 -608
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +4 -4
- package/src/ui/store/index.ts +245 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, TouchableOpacity, Text, ActivityIndicator, StyleSheet } from 'react-native';
|
|
5
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const GroupedPillButtons = ({
|
|
8
|
+
buttons,
|
|
9
|
+
colors,
|
|
10
|
+
gap = 8
|
|
11
|
+
}) => {
|
|
12
|
+
const getButtonStyle = (button, index, totalButtons) => {
|
|
13
|
+
const baseStyle = {
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
paddingVertical: 6,
|
|
17
|
+
paddingHorizontal: 12,
|
|
18
|
+
gap: 6,
|
|
19
|
+
minWidth: 70,
|
|
20
|
+
borderWidth: 1,
|
|
21
|
+
shadowOffset: {
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 2
|
|
24
|
+
},
|
|
25
|
+
shadowOpacity: 0.1,
|
|
26
|
+
shadowRadius: 4,
|
|
27
|
+
elevation: 2
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Determine border radius based on position
|
|
31
|
+
let borderRadius = {
|
|
32
|
+
borderTopLeftRadius: 35,
|
|
33
|
+
borderBottomLeftRadius: 35,
|
|
34
|
+
borderTopRightRadius: 35,
|
|
35
|
+
borderBottomRightRadius: 35
|
|
36
|
+
};
|
|
37
|
+
if (totalButtons > 1) {
|
|
38
|
+
if (index === 0) {
|
|
39
|
+
// First button
|
|
40
|
+
borderRadius = {
|
|
41
|
+
borderTopLeftRadius: 35,
|
|
42
|
+
borderBottomLeftRadius: 35,
|
|
43
|
+
borderTopRightRadius: 12,
|
|
44
|
+
borderBottomRightRadius: 12
|
|
45
|
+
};
|
|
46
|
+
} else if (index === totalButtons - 1) {
|
|
47
|
+
// Last button
|
|
48
|
+
borderRadius = {
|
|
49
|
+
borderTopLeftRadius: 12,
|
|
50
|
+
borderBottomLeftRadius: 12,
|
|
51
|
+
borderTopRightRadius: 35,
|
|
52
|
+
borderBottomRightRadius: 35
|
|
53
|
+
};
|
|
54
|
+
} else {
|
|
55
|
+
// Middle button (if 3 buttons)
|
|
56
|
+
borderRadius = {
|
|
57
|
+
borderTopLeftRadius: 12,
|
|
58
|
+
borderBottomLeftRadius: 12,
|
|
59
|
+
borderTopRightRadius: 12,
|
|
60
|
+
borderBottomRightRadius: 12
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Determine colors based on variant
|
|
66
|
+
let backgroundColor = 'transparent';
|
|
67
|
+
let borderColor = colors.border;
|
|
68
|
+
let shadowColor = colors.border;
|
|
69
|
+
let textColor = colors.text;
|
|
70
|
+
switch (button.variant) {
|
|
71
|
+
case 'primary':
|
|
72
|
+
backgroundColor = colors.primary;
|
|
73
|
+
borderColor = colors.primary;
|
|
74
|
+
shadowColor = colors.primary;
|
|
75
|
+
textColor = '#FFFFFF';
|
|
76
|
+
break;
|
|
77
|
+
case 'secondary':
|
|
78
|
+
backgroundColor = colors.secondary || colors.primary;
|
|
79
|
+
borderColor = colors.secondary || colors.primary;
|
|
80
|
+
shadowColor = colors.secondary || colors.primary;
|
|
81
|
+
textColor = '#FFFFFF';
|
|
82
|
+
break;
|
|
83
|
+
case 'transparent':
|
|
84
|
+
default:
|
|
85
|
+
backgroundColor = 'transparent';
|
|
86
|
+
borderColor = colors.border;
|
|
87
|
+
shadowColor = colors.border;
|
|
88
|
+
textColor = colors.text;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
...baseStyle,
|
|
93
|
+
...borderRadius,
|
|
94
|
+
backgroundColor,
|
|
95
|
+
borderColor,
|
|
96
|
+
shadowColor
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const getTextStyle = (button, colors) => {
|
|
100
|
+
const baseTextStyle = {
|
|
101
|
+
fontSize: 15,
|
|
102
|
+
fontWeight: '600',
|
|
103
|
+
flex: 1
|
|
104
|
+
};
|
|
105
|
+
let textColor = colors.text;
|
|
106
|
+
switch (button.variant) {
|
|
107
|
+
case 'primary':
|
|
108
|
+
case 'secondary':
|
|
109
|
+
textColor = '#FFFFFF';
|
|
110
|
+
break;
|
|
111
|
+
case 'transparent':
|
|
112
|
+
default:
|
|
113
|
+
textColor = colors.text;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
...baseTextStyle,
|
|
118
|
+
color: textColor
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
const getIconColor = (button, colors) => {
|
|
122
|
+
switch (button.variant) {
|
|
123
|
+
case 'primary':
|
|
124
|
+
case 'secondary':
|
|
125
|
+
return '#FFFFFF';
|
|
126
|
+
case 'transparent':
|
|
127
|
+
default:
|
|
128
|
+
return colors.text;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const isBackButton = button => {
|
|
132
|
+
return button.text.toLowerCase().includes('back') || button.icon === 'arrow-back' || button.icon === 'chevron-back';
|
|
133
|
+
};
|
|
134
|
+
const renderButtonContent = (button, colors, index) => {
|
|
135
|
+
const iconColor = getIconColor(button, colors);
|
|
136
|
+
const isBack = isBackButton(button);
|
|
137
|
+
const isFirstButton = index === 0;
|
|
138
|
+
const isSingleButton = buttons.length === 1;
|
|
139
|
+
if (button.loading) {
|
|
140
|
+
return /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
141
|
+
color: iconColor,
|
|
142
|
+
size: "small"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Auto-detect icon placement based on button order and type
|
|
147
|
+
if (isSingleButton) {
|
|
148
|
+
// Single button: icon on right
|
|
149
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
150
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
151
|
+
style: getTextStyle(button, colors),
|
|
152
|
+
children: button.text
|
|
153
|
+
}), button.icon && /*#__PURE__*/_jsx(Ionicons, {
|
|
154
|
+
name: button.icon,
|
|
155
|
+
size: 16,
|
|
156
|
+
color: iconColor
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
} else if (isFirstButton || isBack) {
|
|
160
|
+
// First button or back button: icon on left, text on right
|
|
161
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
162
|
+
children: [button.icon && /*#__PURE__*/_jsx(Ionicons, {
|
|
163
|
+
name: button.icon,
|
|
164
|
+
size: 16,
|
|
165
|
+
color: iconColor
|
|
166
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
167
|
+
style: getTextStyle(button, colors),
|
|
168
|
+
children: button.text
|
|
169
|
+
})]
|
|
170
|
+
});
|
|
171
|
+
} else {
|
|
172
|
+
// Second button or forward/action button: text on left, icon on right
|
|
173
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
174
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
175
|
+
style: getTextStyle(button, colors),
|
|
176
|
+
children: button.text
|
|
177
|
+
}), button.icon && /*#__PURE__*/_jsx(Ionicons, {
|
|
178
|
+
name: button.icon,
|
|
179
|
+
size: 16,
|
|
180
|
+
color: iconColor
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
return /*#__PURE__*/_jsx(View, {
|
|
186
|
+
style: [styles.container, {
|
|
187
|
+
gap
|
|
188
|
+
}],
|
|
189
|
+
children: buttons.map((button, index) => /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
190
|
+
style: getButtonStyle(button, index, buttons.length),
|
|
191
|
+
onPress: button.onPress,
|
|
192
|
+
disabled: button.disabled || button.loading,
|
|
193
|
+
testID: button.testID,
|
|
194
|
+
children: renderButtonContent(button, colors, index)
|
|
195
|
+
}, index))
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const styles = StyleSheet.create({
|
|
199
|
+
container: {
|
|
200
|
+
flexDirection: 'row',
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
marginTop: 16,
|
|
203
|
+
marginBottom: 8,
|
|
204
|
+
width: '100%'
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
export default GroupedPillButtons;
|
|
208
|
+
//# sourceMappingURL=GroupedPillButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","TouchableOpacity","Text","ActivityIndicator","StyleSheet","Ionicons","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","GroupedPillButtons","buttons","colors","gap","getButtonStyle","button","index","totalButtons","baseStyle","flexDirection","alignItems","paddingVertical","paddingHorizontal","minWidth","borderWidth","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderRadius","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","backgroundColor","borderColor","border","shadowColor","textColor","text","variant","primary","secondary","getTextStyle","baseTextStyle","fontSize","fontWeight","flex","color","getIconColor","isBackButton","toLowerCase","includes","icon","renderButtonContent","iconColor","isBack","isFirstButton","isSingleButton","length","loading","size","children","style","name","styles","container","map","onPress","disabled","testID","create","justifyContent","marginTop","marginBottom"],"sourceRoot":"../../../../../src","sources":["ui/components/internal/GroupedPillButtons.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,UAAU,QAAQ,cAAc;AAC1F,SAASC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAkB9C,MAAMC,kBAAqD,GAAGA,CAAC;EAC3DC,OAAO;EACPC,MAAM;EACNC,GAAG,GAAG;AACV,CAAC,KAAK;EACF,MAAMC,cAAc,GAAGA,CAACC,MAAoB,EAAEC,KAAa,EAAEC,YAAoB,KAAK;IAClF,MAAMC,SAAS,GAAG;MACdC,aAAa,EAAE,KAAc;MAC7BC,UAAU,EAAE,QAAiB;MAC7BC,eAAe,EAAE,CAAC;MAClBC,iBAAiB,EAAE,EAAE;MACrBT,GAAG,EAAE,CAAC;MACNU,QAAQ,EAAE,EAAE;MACZC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE;QACVC,KAAK,EAAE,CAAC;QACRC,MAAM,EAAE;MACZ,CAAC;MACDC,aAAa,EAAE,GAAG;MAClBC,YAAY,EAAE,CAAC;MACfC,SAAS,EAAE;IACf,CAAC;;IAED;IACA,IAAIC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