@oxyhq/services 5.4.3 → 5.4.4
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 +2 -2
- package/lib/commonjs/index.js +22 -22
- 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 +3 -3
- 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 +2 -2
- 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 +1 -1
- package/lib/commonjs/ui/index.js +19 -11
- 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 +18 -18
- 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 +4 -4
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +5 -5
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/commonjs/ui/screens/AppInfoScreen.js +6 -6
- 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 +182 -304
- 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 +3 -3
- 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 +52 -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 +2 -2
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +10 -10
- 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 +3 -3
- 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 +2 -2
- 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 +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/index.js +12 -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 +5 -5
- 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 +4 -4
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +5 -5
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +6 -6
- 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 +182 -304
- 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 +3 -3
- 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 +44 -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/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/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/index.d.ts +2 -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/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 +19 -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/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/OxyProvider.tsx +136 -135
- package/src/ui/components/internal/GroupedPillButtons.tsx +253 -0
- package/src/ui/components/internal/TextField.tsx +694 -0
- package/src/ui/index.ts +6 -2
- package/src/ui/navigation/OxyRouter.tsx +8 -3
- package/src/ui/screens/FeedbackScreen.tsx +1042 -0
- package/src/ui/screens/SignInScreen.tsx +179 -222
- package/src/ui/screens/SignUpScreen.tsx +772 -608
- package/src/ui/store/index.ts +51 -0
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
4
|
-
import { View, Text,
|
|
5
|
-
import { useOxy } from
|
|
6
|
-
import { useThemeColors, createCommonStyles } from
|
|
7
|
-
import Avatar from
|
|
4
|
+
import { View, Text, StyleSheet, Platform, KeyboardAvoidingView, ScrollView, Animated, StatusBar } from 'react-native';
|
|
5
|
+
import { useOxy } from '../context/OxyContext';
|
|
6
|
+
import { useThemeColors, createCommonStyles } from '../styles';
|
|
7
|
+
import Avatar from '../components/Avatar';
|
|
8
8
|
import { Ionicons } from '@expo/vector-icons';
|
|
9
|
-
import
|
|
10
|
-
import { toast } from
|
|
11
|
-
import
|
|
9
|
+
import HighFive from '../../assets/illustrations/HighFive';
|
|
10
|
+
import { toast } from '../../lib/sonner';
|
|
11
|
+
import GroupedPillButtons from '../components/internal/GroupedPillButtons';
|
|
12
|
+
import TextField from '../components/internal/TextField';
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
14
|
const SignInScreen = ({
|
|
13
15
|
navigate,
|
|
14
16
|
goBack,
|
|
17
|
+
onAuthenticated,
|
|
15
18
|
theme
|
|
16
19
|
}) => {
|
|
17
20
|
// Form data states
|
|
@@ -266,42 +269,39 @@ const SignInScreen = ({
|
|
|
266
269
|
animateTransition(currentStep - 1);
|
|
267
270
|
}
|
|
268
271
|
}, [currentStep, progressAnim, animateTransition]);
|
|
269
|
-
|
|
272
|
+
|
|
273
|
+
// Custom next handlers for validation
|
|
274
|
+
const handleUsernameContinue = useCallback(() => {
|
|
270
275
|
if (!username) {
|
|
271
|
-
toast.error('Please enter your username');
|
|
276
|
+
toast.error('Please enter your username.');
|
|
272
277
|
return;
|
|
273
278
|
}
|
|
274
|
-
if (validationStatus
|
|
275
|
-
|
|
276
|
-
if (!errorMessage) {
|
|
277
|
-
toast.error('Please enter a valid username');
|
|
278
|
-
}
|
|
279
|
+
if (validationStatus !== 'valid' || !userProfile) {
|
|
280
|
+
toast.error('Please enter a valid username.');
|
|
279
281
|
return;
|
|
280
282
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
+
setErrorMessage('');
|
|
284
|
+
nextStep();
|
|
285
|
+
}, [username, validationStatus, userProfile, setErrorMessage, nextStep]);
|
|
286
|
+
const handleSignIn = useCallback(async () => {
|
|
287
|
+
if (!password) {
|
|
288
|
+
toast.error('Please enter your password.');
|
|
283
289
|
return;
|
|
284
290
|
}
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
nextStep();
|
|
288
|
-
} else {
|
|
289
|
-
toast.error('Please enter a valid username');
|
|
290
|
-
}
|
|
291
|
-
}, [username, validationStatus, userProfile, errorMessage, nextStep]);
|
|
292
|
-
const handleLogin = useCallback(async () => {
|
|
293
|
-
if (!username || !password) {
|
|
294
|
-
toast.error('Please enter both username and password');
|
|
291
|
+
if (!username || !userProfile) {
|
|
292
|
+
toast.error('Please enter a valid username first.');
|
|
295
293
|
return;
|
|
296
294
|
}
|
|
297
295
|
try {
|
|
298
296
|
setErrorMessage('');
|
|
299
|
-
await login(username, password);
|
|
300
|
-
|
|
297
|
+
const user = await login(username, password);
|
|
298
|
+
if (onAuthenticated) {
|
|
299
|
+
onAuthenticated(user);
|
|
300
|
+
}
|
|
301
301
|
} catch (error) {
|
|
302
302
|
toast.error(error.message || 'Login failed');
|
|
303
303
|
}
|
|
304
|
-
}, [username, password, login]);
|
|
304
|
+
}, [username, password, login, onAuthenticated, setErrorMessage, userProfile]);
|
|
305
305
|
|
|
306
306
|
// Memoized step components
|
|
307
307
|
const renderUsernameStep = useMemo(() => /*#__PURE__*/_jsxs(Animated.View, {
|
|
@@ -313,109 +313,16 @@ const SignInScreen = ({
|
|
|
313
313
|
scale: scaleAnim
|
|
314
314
|
}]
|
|
315
315
|
}],
|
|
316
|
-
children: [/*#__PURE__*/_jsx(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
width: 280,
|
|
320
|
-
height: 160,
|
|
321
|
-
viewBox: "0 0 280 160",
|
|
322
|
-
children: [/*#__PURE__*/_jsxs(Defs, {
|
|
323
|
-
children: [/*#__PURE__*/_jsxs(LinearGradient, {
|
|
324
|
-
id: "primaryGradient",
|
|
325
|
-
x1: "0%",
|
|
326
|
-
y1: "0%",
|
|
327
|
-
x2: "100%",
|
|
328
|
-
y2: "100%",
|
|
329
|
-
children: [/*#__PURE__*/_jsx(Stop, {
|
|
330
|
-
offset: "0%",
|
|
331
|
-
stopColor: colors.primary,
|
|
332
|
-
stopOpacity: "0.8"
|
|
333
|
-
}), /*#__PURE__*/_jsx(Stop, {
|
|
334
|
-
offset: "100%",
|
|
335
|
-
stopColor: colors.primary,
|
|
336
|
-
stopOpacity: "0.2"
|
|
337
|
-
})]
|
|
338
|
-
}), /*#__PURE__*/_jsxs(LinearGradient, {
|
|
339
|
-
id: "secondaryGradient",
|
|
340
|
-
x1: "0%",
|
|
341
|
-
y1: "0%",
|
|
342
|
-
x2: "100%",
|
|
343
|
-
y2: "100%",
|
|
344
|
-
children: [/*#__PURE__*/_jsx(Stop, {
|
|
345
|
-
offset: "0%",
|
|
346
|
-
stopColor: colors.primary,
|
|
347
|
-
stopOpacity: "0.1"
|
|
348
|
-
}), /*#__PURE__*/_jsx(Stop, {
|
|
349
|
-
offset: "100%",
|
|
350
|
-
stopColor: colors.primary,
|
|
351
|
-
stopOpacity: "0.3"
|
|
352
|
-
})]
|
|
353
|
-
})]
|
|
354
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
355
|
-
cx: "80",
|
|
356
|
-
cy: "80",
|
|
357
|
-
r: "45",
|
|
358
|
-
fill: "url(#primaryGradient)"
|
|
359
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
360
|
-
cx: "200",
|
|
361
|
-
cy: "80",
|
|
362
|
-
r: "35",
|
|
363
|
-
fill: "url(#secondaryGradient)"
|
|
364
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
365
|
-
d: "M40 120 Q80 40 140 80 Q200 120 240 60",
|
|
366
|
-
stroke: colors.primary,
|
|
367
|
-
strokeWidth: "4",
|
|
368
|
-
fill: "none",
|
|
369
|
-
strokeLinecap: "round"
|
|
370
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
371
|
-
cx: "60",
|
|
372
|
-
cy: "50",
|
|
373
|
-
r: "8",
|
|
374
|
-
fill: colors.primary,
|
|
375
|
-
opacity: "0.6"
|
|
376
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
377
|
-
cx: "220",
|
|
378
|
-
cy: "120",
|
|
379
|
-
r: "6",
|
|
380
|
-
fill: colors.primary,
|
|
381
|
-
opacity: "0.4"
|
|
382
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
383
|
-
cx: "250",
|
|
384
|
-
cy: "40",
|
|
385
|
-
r: "4",
|
|
386
|
-
fill: colors.primary,
|
|
387
|
-
opacity: "0.8"
|
|
388
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
389
|
-
cx: "140",
|
|
390
|
-
cy: "80",
|
|
391
|
-
r: "25",
|
|
392
|
-
fill: colors.background,
|
|
393
|
-
opacity: "0.9"
|
|
394
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
395
|
-
cx: "135",
|
|
396
|
-
cy: "75",
|
|
397
|
-
r: "3",
|
|
398
|
-
fill: colors.primary
|
|
399
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
400
|
-
cx: "145",
|
|
401
|
-
cy: "75",
|
|
402
|
-
r: "3",
|
|
403
|
-
fill: colors.primary
|
|
404
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
405
|
-
d: "M132 85 Q140 92 148 85",
|
|
406
|
-
stroke: colors.primary,
|
|
407
|
-
strokeWidth: "2",
|
|
408
|
-
fill: "none",
|
|
409
|
-
strokeLinecap: "round"
|
|
410
|
-
})]
|
|
411
|
-
})
|
|
316
|
+
children: [/*#__PURE__*/_jsx(HighFive, {
|
|
317
|
+
width: 100,
|
|
318
|
+
height: 100
|
|
412
319
|
}), /*#__PURE__*/_jsxs(View, {
|
|
413
320
|
style: styles.modernHeader,
|
|
414
321
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
415
322
|
style: [styles.modernTitle, {
|
|
416
323
|
color: colors.text
|
|
417
324
|
}],
|
|
418
|
-
children: isAddAccountMode ? 'Add Account' : '
|
|
325
|
+
children: isAddAccountMode ? 'Add Another Account' : 'Sign In'
|
|
419
326
|
}), /*#__PURE__*/_jsx(Text, {
|
|
420
327
|
style: [styles.modernSubtitle, {
|
|
421
328
|
color: colors.secondaryText
|
|
@@ -455,118 +362,129 @@ const SignInScreen = ({
|
|
|
455
362
|
}],
|
|
456
363
|
children: errorMessage
|
|
457
364
|
})]
|
|
458
|
-
}) : null, /*#__PURE__*/
|
|
365
|
+
}) : null, /*#__PURE__*/_jsx(Animated.View, {
|
|
459
366
|
style: [styles.modernInputContainer, {
|
|
460
367
|
transform: [{
|
|
461
368
|
scale: inputScaleAnim
|
|
462
369
|
}]
|
|
463
370
|
}],
|
|
464
|
-
children:
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
style: styles.validationIndicator
|
|
499
|
-
})]
|
|
500
|
-
}), validationStatus === 'valid' && userProfile && /*#__PURE__*/_jsxs(View, {
|
|
501
|
-
style: [styles.validationSuccessCard, {
|
|
502
|
-
backgroundColor: colors.success + '15'
|
|
503
|
-
}],
|
|
504
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
371
|
+
children: /*#__PURE__*/_jsx(TextField, {
|
|
372
|
+
label: "Username",
|
|
373
|
+
icon: "person-outline",
|
|
374
|
+
value: username,
|
|
375
|
+
onChangeText: handleUsernameChange,
|
|
376
|
+
onFocus: handleInputFocus,
|
|
377
|
+
onBlur: handleInputBlur,
|
|
378
|
+
autoCapitalize: "none",
|
|
379
|
+
autoCorrect: false,
|
|
380
|
+
testID: "username-input",
|
|
381
|
+
colors: colors,
|
|
382
|
+
variant: "filled",
|
|
383
|
+
error: validationStatus === 'invalid' && username.length >= 3 ? 'Username not found' : undefined,
|
|
384
|
+
loading: validationStatus === 'validating',
|
|
385
|
+
success: validationStatus === 'valid'
|
|
386
|
+
})
|
|
387
|
+
}), validationStatus === 'valid' && userProfile && /*#__PURE__*/_jsxs(View, {
|
|
388
|
+
style: [styles.validationSuccessCard, {
|
|
389
|
+
backgroundColor: colors.success + '10',
|
|
390
|
+
borderWidth: 1,
|
|
391
|
+
borderColor: colors.success + '30',
|
|
392
|
+
padding: 16
|
|
393
|
+
}],
|
|
394
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
395
|
+
style: {
|
|
396
|
+
width: 32,
|
|
397
|
+
height: 32,
|
|
398
|
+
borderRadius: 16,
|
|
399
|
+
backgroundColor: colors.success + '20',
|
|
400
|
+
justifyContent: 'center',
|
|
401
|
+
alignItems: 'center',
|
|
402
|
+
marginRight: 12
|
|
403
|
+
},
|
|
404
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
505
405
|
name: "checkmark-circle",
|
|
506
406
|
size: 16,
|
|
507
407
|
color: colors.success
|
|
508
|
-
})
|
|
408
|
+
})
|
|
409
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
410
|
+
style: {
|
|
411
|
+
flex: 1
|
|
412
|
+
},
|
|
413
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
509
414
|
style: [styles.validationText, {
|
|
510
|
-
color: colors.success
|
|
415
|
+
color: colors.success,
|
|
416
|
+
fontWeight: '600',
|
|
417
|
+
marginBottom: 2
|
|
511
418
|
}],
|
|
512
|
-
children: ["
|
|
419
|
+
children: ["Welcome back, ", userProfile?.displayName || userProfile?.name || username, "!"]
|
|
420
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
421
|
+
style: [styles.validationText, {
|
|
422
|
+
color: colors.secondaryText,
|
|
423
|
+
fontSize: 11,
|
|
424
|
+
opacity: 0.8
|
|
425
|
+
}],
|
|
426
|
+
children: "Ready to continue where you left off"
|
|
513
427
|
})]
|
|
514
|
-
})
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
428
|
+
})]
|
|
429
|
+
}), validationStatus === 'invalid' && username.length >= 3 && /*#__PURE__*/_jsxs(View, {
|
|
430
|
+
style: [styles.validationErrorCard, {
|
|
431
|
+
backgroundColor: colors.error + '10',
|
|
432
|
+
borderWidth: 1,
|
|
433
|
+
borderColor: colors.error + '30',
|
|
434
|
+
padding: 16
|
|
435
|
+
}],
|
|
436
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
437
|
+
style: {
|
|
438
|
+
width: 32,
|
|
439
|
+
height: 32,
|
|
440
|
+
borderRadius: 16,
|
|
441
|
+
backgroundColor: colors.error + '20',
|
|
442
|
+
justifyContent: 'center',
|
|
443
|
+
alignItems: 'center',
|
|
444
|
+
marginRight: 12
|
|
445
|
+
},
|
|
446
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
519
447
|
name: "alert-circle",
|
|
520
448
|
size: 16,
|
|
521
449
|
color: colors.error
|
|
522
|
-
})
|
|
450
|
+
})
|
|
451
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
452
|
+
style: {
|
|
453
|
+
flex: 1
|
|
454
|
+
},
|
|
455
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
523
456
|
style: [styles.validationText, {
|
|
524
|
-
color: colors.error
|
|
457
|
+
color: colors.error,
|
|
458
|
+
fontWeight: '600',
|
|
459
|
+
marginBottom: 2
|
|
525
460
|
}],
|
|
526
461
|
children: "Username not found"
|
|
462
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
463
|
+
style: [styles.validationText, {
|
|
464
|
+
color: colors.secondaryText,
|
|
465
|
+
fontSize: 11,
|
|
466
|
+
opacity: 0.8
|
|
467
|
+
}],
|
|
468
|
+
children: "Check spelling or sign up"
|
|
527
469
|
})]
|
|
528
470
|
})]
|
|
529
|
-
}), /*#__PURE__*/_jsx(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
opacity: !username || validationStatus !== 'valid' ? 0.5 : 1,
|
|
533
|
-
shadowColor: colors.primary
|
|
534
|
-
}],
|
|
535
|
-
onPress: handleUsernameNext,
|
|
536
|
-
disabled: !username || validationStatus !== 'valid' || isValidating,
|
|
537
|
-
testID: "username-next-button",
|
|
538
|
-
children: isValidating ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
539
|
-
color: "#FFFFFF",
|
|
540
|
-
size: "small"
|
|
541
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
542
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
543
|
-
style: styles.modernButtonText,
|
|
544
|
-
children: "Continue"
|
|
545
|
-
}), /*#__PURE__*/_jsx(Ionicons, {
|
|
546
|
-
name: "arrow-forward",
|
|
547
|
-
size: 20,
|
|
548
|
-
color: "#FFFFFF",
|
|
549
|
-
style: styles.buttonIcon
|
|
550
|
-
})]
|
|
551
|
-
})
|
|
552
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
553
|
-
style: styles.footerTextContainer,
|
|
554
|
-
children: [/*#__PURE__*/_jsxs(Text, {
|
|
555
|
-
style: [styles.footerText, {
|
|
556
|
-
color: colors.secondaryText
|
|
557
|
-
}],
|
|
558
|
-
children: ["Don't have an account?", ' ']
|
|
559
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
471
|
+
}), /*#__PURE__*/_jsx(GroupedPillButtons, {
|
|
472
|
+
buttons: [{
|
|
473
|
+
text: 'Sign Up',
|
|
560
474
|
onPress: () => navigate('SignUp'),
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
475
|
+
icon: 'person-add',
|
|
476
|
+
variant: 'transparent'
|
|
477
|
+
}, {
|
|
478
|
+
text: 'Continue',
|
|
479
|
+
onPress: handleUsernameContinue,
|
|
480
|
+
icon: 'arrow-forward',
|
|
481
|
+
variant: 'primary',
|
|
482
|
+
loading: isValidating,
|
|
483
|
+
testID: 'username-next-button'
|
|
484
|
+
}],
|
|
485
|
+
colors: colors
|
|
568
486
|
})]
|
|
569
|
-
}), [fadeAnim, slideAnim, scaleAnim, colors, isAddAccountMode, user?.username, errorMessage, inputScaleAnim, isInputFocused, username, validationStatus, userProfile, isValidating, handleInputFocus, handleInputBlur, handleUsernameChange,
|
|
487
|
+
}), [fadeAnim, slideAnim, scaleAnim, colors, isAddAccountMode, user?.username, errorMessage, inputScaleAnim, isInputFocused, username, validationStatus, userProfile, isValidating, handleInputFocus, handleInputBlur, handleUsernameChange, handleUsernameContinue, navigate, styles]);
|
|
570
488
|
const renderPasswordStep = useMemo(() => /*#__PURE__*/_jsxs(Animated.View, {
|
|
571
489
|
style: [styles.stepContainer, {
|
|
572
490
|
opacity: fadeAnim,
|
|
@@ -640,79 +558,36 @@ const SignInScreen = ({
|
|
|
640
558
|
scale: inputScaleAnim
|
|
641
559
|
}]
|
|
642
560
|
}],
|
|
643
|
-
children: /*#__PURE__*/
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
placeholderTextColor: colors.placeholder,
|
|
658
|
-
value: password,
|
|
659
|
-
onChangeText: handlePasswordChange,
|
|
660
|
-
onFocus: handleInputFocus,
|
|
661
|
-
onBlur: handleInputBlur,
|
|
662
|
-
secureTextEntry: !showPassword,
|
|
663
|
-
autoCapitalize: "none",
|
|
664
|
-
testID: "password-input"
|
|
665
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
666
|
-
style: styles.passwordToggle,
|
|
667
|
-
onPress: () => setShowPassword(!showPassword),
|
|
668
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
669
|
-
name: showPassword ? "eye-off" : "eye",
|
|
670
|
-
size: 20,
|
|
671
|
-
color: colors.secondaryText
|
|
672
|
-
})
|
|
673
|
-
})]
|
|
561
|
+
children: /*#__PURE__*/_jsx(TextField, {
|
|
562
|
+
label: "Password",
|
|
563
|
+
icon: "lock-closed-outline",
|
|
564
|
+
value: password,
|
|
565
|
+
onChangeText: handlePasswordChange,
|
|
566
|
+
onFocus: handleInputFocus,
|
|
567
|
+
onBlur: handleInputBlur,
|
|
568
|
+
secureTextEntry: !showPassword,
|
|
569
|
+
autoCapitalize: "none",
|
|
570
|
+
autoCorrect: false,
|
|
571
|
+
testID: "password-input",
|
|
572
|
+
colors: colors,
|
|
573
|
+
variant: "filled",
|
|
574
|
+
error: errorMessage
|
|
674
575
|
})
|
|
675
|
-
}), /*#__PURE__*/_jsx(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
opacity: !password ? 0.5 : 1,
|
|
679
|
-
shadowColor: colors.primary
|
|
680
|
-
}],
|
|
681
|
-
onPress: handleLogin,
|
|
682
|
-
disabled: !password || isLoading,
|
|
683
|
-
testID: "login-button",
|
|
684
|
-
children: isLoading ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
685
|
-
color: "#FFFFFF",
|
|
686
|
-
size: "small"
|
|
687
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
688
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
689
|
-
style: styles.modernButtonText,
|
|
690
|
-
children: "Sign In"
|
|
691
|
-
}), /*#__PURE__*/_jsx(Ionicons, {
|
|
692
|
-
name: "log-in",
|
|
693
|
-
size: 20,
|
|
694
|
-
color: "#FFFFFF",
|
|
695
|
-
style: styles.buttonIcon
|
|
696
|
-
})]
|
|
697
|
-
})
|
|
698
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
699
|
-
style: styles.modernNavigationButtons,
|
|
700
|
-
children: /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
701
|
-
style: [styles.modernBackButton, {
|
|
702
|
-
borderColor: colors.border
|
|
703
|
-
}],
|
|
576
|
+
}), /*#__PURE__*/_jsx(GroupedPillButtons, {
|
|
577
|
+
buttons: [{
|
|
578
|
+
text: 'Back',
|
|
704
579
|
onPress: prevStep,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
580
|
+
icon: 'arrow-back',
|
|
581
|
+
variant: 'transparent'
|
|
582
|
+
}, {
|
|
583
|
+
text: 'Sign In',
|
|
584
|
+
onPress: handleSignIn,
|
|
585
|
+
icon: 'log-in',
|
|
586
|
+
variant: 'primary',
|
|
587
|
+
loading: isLoading,
|
|
588
|
+
testID: 'login-button'
|
|
589
|
+
}],
|
|
590
|
+
colors: colors
|
|
716
591
|
}), /*#__PURE__*/_jsxs(View, {
|
|
717
592
|
style: styles.securityNotice,
|
|
718
593
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
@@ -726,7 +601,7 @@ const SignInScreen = ({
|
|
|
726
601
|
children: "Your data is encrypted and secure"
|
|
727
602
|
})]
|
|
728
603
|
})]
|
|
729
|
-
}), [fadeAnim, slideAnim, scaleAnim, colors, userProfile, username, theme, logoAnim, errorMessage, inputScaleAnim, isInputFocused, password, showPassword, handleInputFocus, handleInputBlur, handlePasswordChange,
|
|
604
|
+
}), [fadeAnim, slideAnim, scaleAnim, colors, userProfile, username, theme, logoAnim, errorMessage, inputScaleAnim, isInputFocused, password, showPassword, handleInputFocus, handleInputBlur, handlePasswordChange, handleSignIn, isLoading, prevStep, styles]);
|
|
730
605
|
const renderCurrentStep = useCallback(() => {
|
|
731
606
|
switch (currentStep) {
|
|
732
607
|
case 0:
|
|
@@ -762,30 +637,25 @@ const createStyles = (colors, theme) => StyleSheet.create({
|
|
|
762
637
|
scrollContent: {
|
|
763
638
|
flexGrow: 1,
|
|
764
639
|
paddingHorizontal: 24,
|
|
765
|
-
paddingTop:
|
|
766
|
-
paddingBottom:
|
|
640
|
+
paddingTop: 4,
|
|
641
|
+
paddingBottom: 20
|
|
767
642
|
},
|
|
768
643
|
stepContainer: {
|
|
769
644
|
flex: 1,
|
|
770
|
-
justifyContent: '
|
|
771
|
-
alignItems: '
|
|
772
|
-
minHeight: 600
|
|
773
|
-
},
|
|
774
|
-
modernImageContainer: {
|
|
775
|
-
alignItems: 'center',
|
|
776
|
-
marginBottom: 40
|
|
645
|
+
justifyContent: 'flex-start',
|
|
646
|
+
alignItems: 'flex-start'
|
|
777
647
|
},
|
|
778
648
|
modernHeader: {
|
|
779
649
|
alignItems: 'flex-start',
|
|
780
650
|
width: '100%',
|
|
781
|
-
marginBottom:
|
|
651
|
+
marginBottom: 24
|
|
782
652
|
},
|
|
783
653
|
modernTitle: {
|
|
784
654
|
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
785
655
|
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
786
|
-
fontSize:
|
|
656
|
+
fontSize: 62,
|
|
787
657
|
lineHeight: 48,
|
|
788
|
-
marginBottom:
|
|
658
|
+
marginBottom: 18,
|
|
789
659
|
textAlign: 'left',
|
|
790
660
|
letterSpacing: -1
|
|
791
661
|
},
|
|
@@ -896,6 +766,12 @@ const createStyles = (colors, theme) => StyleSheet.create({
|
|
|
896
766
|
buttonIcon: {
|
|
897
767
|
marginLeft: 4
|
|
898
768
|
},
|
|
769
|
+
// Enhanced Label Styles
|
|
770
|
+
modernLabel: {
|
|
771
|
+
fontSize: 12,
|
|
772
|
+
fontWeight: '500',
|
|
773
|
+
marginBottom: 2
|
|
774
|
+
},
|
|
899
775
|
modernLinkText: {
|
|
900
776
|
fontSize: 14,
|
|
901
777
|
lineHeight: 20,
|
|
@@ -905,7 +781,7 @@ const createStyles = (colors, theme) => StyleSheet.create({
|
|
|
905
781
|
footerTextContainer: {
|
|
906
782
|
flexDirection: 'row',
|
|
907
783
|
justifyContent: 'center',
|
|
908
|
-
marginTop:
|
|
784
|
+
marginTop: 16
|
|
909
785
|
},
|
|
910
786
|
footerText: {
|
|
911
787
|
fontSize: 15
|
|
@@ -965,8 +841,10 @@ const createStyles = (colors, theme) => StyleSheet.create({
|
|
|
965
841
|
modernNavigationButtons: {
|
|
966
842
|
flexDirection: 'row',
|
|
967
843
|
justifyContent: 'center',
|
|
968
|
-
marginTop:
|
|
969
|
-
marginBottom:
|
|
844
|
+
marginTop: 16,
|
|
845
|
+
marginBottom: 8,
|
|
846
|
+
width: '100%',
|
|
847
|
+
gap: 8
|
|
970
848
|
},
|
|
971
849
|
modernBackButton: {
|
|
972
850
|
flexDirection: 'row',
|