@oxyhq/services 6.9.26 → 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.
- package/lib/commonjs/ui/hooks/useThemeColors.js +19 -17
- package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -1
- package/lib/commonjs/ui/hooks/useThemeStyles.js +20 -51
- package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +37 -40
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/hooks/useThemeColors.js +18 -16
- package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
- package/lib/module/ui/hooks/useThemeStyles.js +18 -49
- package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +38 -41
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts +13 -20
- package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts +5 -28
- package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useThemeColors.d.ts +13 -20
- package/lib/typescript/module/ui/hooks/useThemeColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts +5 -28
- package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/hooks/useThemeColors.ts +19 -18
- package/src/ui/hooks/useThemeStyles.ts +21 -56
- 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 {
|
|
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
|
|
121
|
-
const colors =
|
|
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
|
-
<
|
|
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
|
-
<
|
|
417
|
-
|
|
418
|
-
|
|
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
|
-
<
|
|
461
|
-
|
|
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
|
-
|
|
465
|
-
|
|
466
|
-
</TouchableOpacity>
|
|
473
|
+
Open Oxy Auth
|
|
474
|
+
</Button>
|
|
467
475
|
|
|
468
476
|
{/* Status */}
|
|
469
477
|
{isWaiting && (
|
|
470
478
|
<View style={styles.statusContainer}>
|
|
471
|
-
<
|
|
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',
|