@oxyhq/services 6.9.25 → 6.9.27

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.
Files changed (129) hide show
  1. package/lib/commonjs/ui/components/BottomSheet.js +15 -19
  2. package/lib/commonjs/ui/components/BottomSheet.js.map +1 -1
  3. package/lib/commonjs/ui/components/BottomSheetRouter.js +6 -9
  4. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
  5. package/lib/commonjs/ui/components/Header.js +9 -12
  6. package/lib/commonjs/ui/components/Header.js.map +1 -1
  7. package/lib/commonjs/ui/components/SignInModal.js +24 -53
  8. package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
  9. package/lib/commonjs/ui/components/StepBasedScreen.js +20 -7
  10. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  11. package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -2
  12. package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
  13. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +32 -29
  14. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  15. package/lib/commonjs/ui/components/payment/paymentStyles.js +6 -6
  16. package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
  17. package/lib/commonjs/ui/constants/theme.js +3 -2
  18. package/lib/commonjs/ui/constants/theme.js.map +1 -1
  19. package/lib/commonjs/ui/hooks/useAuth.js +6 -1
  20. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  21. package/lib/commonjs/ui/hooks/useThemeColors.js +19 -17
  22. package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -1
  23. package/lib/commonjs/ui/hooks/useThemeStyles.js +20 -51
  24. package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useWebSSO.js +6 -1
  26. package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
  27. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -8
  28. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/OxyAuthScreen.js +37 -40
  30. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  31. package/lib/commonjs/ui/styles/authStyles.js +3 -3
  32. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  33. package/lib/commonjs/ui/styles/theme.js +45 -9
  34. package/lib/commonjs/ui/styles/theme.js.map +1 -1
  35. package/lib/module/ui/components/BottomSheet.js +15 -19
  36. package/lib/module/ui/components/BottomSheet.js.map +1 -1
  37. package/lib/module/ui/components/BottomSheetRouter.js +6 -9
  38. package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
  39. package/lib/module/ui/components/Header.js +9 -12
  40. package/lib/module/ui/components/Header.js.map +1 -1
  41. package/lib/module/ui/components/SignInModal.js +25 -54
  42. package/lib/module/ui/components/SignInModal.js.map +1 -1
  43. package/lib/module/ui/components/StepBasedScreen.js +21 -8
  44. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  45. package/lib/module/ui/components/feedback/feedbackStyles.js +2 -2
  46. package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
  47. package/lib/module/ui/components/modals/DeleteAccountModal.js +33 -30
  48. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  49. package/lib/module/ui/components/payment/paymentStyles.js +6 -6
  50. package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
  51. package/lib/module/ui/constants/theme.js +3 -2
  52. package/lib/module/ui/constants/theme.js.map +1 -1
  53. package/lib/module/ui/hooks/useAuth.js +6 -1
  54. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  55. package/lib/module/ui/hooks/useThemeColors.js +18 -16
  56. package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
  57. package/lib/module/ui/hooks/useThemeStyles.js +18 -49
  58. package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
  59. package/lib/module/ui/hooks/useWebSSO.js +6 -1
  60. package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
  61. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -8
  62. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  63. package/lib/module/ui/screens/OxyAuthScreen.js +38 -41
  64. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  65. package/lib/module/ui/styles/authStyles.js +3 -3
  66. package/lib/module/ui/styles/authStyles.js.map +1 -1
  67. package/lib/module/ui/styles/theme.js +46 -9
  68. package/lib/module/ui/styles/theme.js.map +1 -1
  69. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/ui/components/Header.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +0 -8
  75. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +2 -0
  77. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/ui/constants/theme.d.ts +3 -2
  79. package/lib/typescript/commonjs/ui/constants/theme.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts +13 -20
  82. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts +5 -28
  84. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/styles/theme.d.ts +8 -0
  89. package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
  90. package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +1 -1
  91. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
  92. package/lib/typescript/module/ui/components/Header.d.ts.map +1 -1
  93. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
  94. package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
  95. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +0 -8
  96. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  97. package/lib/typescript/module/ui/components/payment/types.d.ts +2 -0
  98. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  99. package/lib/typescript/module/ui/constants/theme.d.ts +3 -2
  100. package/lib/typescript/module/ui/constants/theme.d.ts.map +1 -1
  101. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  102. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts +13 -20
  103. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts.map +1 -1
  104. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts +5 -28
  105. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts.map +1 -1
  106. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +1 -1
  107. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  108. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/styles/theme.d.ts +8 -0
  110. package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
  111. package/package.json +1 -1
  112. package/src/ui/components/BottomSheet.tsx +12 -18
  113. package/src/ui/components/BottomSheetRouter.tsx +7 -9
  114. package/src/ui/components/Header.tsx +9 -12
  115. package/src/ui/components/SignInModal.tsx +17 -40
  116. package/src/ui/components/StepBasedScreen.tsx +22 -9
  117. package/src/ui/components/feedback/feedbackStyles.ts +2 -2
  118. package/src/ui/components/modals/DeleteAccountModal.tsx +25 -34
  119. package/src/ui/components/payment/paymentStyles.ts +6 -6
  120. package/src/ui/components/payment/types.ts +2 -0
  121. package/src/ui/constants/theme.ts +3 -2
  122. package/src/ui/hooks/useAuth.ts +4 -1
  123. package/src/ui/hooks/useThemeColors.ts +19 -18
  124. package/src/ui/hooks/useThemeStyles.ts +21 -56
  125. package/src/ui/hooks/useWebSSO.ts +4 -1
  126. package/src/ui/screens/AccountOverviewScreen.tsx +0 -8
  127. package/src/ui/screens/OxyAuthScreen.tsx +25 -31
  128. package/src/ui/styles/authStyles.ts +3 -3
  129. package/src/ui/styles/theme.ts +44 -10
