@oxyhq/services 6.9.26 → 6.9.28

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 (26) hide show
  1. package/lib/commonjs/ui/hooks/useThemeColors.js +19 -17
  2. package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -1
  3. package/lib/commonjs/ui/hooks/useThemeStyles.js +20 -51
  4. package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -1
  5. package/lib/commonjs/ui/screens/OxyAuthScreen.js +37 -40
  6. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  7. package/lib/module/ui/hooks/useThemeColors.js +18 -16
  8. package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
  9. package/lib/module/ui/hooks/useThemeStyles.js +18 -49
  10. package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
  11. package/lib/module/ui/screens/OxyAuthScreen.js +38 -41
  12. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  13. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts +13 -20
  14. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts.map +1 -1
  15. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts +5 -28
  16. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  18. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts +13 -20
  19. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts.map +1 -1
  20. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts +5 -28
  21. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts.map +1 -1
  22. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  23. package/package.json +2 -2
  24. package/src/ui/hooks/useThemeColors.ts +19 -18
  25. package/src/ui/hooks/useThemeStyles.ts +21 -56
  26. package/src/ui/screens/OxyAuthScreen.tsx +25 -31
@@ -20,11 +20,12 @@ import {
20
20
  StyleSheet,
21
21
  Linking,
22
22
  Platform,
23
- ActivityIndicator,
24
23
  } from 'react-native';
25
24
  import io, { type Socket } from 'socket.io-client';
26
25
  import type { BaseScreenProps } from '../types/navigation';
27
- import { useThemeColors } from '../styles';
26
+ import { useTheme } from '@oxyhq/bloom/theme';
27
+ import { Button } from '@oxyhq/bloom/button';
28
+ import { Loading } from '@oxyhq/bloom/loading';
28
29
  import { useOxy } from '../context/OxyContext';
29
30
  import QRCode from 'react-native-qrcode-svg';
30
31
  import OxyLogo from '../components/OxyLogo';
@@ -117,8 +118,17 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
117
118
  onAuthenticated,
118
119
  theme,
119
120
  }) => {
120
- const themeValue = (theme === 'light' || theme === 'dark') ? theme : 'light';
121
- const colors = useThemeColors(themeValue);
121
+ const bloomTheme = useTheme();
122
+ const colors = {
123
+ background: bloomTheme.colors.background,
124
+ text: bloomTheme.colors.text,
125
+ secondaryText: bloomTheme.colors.textSecondary,
126
+ primary: bloomTheme.colors.primary,
127
+ error: bloomTheme.colors.error,
128
+ border: bloomTheme.colors.border,
129
+ card: bloomTheme.colors.card,
130
+ inputBackground: bloomTheme.colors.backgroundSecondary,
131
+ };
122
132
  const { oxyServices, signIn, switchSession } = useOxy();
123
133
 
124
134
  const [authSession, setAuthSession] = useState<AuthSession | null>(null);
@@ -401,7 +411,7 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
401
411
  if (isLoading) {
402
412
  return (
403
413
  <View style={[styles.container, { backgroundColor: colors.background }]}>
404
- <ActivityIndicator size="large" color={colors.primary} />
414
+ <Loading size="large" />
405
415
  <Text style={[styles.loadingText, { color: colors.secondaryText }]}>
406
416
  Preparing sign in...
407
417
  </Text>
@@ -413,12 +423,9 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
413
423
  return (
414
424
  <View style={[styles.container, { backgroundColor: colors.background }]}>
415
425
  <Text style={[styles.errorText, { color: colors.error }]}>{error}</Text>
416
- <TouchableOpacity
417
- style={[styles.button, { backgroundColor: colors.primary }]}
418
- onPress={handleRefresh}
419
- >
420
- <Text style={styles.buttonText}>Try Again</Text>
421
- </TouchableOpacity>
426
+ <Button variant="primary" onPress={handleRefresh} style={{ width: '100%', borderRadius: 12 }}>
427
+ Try Again
428
+ </Button>
422
429
  </View>
423
430
  );
424
431
  }
@@ -457,18 +464,19 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
457
464
  </View>
458
465
 
459
466
  {/* Open Oxy Auth Button */}
460
- <TouchableOpacity
461
- style={[styles.button, { backgroundColor: colors.primary }]}
467
+ <Button
468
+ variant="primary"
462
469
  onPress={handleOpenAuth}
470
+ icon={<OxyLogo width={20} height={20} fillColor={colors.card} style={styles.buttonIcon} />}
471
+ style={{ width: '100%', borderRadius: 12 }}
463
472
  >
464
- <OxyLogo width={20} height={20} fillColor="white" style={styles.buttonIcon} />
465
- <Text style={styles.buttonText}>Open Oxy Auth</Text>
466
- </TouchableOpacity>
473
+ Open Oxy Auth
474
+ </Button>
467
475
 
468
476
  {/* Status */}
469
477
  {isWaiting && (
470
478
  <View style={styles.statusContainer}>
471
- <ActivityIndicator size="small" color={colors.primary} />
479
+ <Loading size="small" style={{ flex: undefined }} />
472
480
  <Text style={[styles.statusText, { color: colors.secondaryText }]}>
473
481
  Waiting for authorization...
474
482
  </Text>
@@ -547,23 +555,9 @@ const styles = StyleSheet.create({
547
555
  marginHorizontal: 16,
548
556
  fontSize: 14,
549
557
  },
550
- button: {
551
- flexDirection: 'row',
552
- alignItems: 'center',
553
- justifyContent: 'center',
554
- paddingVertical: 16,
555
- paddingHorizontal: 24,
556
- borderRadius: 12,
557
- width: '100%',
558
- },
559
558
  buttonIcon: {
560
559
  marginRight: 10,
561
560
  },
562
- buttonText: {
563
- color: 'white',
564
- fontSize: 16,
565
- fontWeight: '600',
566
- },
567
561
  statusContainer: {
568
562
  flexDirection: 'row',
569
563
  alignItems: 'center',