@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.
- package/lib/commonjs/ui/components/BottomSheet.js +15 -19
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +6 -9
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +9 -12
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +24 -53
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +20 -7
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -2
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +32 -29
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +6 -6
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/constants/theme.js +3 -2
- package/lib/commonjs/ui/constants/theme.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +6 -1
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- 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/hooks/useWebSSO.js +6 -1
- package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -8
- package/lib/commonjs/ui/screens/AccountOverviewScreen.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/commonjs/ui/styles/authStyles.js +3 -3
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +45 -9
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/module/ui/components/BottomSheet.js +15 -19
- package/lib/module/ui/components/BottomSheet.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +6 -9
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/Header.js +9 -12
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +25 -54
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +21 -8
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +2 -2
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +33 -30
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +6 -6
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/constants/theme.js +3 -2
- package/lib/module/ui/constants/theme.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +6 -1
- package/lib/module/ui/hooks/useAuth.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/hooks/useWebSSO.js +6 -1
- package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +0 -8
- package/lib/module/ui/screens/AccountOverviewScreen.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/module/ui/styles/authStyles.js +3 -3
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/theme.js +46 -9
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +0 -8
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/constants/theme.d.ts +3 -2
- package/lib/typescript/commonjs/ui/constants/theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.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/hooks/useWebSSO.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/theme.d.ts +8 -0
- package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +0 -8
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/types.d.ts +2 -0
- package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/constants/theme.d.ts +3 -2
- package/lib/typescript/module/ui/constants/theme.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.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/hooks/useWebSSO.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/theme.d.ts +8 -0
- package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/components/BottomSheet.tsx +12 -18
- package/src/ui/components/BottomSheetRouter.tsx +7 -9
- package/src/ui/components/Header.tsx +9 -12
- package/src/ui/components/SignInModal.tsx +17 -40
- package/src/ui/components/StepBasedScreen.tsx +22 -9
- package/src/ui/components/feedback/feedbackStyles.ts +2 -2
- package/src/ui/components/modals/DeleteAccountModal.tsx +25 -34
- package/src/ui/components/payment/paymentStyles.ts +6 -6
- package/src/ui/components/payment/types.ts +2 -0
- package/src/ui/constants/theme.ts +3 -2
- package/src/ui/hooks/useAuth.ts +4 -1
- package/src/ui/hooks/useThemeColors.ts +19 -18
- package/src/ui/hooks/useThemeStyles.ts +21 -56
- package/src/ui/hooks/useWebSSO.ts +4 -1
- package/src/ui/screens/AccountOverviewScreen.tsx +0 -8
- package/src/ui/screens/OxyAuthScreen.tsx +25 -31
- package/src/ui/styles/authStyles.ts +3 -3
- 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 {
|
|
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,
|
|
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
|
|
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:
|
|
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,
|
|
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 {
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
const colorScheme =
|
|
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 ?
|
|
172
|
-
<View style={[styles.loadingDot, { backgroundColor: isTextAction ?
|
|
173
|
-
<View style={[styles.loadingDot, { backgroundColor: isTextAction ?
|
|
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:
|
|
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.
|
|
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 {
|
|
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
|
|
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.
|
|
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
|
-
<
|
|
369
|
-
<Text style={[styles.loadingText, { color: colors.
|
|
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:
|
|
376
|
-
<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
|
|
412
|
-
|
|
413
|
-
</TouchableOpacity>
|
|
407
|
+
Open Oxy Auth
|
|
408
|
+
</Button>
|
|
414
409
|
|
|
415
410
|
{/* Status */}
|
|
416
411
|
{isWaiting && (
|
|
417
412
|
<View style={styles.statusContainer}>
|
|
418
|
-
<
|
|
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 {
|
|
15
|
-
import type { ThemeColors } from '
|
|
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
|
-
|
|
140
|
-
const
|
|
141
|
-
const themeString =
|
|
142
|
-
|
|
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(
|
|
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:
|
|
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:
|
|
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:
|
|
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.
|
|
91
|
-
<Text style={[styles.title, { color: colors.
|
|
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.
|
|
102
|
-
<Text style={[styles.errorText, { color: colors.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 ?
|
|
146
|
-
backgroundColor: colors.
|
|
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.
|
|
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.
|
|
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
|
-
<
|
|
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: '
|
|
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,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Below are the colors that are used in the app.
|
|
3
|
-
*
|
|
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';
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -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
|
-
|
|
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 {
|
|
2
|
+
import { useTheme } from '@oxyhq/bloom/theme';
|
|
3
3
|
import { Colors } from '../constants/theme';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
21
|
-
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
|
|
22
13
|
return useMemo(() => {
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|