@oxyhq/services 10.2.0 → 10.2.2
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 +9 -13
- package/lib/commonjs/index.js +10 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenu.js +297 -226
- package/lib/commonjs/ui/components/AccountMenu.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +3 -1
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +11 -12
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/accountMenuRows.js +18 -30
- package/lib/commonjs/ui/components/accountMenuRows.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +57 -78
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +7 -13
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +10 -40
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceAccounts.js +285 -0
- package/lib/commonjs/ui/hooks/useDeviceAccounts.js.map +1 -0
- package/lib/commonjs/ui/hooks/useFollow.js +21 -7
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +5 -6
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +4 -5
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useWebSSO.js +1 -1
- package/lib/commonjs/ui/navigation/routes.js +7 -7
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +6 -7
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +18 -20
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +4 -4
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/{karma/KarmaAboutScreen.js → trust/TrustAboutScreen.js} +11 -11
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/{karma/KarmaCenterScreen.js → trust/TrustCenterScreen.js} +91 -41
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/{karma/KarmaFAQScreen.js → trust/TrustFAQScreen.js} +11 -11
- package/lib/commonjs/ui/screens/{karma/KarmaFAQScreen.js.map → trust/TrustFAQScreen.js.map} +1 -1
- package/lib/commonjs/ui/screens/{karma/KarmaLeaderboardScreen.js → trust/TrustLeaderboardScreen.js} +63 -42
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/{karma/KarmaRewardsScreen.js → trust/TrustRewardsScreen.js} +54 -54
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/{karma/KarmaRulesScreen.js → trust/TrustRulesScreen.js} +45 -16
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/trust/trustTier.js +23 -0
- package/lib/commonjs/ui/screens/trust/trustTier.js.map +1 -0
- package/lib/commonjs/utils/deviceFlowSignIn.js +12 -10
- package/lib/commonjs/utils/deviceFlowSignIn.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AccountMenu.js +297 -226
- package/lib/module/ui/components/AccountMenu.js.map +1 -1
- package/lib/module/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +3 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +1 -1
- package/lib/module/ui/components/SignInModal.js +11 -12
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/accountMenuRows.js +18 -30
- package/lib/module/ui/components/accountMenuRows.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +58 -79
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +7 -13
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +10 -40
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceAccounts.js +281 -0
- package/lib/module/ui/hooks/useDeviceAccounts.js.map +1 -0
- package/lib/module/ui/hooks/useFollow.js +21 -7
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +5 -6
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +4 -5
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useWebSSO.js +1 -1
- package/lib/module/ui/navigation/routes.js +7 -7
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +6 -7
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +18 -20
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +4 -4
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/{karma/KarmaAboutScreen.js → trust/TrustAboutScreen.js} +11 -11
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -0
- package/lib/module/ui/screens/{karma/KarmaCenterScreen.js → trust/TrustCenterScreen.js} +92 -42
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -0
- package/lib/module/ui/screens/{karma/KarmaFAQScreen.js → trust/TrustFAQScreen.js} +11 -11
- package/lib/module/ui/screens/{karma/KarmaFAQScreen.js.map → trust/TrustFAQScreen.js.map} +1 -1
- package/lib/module/ui/screens/{karma/KarmaLeaderboardScreen.js → trust/TrustLeaderboardScreen.js} +63 -42
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -0
- package/lib/module/ui/screens/{karma/KarmaRewardsScreen.js → trust/TrustRewardsScreen.js} +54 -54
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -0
- package/lib/module/ui/screens/{karma/KarmaRulesScreen.js → trust/TrustRulesScreen.js} +45 -16
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -0
- package/lib/module/ui/screens/trust/trustTier.js +19 -0
- package/lib/module/ui/screens/trust/trustTier.js.map +1 -0
- package/lib/module/utils/deviceFlowSignIn.js +13 -10
- package/lib/module/utils/deviceFlowSignIn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +30 -10
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts +19 -12
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +3 -3
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +1 -7
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +3 -7
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useDeviceAccounts.d.ts +133 -0
- package/lib/typescript/commonjs/ui/hooks/useDeviceAccounts.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/{karma/KarmaAboutScreen.d.ts.map → trust/TrustAboutScreen.d.ts.map} +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -0
- package/lib/typescript/{module/ui/screens/karma/KarmaFAQScreen.d.ts → commonjs/ui/screens/trust/TrustFAQScreen.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/{karma/KarmaRewardsScreen.d.ts.map → trust/TrustRewardsScreen.d.ts.map} +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +9 -0
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +1 -1
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +11 -9
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +30 -10
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts +19 -12
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +3 -3
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +1 -7
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +3 -7
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useDeviceAccounts.d.ts +133 -0
- package/lib/typescript/module/ui/hooks/useDeviceAccounts.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useFollow.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useWebSSO.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/{karma/KarmaAboutScreen.d.ts.map → trust/TrustAboutScreen.d.ts.map} +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/screens/karma/KarmaFAQScreen.d.ts → module/ui/screens/trust/TrustFAQScreen.d.ts} +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/{karma/KarmaRewardsScreen.d.ts.map → trust/TrustRewardsScreen.d.ts.map} +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +9 -0
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -0
- package/lib/typescript/module/ui/types/navigation.d.ts +1 -1
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +11 -9
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +10 -1
- package/src/ui/components/AccountMenu.tsx +311 -253
- package/src/ui/components/AccountMenuButton.tsx +2 -2
- package/src/ui/components/FollowButton.tsx +2 -2
- package/src/ui/components/OxySignInButton.tsx +1 -1
- package/src/ui/components/SignInModal.tsx +13 -14
- package/src/ui/components/accountMenuRows.ts +28 -40
- package/src/ui/context/OxyContext.tsx +71 -74
- package/src/ui/context/hooks/useAuthOperations.ts +7 -13
- package/src/ui/hooks/useAuth.ts +12 -49
- package/src/ui/hooks/useDeviceAccounts.ts +348 -0
- package/src/ui/hooks/useFollow.ts +16 -8
- package/src/ui/hooks/useSessionManagement.ts +5 -14
- package/src/ui/hooks/useSessionSocket.ts +4 -5
- package/src/ui/hooks/useWebSSO.ts +1 -1
- package/src/ui/navigation/routes.ts +13 -13
- package/src/ui/screens/OxyAuthScreen.tsx +6 -7
- package/src/ui/screens/ProfileScreen.tsx +15 -17
- package/src/ui/screens/WelcomeNewUserScreen.tsx +2 -2
- package/src/ui/screens/{karma/KarmaAboutScreen.tsx → trust/TrustAboutScreen.tsx} +15 -15
- package/src/ui/screens/{karma/KarmaCenterScreen.tsx → trust/TrustCenterScreen.tsx} +87 -41
- package/src/ui/screens/{karma/KarmaFAQScreen.tsx → trust/TrustFAQScreen.tsx} +10 -10
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +101 -0
- package/src/ui/screens/{karma/KarmaRewardsScreen.tsx → trust/TrustRewardsScreen.tsx} +54 -54
- package/src/ui/screens/{karma/KarmaRulesScreen.tsx → trust/TrustRulesScreen.tsx} +27 -13
- package/src/ui/screens/trust/trustTier.ts +20 -0
- package/src/ui/types/navigation.ts +1 -2
- package/src/utils/__tests__/deviceFlowSignIn.test.ts +2 -3
- package/src/utils/deviceFlowSignIn.ts +18 -12
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +0 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +0 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +0 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +0 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +0 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +0 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaAboutScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/karma/KarmaCenterScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/karma/KarmaCenterScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaFAQScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaLeaderboardScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaRewardsScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/karma/KarmaRulesScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/karma/KarmaRulesScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/karma/KarmaAboutScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/karma/KarmaCenterScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/karma/KarmaCenterScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/karma/KarmaFAQScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/karma/KarmaLeaderboardScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/karma/KarmaRewardsScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/karma/KarmaRulesScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/karma/KarmaRulesScreen.d.ts.map +0 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +0 -88
|
@@ -4,22 +4,42 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
4
4
|
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Modal, Pressable, Platform, ActivityIndicator } from 'react-native';
|
|
5
5
|
import { Ionicons } from '@expo/vector-icons';
|
|
6
6
|
import { toast, useDialogControl, Dialog } from '@oxyhq/bloom';
|
|
7
|
+
import { Divider } from '@oxyhq/bloom/divider';
|
|
7
8
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
8
9
|
import Avatar from "./Avatar.js";
|
|
9
10
|
import { useOxy } from "../context/OxyContext.js";
|
|
10
11
|
import { useI18n } from "../hooks/useI18n.js";
|
|
11
12
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
12
13
|
import { buildAccountRows } from "./accountMenuRows.js";
|
|
14
|
+
import { useDeviceAccounts } from "../hooks/useDeviceAccounts.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Web-only anchor for the popover panel. Each field anchors the panel against
|
|
18
|
+
* one viewport edge, so the popover can be placed against ANY corner: a
|
|
19
|
+
* top-right avatar chip opens downward/right-aligned (`{ top, right }`), while a
|
|
20
|
+
* bottom-left account button opens upward/left-aligned (`{ bottom, left }`).
|
|
21
|
+
*
|
|
22
|
+
* Callers MUST supply at most one vertical edge (`top` XOR `bottom`) and at most
|
|
23
|
+
* one horizontal edge (`left` XOR `right`). The panel has a fixed width and
|
|
24
|
+
* `maxHeight`, so a single vertical + single horizontal edge fully positions it.
|
|
25
|
+
* Supplying both opposite edges (e.g. `top` AND `bottom`) would stretch the
|
|
26
|
+
* panel on RN-Web and is unsupported.
|
|
27
|
+
*/
|
|
13
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
29
|
const isWeb = Platform.OS === 'web';
|
|
15
30
|
|
|
31
|
+
/** Fixed popover width on web. Callers that compute an anchor (e.g. inbox's
|
|
32
|
+
* MailboxDrawer) key their gutter math off this — keep them consistent. */
|
|
33
|
+
const PANEL_WIDTH = 360;
|
|
34
|
+
|
|
16
35
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
36
|
+
* Unified, canonical account switcher for the Oxy ecosystem. Gmail-style: the
|
|
37
|
+
* accounts list sits at the top (current account first, with a checkmark), then
|
|
38
|
+
* "Add another account", "Manage account", and the sign-out actions.
|
|
19
39
|
*
|
|
20
|
-
* Reads everything it needs from `useOxy()` — never
|
|
21
|
-
* props. Renders as a popover anchored to the trigger on
|
|
22
|
-
* full-width bottom-sheet style modal on native.
|
|
40
|
+
* Reads everything it needs from `useOxy()` / `useDeviceAccounts()` — never
|
|
41
|
+
* receives a session via props. Renders as a popover anchored to the trigger on
|
|
42
|
+
* web, and as a full-width bottom-sheet style modal on native.
|
|
23
43
|
*/
|
|
24
44
|
const AccountMenu = ({
|
|
25
45
|
open,
|
|
@@ -29,39 +49,55 @@ const AccountMenu = ({
|
|
|
29
49
|
anchor
|
|
30
50
|
}) => {
|
|
31
51
|
const {
|
|
32
|
-
user,
|
|
33
|
-
sessions,
|
|
34
52
|
activeSessionId,
|
|
35
53
|
switchSession,
|
|
36
54
|
logout,
|
|
37
55
|
logoutAll,
|
|
38
|
-
|
|
56
|
+
removeSession
|
|
39
57
|
} = useOxy();
|
|
40
58
|
const {
|
|
41
|
-
t
|
|
42
|
-
locale
|
|
59
|
+
t
|
|
43
60
|
} = useI18n();
|
|
44
61
|
const bloomTheme = useTheme();
|
|
62
|
+
const colors = bloomTheme.colors;
|
|
63
|
+
|
|
64
|
+
// Source EVERY account's real name/email/avatar/color from the unified
|
|
65
|
+
// device-account hook (shared apex `refresh-all` path on `*.oxy.so`, local
|
|
66
|
+
// `useOxy()` fallback on cross-domain web / native). This also synthesises a
|
|
67
|
+
// live-user row when the probe is empty, so the signed-in user is always
|
|
68
|
+
// represented (no "Not signed in" false negative).
|
|
69
|
+
const {
|
|
70
|
+
accounts: deviceAccounts
|
|
71
|
+
} = useDeviceAccounts();
|
|
45
72
|
const [busySessionId, setBusySessionId] = useState(null);
|
|
73
|
+
const [removingSessionId, setRemovingSessionId] = useState(null);
|
|
46
74
|
const [signingOut, setSigningOut] = useState(false);
|
|
47
75
|
const [signingOutAll, setSigningOutAll] = useState(false);
|
|
48
76
|
const signOutDialog = useDialogControl();
|
|
49
77
|
const signOutAllDialog = useDialogControl();
|
|
50
78
|
const containerRef = useRef(null);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
79
|
+
|
|
80
|
+
// Current account first, then the rest in their existing order — matching
|
|
81
|
+
// the Gmail-style chooser the inbox design ports from.
|
|
82
|
+
const rows = useMemo(() => {
|
|
83
|
+
const built = buildAccountRows({
|
|
84
|
+
accounts: deviceAccounts
|
|
85
|
+
});
|
|
86
|
+
const current = built.filter(row => row.isActive);
|
|
87
|
+
const others = built.filter(row => !row.isActive);
|
|
88
|
+
return [...current, ...others];
|
|
89
|
+
}, [deviceAccounts]);
|
|
90
|
+
const isSwitching = busySessionId !== null;
|
|
91
|
+
|
|
92
|
+
// Switch to a non-active account. We route ALL rows through
|
|
93
|
+
// `useOxy().switchSession(sessionId)` — the SDK's canonical switch path. On
|
|
94
|
+
// WEB it already performs the same silent activation the auth chooser uses:
|
|
95
|
+
// when the target `ClientSession` carries an `authuser` slot, it rotates that
|
|
96
|
+
// slot via `oxyServices.refreshTokenViaCookie({ authuser })` and plants the
|
|
97
|
+
// fresh access token before validating (see `useSessionManagement.switchSession`).
|
|
98
|
+
// On NATIVE it validates the session id directly. There is no separate
|
|
99
|
+
// "activate by authuser" SDK entry point, so reusing `switchSession`
|
|
100
|
+
// (rather than inventing a parallel mechanism) keeps a single source of truth.
|
|
65
101
|
const handleSwitch = useCallback(async sessionId => {
|
|
66
102
|
if (sessionId === activeSessionId || busySessionId) {
|
|
67
103
|
return;
|
|
@@ -82,6 +118,29 @@ const AccountMenu = ({
|
|
|
82
118
|
setBusySessionId(null);
|
|
83
119
|
}
|
|
84
120
|
}, [activeSessionId, busySessionId, switchSession, t, onClose]);
|
|
121
|
+
|
|
122
|
+
// Sign out a SPECIFIC inactive account from its per-row icon. `removeSession`
|
|
123
|
+
// is the SDK's canonical per-session sign-out: it targets the given session
|
|
124
|
+
// id (cookie-cleared logout via `authuser` slot on web, bearer logout
|
|
125
|
+
// otherwise) and removes ONLY that account without switching/clearing the
|
|
126
|
+
// active session. The menu stays open so the user can keep managing accounts.
|
|
127
|
+
const handleRemove = useCallback(async sessionId => {
|
|
128
|
+
if (sessionId === activeSessionId || removingSessionId) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
setRemovingSessionId(sessionId);
|
|
132
|
+
try {
|
|
133
|
+
await removeSession(sessionId);
|
|
134
|
+
toast.success(t('common.actions.signedOut') || 'Signed out');
|
|
135
|
+
} catch (error) {
|
|
136
|
+
loggerUtil.warn('Remove account failed', {
|
|
137
|
+
component: 'AccountMenu'
|
|
138
|
+
}, error);
|
|
139
|
+
toast.error(t('common.errors.signOutFailed') || 'Failed to sign out');
|
|
140
|
+
} finally {
|
|
141
|
+
setRemovingSessionId(null);
|
|
142
|
+
}
|
|
143
|
+
}, [activeSessionId, removingSessionId, removeSession, t]);
|
|
85
144
|
const performSignOut = useCallback(async () => {
|
|
86
145
|
if (signingOut) {
|
|
87
146
|
return;
|
|
@@ -137,73 +196,52 @@ const AccountMenu = ({
|
|
|
137
196
|
return null;
|
|
138
197
|
}
|
|
139
198
|
const overlayStyles = isWeb ? styles.webOverlay : styles.nativeOverlay;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
199
|
+
|
|
200
|
+
// Apply ONLY the edges the anchor supplies (so the panel never sets
|
|
201
|
+
// conflicting opposite edges). When no anchor is provided, fall back to the
|
|
202
|
+
// historical top-right placement used by `AccountMenuButton`.
|
|
203
|
+
const anchorStyle = anchor ? {
|
|
204
|
+
...(anchor.top !== undefined ? {
|
|
205
|
+
top: anchor.top
|
|
206
|
+
} : null),
|
|
207
|
+
...(anchor.bottom !== undefined ? {
|
|
208
|
+
bottom: anchor.bottom
|
|
209
|
+
} : null),
|
|
210
|
+
...(anchor.left !== undefined ? {
|
|
211
|
+
left: anchor.left
|
|
212
|
+
} : null),
|
|
213
|
+
...(anchor.right !== undefined ? {
|
|
214
|
+
right: anchor.right
|
|
215
|
+
} : null)
|
|
143
216
|
} : {
|
|
144
217
|
top: 64,
|
|
145
218
|
right: 16
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
219
|
+
};
|
|
220
|
+
const panelStyles = isWeb ? [styles.panelBase, styles.panelWeb, anchorStyle, {
|
|
221
|
+
backgroundColor: colors.background,
|
|
222
|
+
borderColor: colors.border
|
|
149
223
|
}] : [styles.panelBase, styles.panelNative, {
|
|
150
|
-
backgroundColor:
|
|
224
|
+
backgroundColor: colors.background
|
|
151
225
|
}];
|
|
152
|
-
const
|
|
153
|
-
|
|
226
|
+
const actionDisabled = isSwitching || signingOut || signingOutAll;
|
|
227
|
+
const content = /*#__PURE__*/_jsx(Pressable, {
|
|
228
|
+
ref: containerRef
|
|
229
|
+
// Swallow taps inside the panel so they never reach the overlay's
|
|
230
|
+
// outside-tap-to-close handler. (On web the panel is a direct,
|
|
231
|
+
// absolutely-positioned child of the overlay so the anchor resolves
|
|
232
|
+
// against the viewport.)
|
|
233
|
+
,
|
|
234
|
+
onPress: () => undefined,
|
|
154
235
|
style: panelStyles,
|
|
155
236
|
accessibilityRole: "menu",
|
|
156
237
|
accessibilityLabel: t('accountMenu.label') || 'Account menu',
|
|
157
|
-
children:
|
|
158
|
-
style: styles.
|
|
159
|
-
|
|
160
|
-
uri: activeRow.avatarUri,
|
|
161
|
-
name: activeRow.displayName,
|
|
162
|
-
size: 64
|
|
163
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
164
|
-
style: [styles.headerName, {
|
|
165
|
-
color: bloomTheme.colors.text
|
|
166
|
-
}],
|
|
167
|
-
numberOfLines: 1,
|
|
168
|
-
children: activeRow.displayName
|
|
169
|
-
}), activeRow.secondary ? /*#__PURE__*/_jsx(Text, {
|
|
170
|
-
style: [styles.headerSecondary, {
|
|
171
|
-
color: bloomTheme.colors.textSecondary
|
|
172
|
-
}],
|
|
173
|
-
numberOfLines: 1,
|
|
174
|
-
children: activeRow.secondary
|
|
175
|
-
}) : null]
|
|
176
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
177
|
-
style: styles.header,
|
|
178
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
179
|
-
style: [styles.headerName, {
|
|
180
|
-
color: bloomTheme.colors.text
|
|
181
|
-
}],
|
|
182
|
-
children: t('common.status.notSignedIn') || 'Not signed in'
|
|
183
|
-
})
|
|
184
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
185
|
-
ref: firstActionRef,
|
|
186
|
-
accessibilityRole: "menuitem",
|
|
187
|
-
accessibilityLabel: t('accountMenu.manage') || 'Manage your Oxy Account',
|
|
188
|
-
style: [styles.primaryButton, {
|
|
189
|
-
borderColor: bloomTheme.colors.border
|
|
190
|
-
}],
|
|
191
|
-
onPress: () => {
|
|
192
|
-
onClose();
|
|
193
|
-
onNavigateManage();
|
|
194
|
-
},
|
|
195
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
196
|
-
style: [styles.primaryButtonText, {
|
|
197
|
-
color: bloomTheme.colors.primary
|
|
198
|
-
}],
|
|
199
|
-
children: t('accountMenu.manage') || 'Manage your Oxy Account'
|
|
200
|
-
})
|
|
201
|
-
}), rows.length > 0 ? /*#__PURE__*/_jsx(ScrollView, {
|
|
202
|
-
style: styles.list,
|
|
203
|
-
contentContainerStyle: styles.listContent,
|
|
238
|
+
children: /*#__PURE__*/_jsxs(ScrollView, {
|
|
239
|
+
style: styles.scroll,
|
|
240
|
+
contentContainerStyle: styles.scrollContent,
|
|
204
241
|
showsVerticalScrollIndicator: false,
|
|
205
|
-
children: rows.map(row => {
|
|
242
|
+
children: [rows.map(row => {
|
|
206
243
|
const isBusy = busySessionId === row.sessionId;
|
|
244
|
+
const isRemoving = removingSessionId === row.sessionId;
|
|
207
245
|
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
208
246
|
accessibilityRole: "menuitem",
|
|
209
247
|
accessibilityLabel: row.displayName,
|
|
@@ -211,101 +249,161 @@ const AccountMenu = ({
|
|
|
211
249
|
selected: row.isActive
|
|
212
250
|
},
|
|
213
251
|
onPress: () => handleSwitch(row.sessionId),
|
|
214
|
-
disabled: row.isActive || isBusy,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
252
|
+
disabled: row.isActive || isBusy || isSwitching,
|
|
253
|
+
activeOpacity: 0.6,
|
|
254
|
+
style: [styles.accountRow, row.isActive && {
|
|
255
|
+
backgroundColor: colors.primarySubtle
|
|
256
|
+
}, isSwitching && !row.isActive && styles.rowDisabled],
|
|
218
257
|
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
219
258
|
uri: row.avatarUri,
|
|
220
259
|
name: row.displayName,
|
|
221
|
-
size:
|
|
260
|
+
size: row.isActive ? 40 : 32
|
|
222
261
|
}), /*#__PURE__*/_jsxs(View, {
|
|
223
|
-
style: styles.
|
|
262
|
+
style: styles.accountInfo,
|
|
224
263
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
225
|
-
style: [styles.
|
|
226
|
-
color:
|
|
227
|
-
}],
|
|
264
|
+
style: [styles.accountName, {
|
|
265
|
+
color: colors.text
|
|
266
|
+
}, row.isActive && styles.accountNameActive],
|
|
228
267
|
numberOfLines: 1,
|
|
229
268
|
children: row.displayName
|
|
230
269
|
}), row.secondary ? /*#__PURE__*/_jsx(Text, {
|
|
231
|
-
style: [styles.
|
|
232
|
-
color:
|
|
270
|
+
style: [styles.accountEmail, {
|
|
271
|
+
color: colors.textSecondary
|
|
233
272
|
}],
|
|
234
273
|
numberOfLines: 1,
|
|
235
274
|
children: row.secondary
|
|
236
275
|
}) : null]
|
|
237
276
|
}), isBusy ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
238
|
-
color:
|
|
277
|
+
color: colors.primary,
|
|
239
278
|
size: "small"
|
|
240
279
|
}) : row.isActive ? /*#__PURE__*/_jsx(Ionicons, {
|
|
241
|
-
name: "checkmark
|
|
280
|
+
name: "checkmark",
|
|
242
281
|
size: 20,
|
|
243
|
-
color:
|
|
244
|
-
}) :
|
|
282
|
+
color: colors.primary
|
|
283
|
+
}) : isRemoving ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
284
|
+
color: colors.textSecondary,
|
|
285
|
+
size: "small"
|
|
286
|
+
}) : /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
287
|
+
accessibilityRole: "button",
|
|
288
|
+
accessibilityLabel: t('accountMenu.signOutAccount', {
|
|
289
|
+
name: row.displayName
|
|
290
|
+
}) || `Sign out ${row.displayName}`,
|
|
291
|
+
onPress: () => handleRemove(row.sessionId),
|
|
292
|
+
disabled: isSwitching || removingSessionId !== null,
|
|
293
|
+
activeOpacity: 0.6,
|
|
294
|
+
hitSlop: {
|
|
295
|
+
top: 8,
|
|
296
|
+
bottom: 8,
|
|
297
|
+
left: 8,
|
|
298
|
+
right: 8
|
|
299
|
+
},
|
|
300
|
+
style: styles.rowSignOutButton,
|
|
301
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
302
|
+
name: "log-out-outline",
|
|
303
|
+
size: 18,
|
|
304
|
+
color: colors.textSecondary
|
|
305
|
+
})
|
|
306
|
+
})]
|
|
245
307
|
}, `account-${row.sessionId}`);
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
308
|
+
}), isSwitching ? /*#__PURE__*/_jsxs(View, {
|
|
309
|
+
style: styles.switchingRow,
|
|
310
|
+
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
311
|
+
color: colors.textSecondary,
|
|
312
|
+
size: "small"
|
|
313
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
314
|
+
style: [styles.switchingText, {
|
|
315
|
+
color: colors.textSecondary
|
|
316
|
+
}],
|
|
317
|
+
children: t('accountMenu.switching') || 'Switching account…'
|
|
318
|
+
})]
|
|
319
|
+
}) : null, /*#__PURE__*/_jsx(Divider, {
|
|
320
|
+
color: colors.border,
|
|
321
|
+
spacing: 4
|
|
322
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
323
|
+
accessibilityRole: "menuitem",
|
|
324
|
+
accessibilityLabel: t('accountMenu.addAnother') || 'Add another account',
|
|
325
|
+
onPress: () => {
|
|
326
|
+
onClose();
|
|
327
|
+
onAddAccount();
|
|
328
|
+
},
|
|
329
|
+
disabled: actionDisabled,
|
|
330
|
+
activeOpacity: 0.6,
|
|
331
|
+
style: [styles.actionRow, actionDisabled && styles.rowDisabled],
|
|
332
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
260
333
|
name: "person-add-outline",
|
|
261
|
-
size:
|
|
262
|
-
color:
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
267
|
-
style: [styles.rowName, {
|
|
268
|
-
color: bloomTheme.colors.text
|
|
334
|
+
size: 20,
|
|
335
|
+
color: colors.icon
|
|
336
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
337
|
+
style: [styles.actionText, {
|
|
338
|
+
color: colors.text
|
|
269
339
|
}],
|
|
270
340
|
children: t('accountMenu.addAnother') || 'Add another account'
|
|
271
|
-
})
|
|
272
|
-
})
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
341
|
+
})]
|
|
342
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
343
|
+
color: colors.border,
|
|
344
|
+
spacing: 4
|
|
345
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
346
|
+
accessibilityRole: "menuitem",
|
|
347
|
+
accessibilityLabel: t('accountMenu.manage') || 'Manage your Oxy Account',
|
|
348
|
+
onPress: () => {
|
|
349
|
+
onClose();
|
|
350
|
+
onNavigateManage();
|
|
351
|
+
},
|
|
352
|
+
disabled: actionDisabled,
|
|
353
|
+
activeOpacity: 0.6,
|
|
354
|
+
style: [styles.actionRow, actionDisabled && styles.rowDisabled],
|
|
355
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
356
|
+
name: "settings-outline",
|
|
357
|
+
size: 18,
|
|
358
|
+
color: colors.icon
|
|
359
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
360
|
+
style: [styles.actionText, {
|
|
361
|
+
color: colors.text
|
|
362
|
+
}],
|
|
363
|
+
children: t('accountMenu.manage') || 'Manage your Oxy Account'
|
|
364
|
+
})]
|
|
365
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
278
366
|
accessibilityRole: "menuitem",
|
|
279
367
|
accessibilityLabel: t('common.actions.signOut') || 'Sign out',
|
|
280
368
|
onPress: () => signOutDialog.open(),
|
|
281
|
-
disabled:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
369
|
+
disabled: actionDisabled,
|
|
370
|
+
activeOpacity: 0.6,
|
|
371
|
+
style: [styles.actionRow, actionDisabled && styles.rowDisabled],
|
|
372
|
+
children: [signingOut ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
373
|
+
color: colors.error,
|
|
285
374
|
size: "small"
|
|
286
|
-
}) : /*#__PURE__*/_jsx(
|
|
287
|
-
|
|
288
|
-
|
|
375
|
+
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
376
|
+
name: "log-out-outline",
|
|
377
|
+
size: 18,
|
|
378
|
+
color: colors.error
|
|
379
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
380
|
+
style: [styles.actionText, {
|
|
381
|
+
color: colors.error
|
|
289
382
|
}],
|
|
290
383
|
children: t('common.actions.signOut') || 'Sign out'
|
|
291
|
-
})
|
|
292
|
-
}), rows.length > 1 ? /*#__PURE__*/
|
|
384
|
+
})]
|
|
385
|
+
}), rows.length > 1 ? /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
293
386
|
accessibilityRole: "menuitem",
|
|
294
387
|
accessibilityLabel: t('accountMenu.signOutAll') || 'Sign out of all accounts',
|
|
295
388
|
onPress: () => signOutAllDialog.open(),
|
|
296
|
-
disabled:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
389
|
+
disabled: actionDisabled,
|
|
390
|
+
activeOpacity: 0.6,
|
|
391
|
+
style: [styles.actionRow, actionDisabled && styles.rowDisabled],
|
|
392
|
+
children: [signingOutAll ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
393
|
+
color: colors.error,
|
|
300
394
|
size: "small"
|
|
301
|
-
}) : /*#__PURE__*/_jsx(
|
|
302
|
-
|
|
303
|
-
|
|
395
|
+
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
396
|
+
name: "log-out-outline",
|
|
397
|
+
size: 18,
|
|
398
|
+
color: colors.error
|
|
399
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
400
|
+
style: [styles.actionText, {
|
|
401
|
+
color: colors.error
|
|
304
402
|
}],
|
|
305
403
|
children: t('accountMenu.signOutAll') || 'Sign out of all accounts'
|
|
306
|
-
})
|
|
404
|
+
})]
|
|
307
405
|
}) : null]
|
|
308
|
-
})
|
|
406
|
+
})
|
|
309
407
|
});
|
|
310
408
|
return /*#__PURE__*/_jsxs(Modal, {
|
|
311
409
|
visible: open,
|
|
@@ -317,11 +415,7 @@ const AccountMenu = ({
|
|
|
317
415
|
accessibilityLabel: t('common.actions.close') || 'Close',
|
|
318
416
|
onPress: onClose,
|
|
319
417
|
style: overlayStyles,
|
|
320
|
-
children:
|
|
321
|
-
onPress: () => undefined,
|
|
322
|
-
style: styles.panelTouchable,
|
|
323
|
-
children: content
|
|
324
|
-
})
|
|
418
|
+
children: content
|
|
325
419
|
}), /*#__PURE__*/_jsx(Dialog, {
|
|
326
420
|
control: signOutDialog,
|
|
327
421
|
title: t('common.actions.signOut') || 'Sign out',
|
|
@@ -352,19 +446,20 @@ const AccountMenu = ({
|
|
|
352
446
|
const styles = StyleSheet.create({
|
|
353
447
|
webOverlay: {
|
|
354
448
|
flex: 1,
|
|
355
|
-
backgroundColor: 'transparent'
|
|
449
|
+
backgroundColor: 'transparent',
|
|
450
|
+
// Explicit positioning context: the absolutely-positioned panel is a
|
|
451
|
+
// direct child and resolves its anchor edges (top/bottom/left/right)
|
|
452
|
+
// against this full-viewport overlay — matching the trigger-rect math
|
|
453
|
+
// callers compute from `window.innerWidth` / `window.innerHeight`.
|
|
454
|
+
position: 'relative'
|
|
356
455
|
},
|
|
357
456
|
nativeOverlay: {
|
|
358
457
|
flex: 1,
|
|
359
458
|
backgroundColor: 'rgba(0,0,0,0.32)',
|
|
360
459
|
justifyContent: 'flex-end'
|
|
361
460
|
},
|
|
362
|
-
panelTouchable: {
|
|
363
|
-
// Pressable wrapper that owns no styling — just absorbs taps.
|
|
364
|
-
},
|
|
365
461
|
panelBase: {
|
|
366
|
-
borderRadius:
|
|
367
|
-
paddingVertical: 12,
|
|
462
|
+
borderRadius: 12,
|
|
368
463
|
shadowColor: '#000',
|
|
369
464
|
shadowOpacity: 0.18,
|
|
370
465
|
shadowRadius: 24,
|
|
@@ -377,103 +472,79 @@ const styles = StyleSheet.create({
|
|
|
377
472
|
},
|
|
378
473
|
panelWeb: {
|
|
379
474
|
position: 'absolute',
|
|
380
|
-
width:
|
|
475
|
+
width: PANEL_WIDTH,
|
|
381
476
|
maxHeight: '85%',
|
|
382
477
|
borderWidth: 1
|
|
383
478
|
},
|
|
384
479
|
panelNative: {
|
|
385
480
|
marginHorizontal: 0,
|
|
386
|
-
borderTopLeftRadius:
|
|
387
|
-
borderTopRightRadius:
|
|
481
|
+
borderTopLeftRadius: 20,
|
|
482
|
+
borderTopRightRadius: 20,
|
|
388
483
|
borderBottomLeftRadius: 0,
|
|
389
484
|
borderBottomRightRadius: 0,
|
|
390
|
-
|
|
391
|
-
paddingBottom: 24,
|
|
485
|
+
paddingBottom: 12,
|
|
392
486
|
maxHeight: '85%'
|
|
393
487
|
},
|
|
394
|
-
|
|
488
|
+
scroll: {
|
|
489
|
+
flexGrow: 0
|
|
490
|
+
},
|
|
491
|
+
scrollContent: {
|
|
492
|
+
paddingVertical: 4
|
|
493
|
+
},
|
|
494
|
+
accountRow: {
|
|
495
|
+
flexDirection: 'row',
|
|
395
496
|
alignItems: 'center',
|
|
396
|
-
paddingHorizontal:
|
|
397
|
-
paddingVertical:
|
|
497
|
+
paddingHorizontal: 14,
|
|
498
|
+
paddingVertical: 10,
|
|
499
|
+
gap: 10
|
|
398
500
|
},
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
fontWeight: '600',
|
|
402
|
-
marginTop: 12,
|
|
403
|
-
textAlign: 'center'
|
|
501
|
+
rowDisabled: {
|
|
502
|
+
opacity: 0.4
|
|
404
503
|
},
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
textAlign: 'center'
|
|
504
|
+
accountInfo: {
|
|
505
|
+
flex: 1,
|
|
506
|
+
minWidth: 0
|
|
409
507
|
},
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
paddingVertical: 12,
|
|
414
|
-
paddingHorizontal: 16,
|
|
415
|
-
borderRadius: 999,
|
|
416
|
-
borderWidth: 1,
|
|
417
|
-
alignItems: 'center'
|
|
508
|
+
accountName: {
|
|
509
|
+
fontSize: 13,
|
|
510
|
+
fontWeight: '500'
|
|
418
511
|
},
|
|
419
|
-
|
|
420
|
-
fontSize: 14,
|
|
512
|
+
accountNameActive: {
|
|
421
513
|
fontWeight: '600'
|
|
422
514
|
},
|
|
423
|
-
|
|
424
|
-
|
|
515
|
+
accountEmail: {
|
|
516
|
+
fontSize: 11,
|
|
517
|
+
marginTop: 1
|
|
425
518
|
},
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
},
|
|
430
|
-
row: {
|
|
431
|
-
flexDirection: 'row',
|
|
519
|
+
rowSignOutButton: {
|
|
520
|
+
width: 28,
|
|
521
|
+
height: 28,
|
|
432
522
|
alignItems: 'center',
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
marginVertical: 2
|
|
437
|
-
},
|
|
438
|
-
actionRow: {
|
|
439
|
-
marginHorizontal: 12,
|
|
440
|
-
marginTop: 4
|
|
523
|
+
justifyContent: 'center',
|
|
524
|
+
borderRadius: 14,
|
|
525
|
+
opacity: 0.6
|
|
441
526
|
},
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
height: 36,
|
|
445
|
-
borderRadius: 18,
|
|
527
|
+
switchingRow: {
|
|
528
|
+
flexDirection: 'row',
|
|
446
529
|
alignItems: 'center',
|
|
447
|
-
justifyContent: 'center'
|
|
530
|
+
justifyContent: 'center',
|
|
531
|
+
paddingVertical: 8,
|
|
532
|
+
gap: 8
|
|
448
533
|
},
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
marginLeft: 12
|
|
452
|
-
},
|
|
453
|
-
rowName: {
|
|
454
|
-
fontSize: 15,
|
|
534
|
+
switchingText: {
|
|
535
|
+
fontSize: 12,
|
|
455
536
|
fontWeight: '500'
|
|
456
537
|
},
|
|
457
|
-
|
|
458
|
-
fontSize: 13,
|
|
459
|
-
marginTop: 2
|
|
460
|
-
},
|
|
461
|
-
footer: {
|
|
462
|
-
marginTop: 12,
|
|
463
|
-
paddingTop: 8,
|
|
464
|
-
paddingHorizontal: 12,
|
|
465
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
538
|
+
actionRow: {
|
|
466
539
|
flexDirection: 'row',
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
paddingVertical: 10,
|
|
472
|
-
paddingHorizontal: 12
|
|
540
|
+
alignItems: 'center',
|
|
541
|
+
paddingHorizontal: 14,
|
|
542
|
+
paddingVertical: 12,
|
|
543
|
+
gap: 10
|
|
473
544
|
},
|
|
474
|
-
|
|
475
|
-
fontSize:
|
|
476
|
-
fontWeight: '
|
|
545
|
+
actionText: {
|
|
546
|
+
fontSize: 13,
|
|
547
|
+
fontWeight: '500'
|
|
477
548
|
}
|
|
478
549
|
});
|
|
479
550
|
export default AccountMenu;
|