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