@@ -4,8 +4,7 @@ import { useStore } from 'zustand';
4
4
  import type { RouteName } from '../navigation/routes';
5
5
  import { getScreenComponent, isValidRoute } from '../navigation/routes';
6
6
  import type { BaseScreenProps } from '../types/navigation';
7
- import { useColorScheme } from '../hooks/useColorScheme';
8
- import { Colors } from '../constants/theme';
7
+ import { useTheme } from '@oxyhq/bloom/theme';
9
8
  import BottomSheet, { type BottomSheetRef } from './BottomSheet';
10
9
  import {
11
10
  bottomSheetStore,
@@ -65,7 +64,7 @@ class ScreenErrorBoundary extends React.Component<
65
64
  const errorStyles = StyleSheet.create({
66
65
  container: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24 },
67
66
  title: { fontSize: 16, fontWeight: '600', marginBottom: 8 },
68
- message: { fontSize: 13, color: '#888', textAlign: 'center' },
67
+ message: { fontSize: 13, textAlign: 'center' },
69
68
  });
70
69
 
71
70
  export interface BottomSheetRouterProps {
@@ -78,8 +77,7 @@ export interface BottomSheetRouterProps {
78
77
  */
79
78
  const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, onDismiss }) => {
80
79
  const sheetRef = useRef<BottomSheetRef>(null);
81
- const colorScheme = useColorScheme();
82
- const colors = Colors[colorScheme ?? 'light'];
80
+ const theme = useTheme();
83
81
  const prevScreenRef = useRef<RouteName | null>(null);
84
82
 
85
83
  const { currentScreen, screenProps, currentStep, isOpen } = useStore(bottomSheetStore);
@@ -190,9 +188,9 @@ const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, o
190
188
 
191
189
  const renderBackground = useCallback(
192
190
  (props: { style?: StyleProp<ViewStyle> }) => (
193
- <View style={[styles.background, { backgroundColor: colors.background }, props.style]} />
191
+ <View style={[styles.background, { backgroundColor: theme.colors.background }, props.style]} />
194
192
  ),
195
- [colors.background]
193
+ [theme.colors.background]
196
194
  );
197
195
 
198
196
  const screenPropsValue = useMemo((): BaseScreenProps & { scrollTo: typeof scrollTo } => {
@@ -202,14 +200,14 @@ const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, o
202
200
  goBack: handleGoBack,
203
201
  onClose: closeBottomSheet,
204
202
  onAuthenticated: closeBottomSheet,
205
- theme: colorScheme ?? 'light',
203
+ theme: theme.mode,
206
204
  currentScreen: currentScreen ?? undefined,
207
205
  initialStep: currentStep ?? (screenProps?.initialStep as number | undefined),
208
206
  onStepChange: handleStepChange,
209
207
  scrollTo,
210
208
  ...rest,
211
209
  };
212
- }, [navigate, handleGoBack, colorScheme, currentScreen, currentStep, screenProps, handleStepChange, scrollTo]);
210
+ }, [navigate, handleGoBack, theme.mode, currentScreen, currentStep, screenProps, handleStepChange, scrollTo]);
213
211
 
214
212
  return (
215
213
  <BottomSheet
@@ -14,9 +14,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
14
14
  import { Ionicons } from '@expo/vector-icons';
15
15
  import OxyIcon from './icon/OxyIcon';
16
16
  import { fontFamilies } from '../styles/fonts';
17
- import { useColorScheme } from '../hooks/useColorScheme';
18
- import { normalizeColorScheme } from '../utils/themeUtils';
19
- import { Colors } from '../constants/theme';
17
+ import { useTheme } from '@oxyhq/bloom/theme';
20
18
 
21
19
  // Calculate header height based on platform and variant
22
20
  export const getHeaderHeight = (variant: HeaderProps['variant'] = 'default', safeAreaTop = 0): number => {
@@ -77,10 +75,9 @@ const Header: React.FC<HeaderProps> = ({
77
75
  titleAlignment = 'left',
78
76
  scrollY,
79
77
  }) => {
80
- // Use theme colors directly from Colors constant (like Accounts sidebar)
81
- // Ensure colorScheme is always 'light' or 'dark' with proper fallback chain
82
- const colorScheme = normalizeColorScheme(useColorScheme(), theme);
83
- const colors = Colors[colorScheme];
78
+ const bloomTheme = useTheme();
79
+ const colors = bloomTheme.colors;
80
+ const colorScheme = bloomTheme.mode;
84
81
  const insets = useSafeAreaInsets();
85
82
  const headerHeight = getHeaderHeight(variant, insets.top);
86
83
 
@@ -168,12 +165,12 @@ const Header: React.FC<HeaderProps> = ({
168
165
  >
169
166
  {action.loading ? (
170
167
  <View style={styles.loadingContainer}>
171
- <View style={[styles.loadingDot, { backgroundColor: isTextAction ? '#FFFFFF' : colors.tint }]} />
172
- <View style={[styles.loadingDot, { backgroundColor: isTextAction ? '#FFFFFF' : colors.tint }]} />
173
- <View style={[styles.loadingDot, { backgroundColor: isTextAction ? '#FFFFFF' : colors.tint }]} />
168
+ <View style={[styles.loadingDot, { backgroundColor: isTextAction ? colors.card : colors.tint }]} />
169
+ <View style={[styles.loadingDot, { backgroundColor: isTextAction ? colors.card : colors.tint }]} />
170
+ <View style={[styles.loadingDot, { backgroundColor: isTextAction ? colors.card : colors.tint }]} />
174
171
  </View>
175
172
  ) : isTextAction ? (
176
- <Text style={[styles.actionText, { color: '#FFFFFF' }]}>
173
+ <Text style={[styles.actionText, { color: colors.card }]}>
177
174
  {action.text}
178
175
  </Text>
179
176
  ) : (
@@ -247,7 +244,7 @@ const Header: React.FC<HeaderProps> = ({
247
244
  {title}
248
245
  </Text>
249
246
  {subtitle ? (
250
- <Text style={[subtitleStyle, { color: colors.secondaryText }]}>
247
+ <Text style={[subtitleStyle, { color: colors.textSecondary }]}>
251
248
  {subtitle}
252
249
  </Text>
253
250
  ) : null}
@@ -17,7 +17,6 @@ import {
17
17
  StyleSheet,
18
18
  Modal,
19
19
  Dimensions,
20
- ActivityIndicator,
21
20
  Platform,
22
21
  Linking,
23
22
  } from 'react-native';
@@ -30,7 +29,9 @@ import Animated, {
30
29
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
31
30
  import io, { type Socket } from 'socket.io-client';
32
31
  import QRCode from 'react-native-qrcode-svg';
33
- import { useThemeColors } from '../hooks/useThemeColors';
32
+ import { useTheme } from '@oxyhq/bloom/theme';
33
+ import { Button } from '@oxyhq/bloom/button';
34
+ import { Loading } from '@oxyhq/bloom/loading';
34
35
  import { useOxy } from '../context/OxyContext';
35
36
  import OxyLogo from './OxyLogo';
36
37
  import { createDebugLogger } from '@oxyhq/core';
@@ -91,7 +92,7 @@ const SignInModal: React.FC = () => {
91
92
  const [isWaiting, setIsWaiting] = useState(false);
92
93
 
93
94
  const insets = useSafeAreaInsets();
94
- const colors = useThemeColors();
95
+ const theme = useTheme();
95
96
  const { oxyServices, switchSession } = useOxy();
96
97
 
97
98
  const socketRef = useRef<Socket | null>(null);
@@ -345,7 +346,7 @@ const SignInModal: React.FC = () => {
345
346
 
346
347
  return (
347
348
  <Modal visible={visible} transparent animationType="none" statusBarTranslucent onRequestClose={handleClose}>
348
- <Animated.View style={[styles.backdrop, backdropStyle]}>
349
+ <Animated.View style={[styles.backdrop, { backgroundColor: theme.colors.overlay }, backdropStyle]}>
349
350
  <TouchableOpacity style={StyleSheet.absoluteFill} onPress={handleClose} activeOpacity={1} />
350
351
 
351
352
  <Animated.View style={[styles.content, contentStyle, { paddingTop: insets.top + 20, paddingBottom: insets.bottom + 20 }]}>
@@ -357,28 +358,23 @@ const SignInModal: React.FC = () => {
357
358
  {/* Header */}
358
359
  <View style={styles.header}>
359
360
  <OxyLogo width={56} height={56} />
360
- <Text style={[styles.title, { color: colors.text }]}>Sign in with Oxy</Text>
361
- <Text style={[styles.subtitle, { color: colors.secondaryText }]}>
361
+ <Text style={[styles.title, { color: theme.colors.text }]}>Sign in with Oxy</Text>
362
+ <Text style={[styles.subtitle, { color: theme.colors.textSecondary }]}>
362
363
  Scan with Oxy Accounts app or use the button below
363
364
  </Text>
364
365
  </View>
365
366
 
366
367
  {isLoading ? (
367
368
  <View style={styles.loadingContainer}>
368
- <ActivityIndicator size="large" color={colors.tint} />
369
- <Text style={[styles.loadingText, { color: colors.secondaryText }]}>
369
+ <Loading size="large" />
370
+ <Text style={[styles.loadingText, { color: theme.colors.textSecondary }]}>
370
371
  Preparing sign in...
371
372
  </Text>
372
373
  </View>
373
374
  ) : error ? (
374
375
  <View style={styles.errorContainer}>
375
- <Text style={[styles.errorText, { color: '#EA4335' }]}>{error}</Text>
376
- <TouchableOpacity
377
- style={[styles.button, { backgroundColor: colors.tint }]}
378
- onPress={handleRefresh}
379
- >
380
- <Text style={styles.buttonText}>Try Again</Text>
381
- </TouchableOpacity>
376
+ <Text style={[styles.errorText, { color: theme.colors.error }]}>{error}</Text>
377
+ <Button onPress={handleRefresh}>Try Again</Button>
382
378
  </View>
383
379
  ) : (
384
380
  <>
@@ -392,7 +388,7 @@ const SignInModal: React.FC = () => {
392
388
  color="black"
393
389
  />
394
390
  ) : (
395
- <ActivityIndicator size="large" color="#d169e5" />
391
+ <Loading size="large" />
396
392
  )}
397
393
  </View>
398
394
 
@@ -404,18 +400,17 @@ const SignInModal: React.FC = () => {
404
400
  </View>
405
401
 
406
402
  {/* Open Auth Popup Button */}
407
- <TouchableOpacity
408
- style={[styles.button, { backgroundColor: '#d169e5' }]}
403
+ <Button
409
404
  onPress={handleOpenAuthPopup}
405
+ icon={<OxyLogo width={20} height={20} fillColor={theme.colors.card} />}
410
406
  >
411
- <OxyLogo width={20} height={20} fillColor="white" style={styles.buttonIcon} />
412
- <Text style={styles.buttonText}>Open Oxy Auth</Text>
413
- </TouchableOpacity>
407
+ Open Oxy Auth
408
+ </Button>
414
409
 
415
410
  {/* Status */}
416
411
  {isWaiting && (
417
412
  <View style={styles.statusContainer}>
418
- <ActivityIndicator size="small" color="white" />
413
+ <Loading size="small" />
419
414
  <Text style={styles.statusText}>
420
415
  Waiting for authorization...
421
416
  </Text>
@@ -432,7 +427,6 @@ const SignInModal: React.FC = () => {
432
427
  const styles = StyleSheet.create({
433
428
  backdrop: {
434
429
  flex: 1,
435
- backgroundColor: 'rgba(0, 0, 0, 0.85)',
436
430
  justifyContent: 'center',
437
431
  alignItems: 'center',
438
432
  },
@@ -494,23 +488,6 @@ const styles = StyleSheet.create({
494
488
  marginHorizontal: 16,
495
489
  fontSize: 14,
496
490
  },
497
- button: {
498
- flexDirection: 'row',
499
- alignItems: 'center',
500
- justifyContent: 'center',
501
- paddingVertical: 16,
502
- paddingHorizontal: 24,
503
- borderRadius: 12,
504
- width: '100%',
505
- },
506
- buttonIcon: {
507
- marginRight: 10,
508
- },
509
- buttonText: {
510
- color: 'white',
511
- fontSize: 16,
512
- fontWeight: '600',
513
- },
514
491
  statusContainer: {
515
492
  flexDirection: 'row',
516
493
  alignItems: 'center',
@@ -11,8 +11,9 @@ import Animated, {
11
11
  useAnimatedStyle,
12
12
  withTiming,
13
13
  } from 'react-native-reanimated';
14
- import { useThemeColors, createAuthStyles } from '../styles';
15
- import type { ThemeColors } from '../styles';
14
+ import { useTheme } from '@oxyhq/bloom/theme';
15
+ import type { ThemeColors } from '@oxyhq/bloom/theme';
16
+ import { createAuthStyles } from '../styles';
16
17
  import { fontFamilies } from '../styles/fonts';
17
18
  import type { BaseScreenProps, StepController } from '../types/navigation';
18
19
  import type { RouteName } from '../types/navigation';
@@ -136,13 +137,25 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
136
137
  // ========================================================================
137
138
  // Computed Values
138
139
  // ========================================================================
139
- // Narrow theme type with default value
140
- const themeValue = (theme === 'light' || theme === 'dark') ? theme : 'light';
141
- const themeString = typeof theme === 'string' ? theme : 'light';
142
- const colors = useThemeColors(themeValue);
140
+ const bloomTheme = useTheme();
141
+ const colors = bloomTheme.colors;
142
+ const themeString = bloomTheme.mode;
143
+ // Map bloom theme colors to AuthThemeColors shape for createAuthStyles
144
+ const authColors = useMemo(() => ({
145
+ text: colors.text,
146
+ background: colors.background,
147
+ inputBackground: colors.backgroundSecondary,
148
+ placeholder: colors.textTertiary,
149
+ primary: colors.primary,
150
+ border: colors.border,
151
+ error: colors.error,
152
+ success: colors.success,
153
+ warning: colors.warning,
154
+ secondaryText: colors.textSecondary,
155
+ }), [colors]);
143
156
  const insets = useSafeAreaInsets();
144
157
  const styles = useMemo(() => ({
145
- ...createAuthStyles(colors, themeString),
158
+ ...createAuthStyles(authColors, themeString),
146
159
  // Additional styles for step components
147
160
  modernHeader: {
148
161
  alignItems: 'flex-start' as const,
@@ -189,7 +202,7 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
189
202
  }),
190
203
  },
191
204
  buttonText: {
192
- color: '#FFFFFF',
205
+ color: colors.card,
193
206
  fontSize: 16,
194
207
  fontWeight: '600' as const,
195
208
  letterSpacing: 0.5,
@@ -223,7 +236,7 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
223
236
  marginHorizontal: 3,
224
237
  backgroundColor: colors.border,
225
238
  },
226
- }), [colors, themeString]);
239
+ }), [authColors, colors, themeString]);
227
240
 
228
241
  // ========================================================================
229
242
  // Animation Values (removed - router handles animations now)
@@ -130,7 +130,7 @@ export const createFeedbackStyles = (colors: FeedbackColors) => StyleSheet.creat
130
130
  }),
131
131
  },
132
132
  buttonText: {
133
- color: '#FFFFFF',
133
+ color: colors.background,
134
134
  fontSize: 16,
135
135
  fontWeight: '600',
136
136
  letterSpacing: 0.5,
@@ -193,7 +193,7 @@ export const createFeedbackStyles = (colors: FeedbackColors) => StyleSheet.creat
193
193
  borderRadius: 5,
194
194
  marginHorizontal: 6,
195
195
  borderWidth: 2,
196
- borderColor: '#fff',
196
+ borderColor: colors.background,
197
197
  ...Platform.select({
198
198
  web: {
199
199
  boxShadow: '0 1px 2px rgba(0,0,0,0.08)',
@@ -7,25 +7,18 @@ import {
7
7
  TouchableOpacity,
8
8
  StyleSheet,
9
9
  Modal,
10
- ActivityIndicator,
11
10
  KeyboardAvoidingView,
12
11
  Platform,
13
12
  } from 'react-native';
14
13
  import OxyIcon from '../icon/OxyIcon';
14
+ import { useTheme } from '@oxyhq/bloom/theme';
15
+ import { Loading } from '@oxyhq/bloom/loading';
15
16
 
16
17
  interface DeleteAccountModalProps {
17
18
  visible: boolean;
18
19
  username: string;
19
20
  onClose: () => void;
20
21
  onDelete: (password: string) => Promise<void>;
21
- colors: {
22
- background: string;
23
- text: string;
24
- secondaryText: string;
25
- border: string;
26
- danger: string;
27
- inputBackground: string;
28
- };
29
22
  t: (key: string, params?: Record<string, string>) => string | undefined;
30
23
  }
31
24
 
@@ -34,9 +27,9 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
34
27
  username,
35
28
  onClose,
36
29
  onDelete,
37
- colors,
38
30
  t,
39
31
  }) => {
32
+ const theme = useTheme();
40
33
  const [password, setPassword] = useState('');
41
34
  const [confirmUsername, setConfirmUsername] = useState('');
42
35
  const [isDeleting, setIsDeleting] = useState(false);
@@ -81,41 +74,41 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
81
74
  style={styles.overlay}
82
75
  >
83
76
  <TouchableOpacity
84
- style={styles.backdrop}
77
+ style={[styles.backdrop, { backgroundColor: theme.colors.overlay }]}
85
78
  activeOpacity={1}
86
79
  onPress={handleClose}
87
80
  />
88
- <View style={[styles.modal, { backgroundColor: colors.background }]}>
81
+ <View style={[styles.modal, { backgroundColor: theme.colors.background }]}>
89
82
  <View style={styles.header}>
90
- <OxyIcon name="alert" size={32} color={colors.danger} />
91
- <Text style={[styles.title, { color: colors.danger }]}>
83
+ <OxyIcon name="alert" size={32} color={theme.colors.error} />
84
+ <Text style={[styles.title, { color: theme.colors.error }]}>
92
85
  {t('deleteAccount.title') || 'Delete Account'}
93
86
  </Text>
94
87
  </View>
95
88
 
96
- <Text style={[styles.warning, { color: colors.text }]}>
89
+ <Text style={[styles.warning, { color: theme.colors.text }]}>
97
90
  {t('deleteAccount.warning') || 'This action cannot be undone. Your account and all associated data will be permanently deleted.'}
98
91
  </Text>
99
92
 
100
93
  {error && (
101
- <View style={[styles.errorContainer, { backgroundColor: `${colors.danger}20` }]}>
102
- <Text style={[styles.errorText, { color: colors.danger }]}>
94
+ <View style={[styles.errorContainer, { backgroundColor: `${theme.colors.error}20` }]}>
95
+ <Text style={[styles.errorText, { color: theme.colors.error }]}>
103
96
  {error}
104
97
  </Text>
105
98
  </View>
106
99
  )}
107
100
 
108
101
  <View style={styles.inputGroup}>
109
- <Text style={[styles.label, { color: colors.secondaryText }]}>
102
+ <Text style={[styles.label, { color: theme.colors.textSecondary }]}>
110
103
  {t('deleteAccount.passwordLabel') || 'Enter your password'}
111
104
  </Text>
112
- <View style={[styles.inputContainer, { borderColor: colors.border, backgroundColor: colors.inputBackground }]}>
105
+ <View style={[styles.inputContainer, { borderColor: theme.colors.border, backgroundColor: theme.colors.background }]}>
113
106
  <TextInput
114
- style={[styles.input, { color: colors.text }]}
107
+ style={[styles.input, { color: theme.colors.text }]}
115
108
  value={password}
116
109
  onChangeText={setPassword}
117
110
  placeholder={t('deleteAccount.passwordPlaceholder') || 'Password'}
118
- placeholderTextColor={colors.secondaryText}
111
+ placeholderTextColor={theme.colors.textSecondary}
119
112
  secureTextEntry={!showPassword}
120
113
  autoCapitalize="none"
121
114
  editable={!isDeleting}
@@ -127,14 +120,14 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
127
120
  <OxyIcon
128
121
  name={showPassword ? 'eye-off' : 'eye'}
129
122
  size={20}
130
- color={colors.secondaryText}
123
+ color={theme.colors.textSecondary}
131
124
  />
132
125
  </TouchableOpacity>
133
126
  </View>
134
127
  </View>
135
128
 
136
129
  <View style={styles.inputGroup}>
137
- <Text style={[styles.label, { color: colors.secondaryText }]}>
130
+ <Text style={[styles.label, { color: theme.colors.textSecondary }]}>
138
131
  {t('deleteAccount.confirmLabel', { username }) || `Type "${username}" to confirm`}
139
132
  </Text>
140
133
  <TextInput
@@ -142,15 +135,15 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
142
135
  styles.input,
143
136
  styles.confirmInput,
144
137
  {
145
- borderColor: confirmUsername === username ? '#34C759' : colors.border,
146
- backgroundColor: colors.inputBackground,
147
- color: colors.text,
138
+ borderColor: confirmUsername === username ? theme.colors.success : theme.colors.border,
139
+ backgroundColor: theme.colors.background,
140
+ color: theme.colors.text,
148
141
  },
149
142
  ]}
150
143
  value={confirmUsername}
151
144
  onChangeText={setConfirmUsername}
152
145
  placeholder={username}
153
- placeholderTextColor={colors.secondaryText}
146
+ placeholderTextColor={theme.colors.textSecondary}
154
147
  autoCapitalize="none"
155
148
  autoCorrect={false}
156
149
  editable={!isDeleting}
@@ -159,11 +152,11 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
159
152
 
160
153
  <View style={styles.buttons}>
161
154
  <TouchableOpacity
162
- style={[styles.button, styles.cancelButton, { borderColor: colors.border }]}
155
+ style={[styles.button, styles.cancelButton, { borderColor: theme.colors.border }]}
163
156
  onPress={handleClose}
164
157
  disabled={isDeleting}
165
158
  >
166
- <Text style={[styles.buttonText, { color: colors.text }]}>
159
+ <Text style={[styles.buttonText, { color: theme.colors.text }]}>
167
160
  {t('common.cancel') || 'Cancel'}
168
161
  </Text>
169
162
  </TouchableOpacity>
@@ -172,15 +165,15 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
172
165
  style={[
173
166
  styles.button,
174
167
  styles.deleteButton,
175
- { backgroundColor: isValid ? colors.danger : `${colors.danger}50` },
168
+ { backgroundColor: isValid ? theme.colors.error : `${theme.colors.error}50` },
176
169
  ]}
177
170
  onPress={handleDelete}
178
171
  disabled={!isValid || isDeleting}
179
172
  >
180
173
  {isDeleting ? (
181
- <ActivityIndicator color="#fff" size="small" />
174
+ <Loading size="small" />
182
175
  ) : (
183
- <Text style={styles.deleteButtonText}>
176
+ <Text style={[styles.deleteButtonText, { color: theme.colors.card }]}>
184
177
  {t('deleteAccount.confirm') || 'Delete Forever'}
185
178
  </Text>
186
179
  )}
@@ -200,7 +193,6 @@ const styles = StyleSheet.create({
200
193
  },
201
194
  backdrop: {
202
195
  ...StyleSheet.absoluteFillObject,
203
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
204
196
  },
205
197
  modal: {
206
198
  width: '90%',
@@ -288,7 +280,6 @@ const styles = StyleSheet.create({
288
280
  deleteButtonText: {
289
281
  fontSize: 16,
290
282
  fontWeight: '600',
291
- color: '#fff',
292
283
  },
293
284
  });
294
285
 
@@ -34,12 +34,12 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
34
34
  },
35
35
  errorText: {
36
36
  fontSize: 18,
37
- color: 'red',
37
+ color: colors.error ?? '#EF4444',
38
38
  marginBottom: 24,
39
39
  },
40
40
  // Summary card styles
41
41
  summaryCard: {
42
- backgroundColor: '#fff',
42
+ backgroundColor: colors.card ?? colors.background ?? '#fff',
43
43
  borderRadius: 16,
44
44
  padding: 24,
45
45
  marginBottom: 24,
@@ -131,7 +131,7 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
131
131
  },
132
132
  // Card payment styles
133
133
  cardPaymentCard: {
134
- backgroundColor: '#fff',
134
+ backgroundColor: colors.card ?? colors.background ?? '#fff',
135
135
  borderRadius: 16,
136
136
  padding: 24,
137
137
  marginBottom: 24,
@@ -200,7 +200,7 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
200
200
  },
201
201
  // Oxy Pay styles
202
202
  oxyPayCard: {
203
- backgroundColor: '#fff',
203
+ backgroundColor: colors.card ?? colors.background ?? '#fff',
204
204
  borderRadius: 16,
205
205
  padding: 24,
206
206
  marginBottom: 24,
@@ -247,7 +247,7 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
247
247
  },
248
248
  // FairCoin styles
249
249
  faircoinCard: {
250
- backgroundColor: '#fff',
250
+ backgroundColor: colors.card ?? colors.background ?? '#fff',
251
251
  borderRadius: 16,
252
252
  padding: 24,
253
253
  marginBottom: 24,
@@ -358,7 +358,7 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
358
358
  },
359
359
  // Success styles
360
360
  successCard: {
361
- backgroundColor: '#fff',
361
+ backgroundColor: colors.card ?? colors.background ?? '#fff',
362
362
  borderRadius: 16,
363
363
  padding: 24,
364
364
  marginBottom: 24,
@@ -41,5 +41,7 @@ export interface PaymentColors {
41
41
  secondaryText: string;
42
42
  border: string;
43
43
  success?: string;
44
+ error?: string;
44
45
  background?: string;
46
+ card?: string;
45
47
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3
- * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
2
+ * Below are the colors that are used in the app.
3
+ * These are kept as a compatibility layer prefer using bloom's useTheme() / useThemeColor()
4
+ * directly in new code. Existing screens still reference Colors.light / Colors.dark.
4
5
  */
5
6
 
6
7
  import { Platform } from 'react-native';
@@ -110,7 +110,10 @@ export function useAuth(): UseAuthReturn {
110
110
  // Check if we're on the identity provider itself
111
111
  // Only the IdP has local login forms - other apps are client apps
112
112
  const authWebUrl = oxyServices.config?.authWebUrl;
113
- const idpHostname = authWebUrl ? new URL(authWebUrl).hostname : 'auth.oxy.so';
113
+ let idpHostname = 'auth.oxy.so';
114
+ if (authWebUrl) {
115
+ try { idpHostname = new URL(authWebUrl).hostname; } catch { /* malformed URL, use default */ }
116
+ }
114
117
  const isIdentityProvider = isWebBrowser() &&
115
118
  window.location.hostname === idpHostname;
116
119
 
@@ -1,26 +1,27 @@
1
1
  import { useMemo } from 'react';
2
- import { useColorScheme } from './useColorScheme';
2
+ import { useTheme } from '@oxyhq/bloom/theme';
3
3
  import { Colors } from '../constants/theme';
4
4
 
5
5
  /**
6
- * Reusable hook to get theme colors based on current color scheme
7
- * Returns the Colors object for the current theme (light or dark)
8
- *
9
- * @returns Colors object for the current color scheme
10
- *
11
- * @example
12
- * ```tsx
13
- * const colors = useThemeColors();
14
- * <View style={{ backgroundColor: colors.background }}>
15
- * <Text style={{ color: colors.text }}>Hello</Text>
16
- * </View>
17
- * ```
6
+ * Returns theme colors based on current color scheme.
7
+ * Delegates to bloom's useTheme() and maps to the Colors shape
8
+ * for backward compatibility with existing screens.
18
9
  */
19
10
  export const useThemeColors = () => {
20
- const colorScheme = useColorScheme();
21
-
11
+ const theme = useTheme();
12
+
22
13
  return useMemo(() => {
23
- return Colors[colorScheme ?? 'light'];
24
- }, [colorScheme]);
14
+ const base = Colors[theme.isDark ? 'dark' : 'light'];
15
+ // Merge bloom colors over the local constants so bloom's
16
+ // dynamic colors (from scoped CSS vars) take precedence.
17
+ return {
18
+ ...base,
19
+ background: theme.colors.background,
20
+ text: theme.colors.text,
21
+ border: theme.colors.border,
22
+ tint: theme.colors.primary,
23
+ card: theme.colors.card,
24
+ primary: theme.colors.primary,
25
+ };
26
+ }, [theme]);
25
27
  };
26
-