@oxyhq/services 5.3.5 → 5.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/core/index.js +12 -1
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +17 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +0 -5
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +479 -313
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/core/index.js +12 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +17 -2
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +0 -5
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +480 -314
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/index.ts +13 -1
- package/src/ui/context/OxyContext.tsx +19 -2
- package/src/ui/navigation/OxyRouter.tsx +0 -5
- package/src/ui/screens/AccountSwitcherScreen.tsx +502 -304
- package/lib/commonjs/ui/screens/ModernAccountSwitcherScreen.js +0 -532
- package/lib/commonjs/ui/screens/ModernAccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/ModernAccountSwitcherScreen.js +0 -527
- package/lib/module/ui/screens/ModernAccountSwitcherScreen.js.map +0 -1
- package/lib/typescript/ui/screens/ModernAccountSwitcherScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/ModernAccountSwitcherScreen.d.ts.map +0 -1
- package/src/ui/screens/ModernAccountSwitcherScreen.tsx +0 -552
|
@@ -10,7 +10,7 @@ var _OxyContext = require("../context/OxyContext");
|
|
|
10
10
|
var _fonts = require("../styles/fonts");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
-
const
|
|
13
|
+
const ModernAccountSwitcherScreen = ({
|
|
14
14
|
onClose,
|
|
15
15
|
theme,
|
|
16
16
|
navigate,
|
|
@@ -26,11 +26,16 @@ const AccountSwitcherScreen = ({
|
|
|
26
26
|
logoutAll,
|
|
27
27
|
isLoading
|
|
28
28
|
} = (0, _OxyContext.useOxy)();
|
|
29
|
-
const [
|
|
30
|
-
const [loadingDeviceSessions, setLoadingDeviceSessions] = (0, _react.useState)(false);
|
|
29
|
+
const [sessionsWithUsers, setSessionsWithUsers] = (0, _react.useState)([]);
|
|
31
30
|
const [switchingToUserId, setSwitchingToUserId] = (0, _react.useState)(null);
|
|
32
31
|
const [removingUserId, setRemovingUserId] = (0, _react.useState)(null);
|
|
33
|
-
|
|
32
|
+
|
|
33
|
+
// Device session management state
|
|
34
|
+
const [showDeviceManagement, setShowDeviceManagement] = (0, _react.useState)(false);
|
|
35
|
+
const [deviceSessions, setDeviceSessions] = (0, _react.useState)([]);
|
|
36
|
+
const [loadingDeviceSessions, setLoadingDeviceSessions] = (0, _react.useState)(false);
|
|
37
|
+
const [remotingLogoutSessionId, setRemoteLogoutSessionId] = (0, _react.useState)(null);
|
|
38
|
+
const [loggingOutAllDevices, setLoggingOutAllDevices] = (0, _react.useState)(false);
|
|
34
39
|
const screenWidth = _reactNative.Dimensions.get('window').width;
|
|
35
40
|
const isDarkTheme = theme === 'dark';
|
|
36
41
|
|
|
@@ -49,36 +54,38 @@ const AccountSwitcherScreen = ({
|
|
|
49
54
|
shadow: isDarkTheme ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0.1)'
|
|
50
55
|
};
|
|
51
56
|
|
|
52
|
-
// Load
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
sessionId: session.sessionId,
|
|
60
|
-
deviceId: session.deviceId,
|
|
61
|
-
deviceName: session.deviceName || 'Unknown Device',
|
|
62
|
-
isActive: session.isActive,
|
|
63
|
-
lastActive: session.lastActive || new Date().toISOString(),
|
|
64
|
-
expiresAt: session.expiresAt || new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
|
|
65
|
-
isCurrent: session.sessionId === activeSessionId
|
|
57
|
+
// Load user profiles for sessions
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
const loadUserProfiles = async () => {
|
|
60
|
+
if (!sessions.length || !oxyServices) return;
|
|
61
|
+
const updatedSessions = sessions.map(session => ({
|
|
62
|
+
...session,
|
|
63
|
+
isLoadingProfile: true
|
|
66
64
|
}));
|
|
67
|
-
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error('Failed to load device sessions:', error);
|
|
70
|
-
_reactNative.Alert.alert('Error', 'Failed to load device sessions');
|
|
71
|
-
} finally {
|
|
72
|
-
setLoadingDeviceSessions(false);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
65
|
+
setSessionsWithUsers(updatedSessions);
|
|
75
66
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
// Load profiles for each session
|
|
68
|
+
for (let i = 0; i < sessions.length; i++) {
|
|
69
|
+
const session = sessions[i];
|
|
70
|
+
try {
|
|
71
|
+
// Try to get user profile using the session
|
|
72
|
+
const userProfile = await oxyServices.getUserBySession(session.sessionId);
|
|
73
|
+
setSessionsWithUsers(prev => prev.map(s => s.sessionId === session.sessionId ? {
|
|
74
|
+
...s,
|
|
75
|
+
userProfile,
|
|
76
|
+
isLoadingProfile: false
|
|
77
|
+
} : s));
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error(`Failed to load profile for session ${session.sessionId}:`, error);
|
|
80
|
+
setSessionsWithUsers(prev => prev.map(s => s.sessionId === session.sessionId ? {
|
|
81
|
+
...s,
|
|
82
|
+
isLoadingProfile: false
|
|
83
|
+
} : s));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
loadUserProfiles();
|
|
88
|
+
}, [sessions, oxyServices]);
|
|
82
89
|
const handleSwitchSession = async sessionId => {
|
|
83
90
|
if (sessionId === user?.sessionId) return; // Already active session
|
|
84
91
|
|
|
@@ -97,9 +104,10 @@ const AccountSwitcherScreen = ({
|
|
|
97
104
|
}
|
|
98
105
|
};
|
|
99
106
|
const handleRemoveSession = async sessionId => {
|
|
100
|
-
const sessionToRemove =
|
|
107
|
+
const sessionToRemove = sessionsWithUsers.find(s => s.sessionId === sessionId);
|
|
101
108
|
if (!sessionToRemove) return;
|
|
102
|
-
|
|
109
|
+
const displayName = typeof sessionToRemove.userProfile?.name === 'object' ? sessionToRemove.userProfile.name.full || sessionToRemove.userProfile.name.first || sessionToRemove.userProfile.username : sessionToRemove.userProfile?.name || sessionToRemove.userProfile?.username || 'this account';
|
|
110
|
+
_reactNative.Alert.alert('Remove Account', `Are you sure you want to remove ${displayName} from this device? You'll need to sign in again to access this account.`, [{
|
|
103
111
|
text: 'Cancel',
|
|
104
112
|
style: 'cancel'
|
|
105
113
|
}, {
|
|
@@ -122,6 +130,9 @@ const AccountSwitcherScreen = ({
|
|
|
122
130
|
});
|
|
123
131
|
};
|
|
124
132
|
const handleLogoutAll = async () => {
|
|
133
|
+
console.log('handleLogoutAll called, current user:', user);
|
|
134
|
+
console.log('activeSessionId:', activeSessionId);
|
|
135
|
+
console.log('sessions count:', sessions.length);
|
|
125
136
|
_reactNative.Alert.alert('Sign Out All', 'Are you sure you want to sign out of all accounts on this device?', [{
|
|
126
137
|
text: 'Cancel',
|
|
127
138
|
style: 'cancel'
|
|
@@ -129,37 +140,60 @@ const AccountSwitcherScreen = ({
|
|
|
129
140
|
text: 'Sign Out All',
|
|
130
141
|
style: 'destructive',
|
|
131
142
|
onPress: async () => {
|
|
143
|
+
console.log('User confirmed logout all');
|
|
132
144
|
try {
|
|
145
|
+
console.log('About to call logoutAll()');
|
|
133
146
|
await logoutAll();
|
|
147
|
+
console.log('logoutAll() completed successfully');
|
|
134
148
|
_reactNative.Alert.alert('Success', 'All accounts signed out successfully!');
|
|
135
149
|
if (onClose) {
|
|
136
150
|
onClose();
|
|
137
151
|
}
|
|
138
152
|
} catch (error) {
|
|
139
153
|
console.error('Logout all failed:', error);
|
|
140
|
-
|
|
154
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
155
|
+
_reactNative.Alert.alert('Logout Failed', `There was a problem signing out: ${errorMessage}`);
|
|
141
156
|
}
|
|
142
157
|
}
|
|
143
158
|
}], {
|
|
144
159
|
cancelable: true
|
|
145
160
|
});
|
|
146
161
|
};
|
|
162
|
+
|
|
163
|
+
// Device session management functions
|
|
164
|
+
const loadAllDeviceSessions = async () => {
|
|
165
|
+
if (!oxyServices || !user?.sessionId) return;
|
|
166
|
+
setLoadingDeviceSessions(true);
|
|
167
|
+
try {
|
|
168
|
+
// This would call the API to get all device sessions for the current user
|
|
169
|
+
const allSessions = await oxyServices.getDeviceSessions(user.sessionId);
|
|
170
|
+
setDeviceSessions(allSessions || []);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
console.error('Failed to load device sessions:', error);
|
|
173
|
+
_reactNative.Alert.alert('Error', 'Failed to load device sessions. Please try again.');
|
|
174
|
+
} finally {
|
|
175
|
+
setLoadingDeviceSessions(false);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
147
178
|
const handleRemoteSessionLogout = async (sessionId, deviceName) => {
|
|
148
|
-
_reactNative.Alert.alert('
|
|
179
|
+
_reactNative.Alert.alert('Remove Device Session', `Are you sure you want to sign out from "${deviceName}"? This will end the session on that device.`, [{
|
|
149
180
|
text: 'Cancel',
|
|
150
181
|
style: 'cancel'
|
|
151
182
|
}, {
|
|
152
|
-
text: '
|
|
183
|
+
text: 'Sign Out',
|
|
153
184
|
style: 'destructive',
|
|
154
185
|
onPress: async () => {
|
|
186
|
+
setRemoteLogoutSessionId(sessionId);
|
|
155
187
|
try {
|
|
156
|
-
await oxyServices
|
|
157
|
-
|
|
158
|
-
// Refresh the device sessions list
|
|
188
|
+
await oxyServices?.logoutSecureSession(user?.sessionId || '', sessionId);
|
|
189
|
+
// Refresh device sessions list
|
|
159
190
|
await loadAllDeviceSessions();
|
|
191
|
+
_reactNative.Alert.alert('Success', `Signed out from ${deviceName} successfully!`);
|
|
160
192
|
} catch (error) {
|
|
161
193
|
console.error('Remote logout failed:', error);
|
|
162
|
-
_reactNative.Alert.alert('Logout Failed', 'There was a problem
|
|
194
|
+
_reactNative.Alert.alert('Logout Failed', 'There was a problem signing out from the device. Please try again.');
|
|
195
|
+
} finally {
|
|
196
|
+
setRemoteLogoutSessionId(null);
|
|
163
197
|
}
|
|
164
198
|
}
|
|
165
199
|
}], {
|
|
@@ -167,64 +201,182 @@ const AccountSwitcherScreen = ({
|
|
|
167
201
|
});
|
|
168
202
|
};
|
|
169
203
|
const handleLogoutAllDevices = async () => {
|
|
170
|
-
|
|
204
|
+
const otherDevicesCount = deviceSessions.filter(session => !session.isCurrent).length;
|
|
205
|
+
if (otherDevicesCount === 0) {
|
|
206
|
+
_reactNative.Alert.alert('No Other Devices', 'No other device sessions found to sign out from.');
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
_reactNative.Alert.alert('Sign Out All Other Devices', `Are you sure you want to sign out from all ${otherDevicesCount} other device(s)? This will end sessions on all other devices except this one.`, [{
|
|
171
210
|
text: 'Cancel',
|
|
172
211
|
style: 'cancel'
|
|
173
212
|
}, {
|
|
174
|
-
text: '
|
|
213
|
+
text: 'Sign Out All',
|
|
175
214
|
style: 'destructive',
|
|
176
215
|
onPress: async () => {
|
|
216
|
+
setLoggingOutAllDevices(true);
|
|
177
217
|
try {
|
|
178
|
-
await oxyServices
|
|
179
|
-
|
|
180
|
-
// Refresh the device sessions list
|
|
218
|
+
await oxyServices?.logoutAllDeviceSessions(user?.sessionId || '', undefined, true);
|
|
219
|
+
// Refresh device sessions list
|
|
181
220
|
await loadAllDeviceSessions();
|
|
221
|
+
_reactNative.Alert.alert('Success', `Signed out from all other devices successfully!`);
|
|
182
222
|
} catch (error) {
|
|
183
223
|
console.error('Logout all devices failed:', error);
|
|
184
|
-
_reactNative.Alert.alert('Logout Failed', 'There was a problem
|
|
224
|
+
_reactNative.Alert.alert('Logout Failed', 'There was a problem signing out from other devices. Please try again.');
|
|
225
|
+
} finally {
|
|
226
|
+
setLoggingOutAllDevices(false);
|
|
185
227
|
}
|
|
186
228
|
}
|
|
187
229
|
}], {
|
|
188
230
|
cancelable: true
|
|
189
231
|
});
|
|
190
232
|
};
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
borderColor: isActive ? colors.accent : colors.border
|
|
233
|
+
const renderDeviceSessionItem = deviceSession => {
|
|
234
|
+
const isLoggingOut = remotingLogoutSessionId === deviceSession.sessionId;
|
|
235
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
236
|
+
style: [styles.sessionCard, {
|
|
237
|
+
backgroundColor: deviceSession.isCurrent ? colors.activeCard : colors.card,
|
|
238
|
+
borderColor: deviceSession.isCurrent ? colors.accent : colors.border,
|
|
239
|
+
borderWidth: deviceSession.isCurrent ? 2 : 1
|
|
199
240
|
}],
|
|
200
|
-
children:
|
|
201
|
-
style: styles.
|
|
202
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
203
|
-
style:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
242
|
+
style: styles.sessionHeader,
|
|
243
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
244
|
+
style: styles.userInfo,
|
|
245
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
246
|
+
style: [styles.displayName, {
|
|
247
|
+
color: colors.text
|
|
248
|
+
}],
|
|
249
|
+
numberOfLines: 1,
|
|
250
|
+
children: [deviceSession.deviceName, deviceSession.isCurrent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
251
|
+
style: [styles.username, {
|
|
252
|
+
color: colors.accent
|
|
253
|
+
}],
|
|
254
|
+
children: ' (This Device)'
|
|
255
|
+
})]
|
|
256
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
257
|
+
style: [styles.username, {
|
|
258
|
+
color: colors.secondaryText
|
|
259
|
+
}],
|
|
260
|
+
numberOfLines: 1,
|
|
261
|
+
children: ["ID: ...", deviceSession.deviceId.slice(-8)]
|
|
262
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
263
|
+
style: [styles.lastActive, {
|
|
264
|
+
color: colors.secondaryText
|
|
265
|
+
}],
|
|
266
|
+
numberOfLines: 1,
|
|
267
|
+
children: ["Last active: ", new Date(deviceSession.lastActive).toLocaleDateString()]
|
|
268
|
+
})]
|
|
269
|
+
}), !deviceSession.isCurrent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
270
|
+
style: [styles.removeButton, {
|
|
271
|
+
borderColor: colors.destructive,
|
|
272
|
+
backgroundColor: colors.background
|
|
215
273
|
}],
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
274
|
+
onPress: () => handleRemoteSessionLogout(deviceSession.sessionId, deviceSession.deviceName),
|
|
275
|
+
disabled: isLoggingOut,
|
|
276
|
+
children: isLoggingOut ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
277
|
+
color: colors.destructive,
|
|
278
|
+
size: "small"
|
|
279
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
280
|
+
style: [styles.removeButtonText, {
|
|
281
|
+
color: colors.destructive
|
|
282
|
+
}],
|
|
283
|
+
children: "Sign Out"
|
|
219
284
|
})
|
|
220
285
|
})]
|
|
286
|
+
})
|
|
287
|
+
}, deviceSession.sessionId);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// Load device sessions when device management is shown
|
|
291
|
+
(0, _react.useEffect)(() => {
|
|
292
|
+
if (showDeviceManagement && deviceSessions.length === 0) {
|
|
293
|
+
loadAllDeviceSessions();
|
|
294
|
+
}
|
|
295
|
+
}, [showDeviceManagement]);
|
|
296
|
+
const renderSessionItem = sessionWithUser => {
|
|
297
|
+
const isActive = sessionWithUser.sessionId === activeSessionId;
|
|
298
|
+
const isSwitching = switchingToUserId === sessionWithUser.sessionId;
|
|
299
|
+
const isRemoving = removingUserId === sessionWithUser.sessionId;
|
|
300
|
+
const {
|
|
301
|
+
userProfile,
|
|
302
|
+
isLoadingProfile
|
|
303
|
+
} = sessionWithUser;
|
|
304
|
+
const displayName = typeof userProfile?.name === 'object' ? userProfile.name.full || userProfile.name.first || userProfile.username : userProfile?.name || userProfile?.username || 'Unknown User';
|
|
305
|
+
const username = userProfile?.username || 'unknown';
|
|
306
|
+
const avatarUrl = userProfile?.avatar?.url;
|
|
307
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
308
|
+
style: [styles.sessionCard, {
|
|
309
|
+
backgroundColor: isActive ? colors.activeCard : colors.card,
|
|
310
|
+
borderColor: isActive ? colors.accent : colors.border,
|
|
311
|
+
borderWidth: isActive ? 2 : 1,
|
|
312
|
+
shadowColor: colors.shadow
|
|
313
|
+
}],
|
|
314
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
315
|
+
style: styles.sessionHeader,
|
|
316
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
317
|
+
style: styles.avatarContainer,
|
|
318
|
+
children: [isLoadingProfile ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
319
|
+
style: [styles.avatarPlaceholder, {
|
|
320
|
+
backgroundColor: colors.surface
|
|
321
|
+
}],
|
|
322
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
323
|
+
size: "small",
|
|
324
|
+
color: colors.accent
|
|
325
|
+
})
|
|
326
|
+
}) : avatarUrl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
327
|
+
source: {
|
|
328
|
+
uri: avatarUrl
|
|
329
|
+
},
|
|
330
|
+
style: styles.avatar
|
|
331
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
332
|
+
style: [styles.avatarPlaceholder, {
|
|
333
|
+
backgroundColor: colors.surface
|
|
334
|
+
}],
|
|
335
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
336
|
+
style: [styles.avatarText, {
|
|
337
|
+
color: colors.accent
|
|
338
|
+
}],
|
|
339
|
+
children: displayName.charAt(0).toUpperCase()
|
|
340
|
+
})
|
|
341
|
+
}), isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
342
|
+
style: [styles.activeBadge, {
|
|
343
|
+
backgroundColor: colors.success
|
|
344
|
+
}],
|
|
345
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
346
|
+
style: styles.activeBadgeText,
|
|
347
|
+
children: "\u2713"
|
|
348
|
+
})
|
|
349
|
+
})]
|
|
350
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
351
|
+
style: styles.userInfo,
|
|
352
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
353
|
+
style: [styles.displayName, {
|
|
354
|
+
color: colors.text
|
|
355
|
+
}],
|
|
356
|
+
numberOfLines: 1,
|
|
357
|
+
children: displayName
|
|
358
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
359
|
+
style: [styles.username, {
|
|
360
|
+
color: colors.secondaryText
|
|
361
|
+
}],
|
|
362
|
+
numberOfLines: 1,
|
|
363
|
+
children: ["@", username]
|
|
364
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
365
|
+
style: [styles.lastActive, {
|
|
366
|
+
color: colors.secondaryText
|
|
367
|
+
}],
|
|
368
|
+
numberOfLines: 1,
|
|
369
|
+
children: ["Last active: ", new Date(sessionWithUser.lastActive).toLocaleDateString()]
|
|
370
|
+
})]
|
|
371
|
+
})]
|
|
221
372
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
222
|
-
style: styles.
|
|
373
|
+
style: styles.sessionActions,
|
|
223
374
|
children: [!isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
224
375
|
style: [styles.switchButton, {
|
|
225
|
-
borderColor: colors.accent
|
|
376
|
+
borderColor: colors.accent,
|
|
377
|
+
backgroundColor: colors.background
|
|
226
378
|
}],
|
|
227
|
-
onPress: () => handleSwitchSession(
|
|
379
|
+
onPress: () => handleSwitchSession(sessionWithUser.sessionId),
|
|
228
380
|
disabled: isSwitching || isRemoving,
|
|
229
381
|
children: isSwitching ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
230
382
|
color: colors.accent,
|
|
@@ -237,10 +389,11 @@ const AccountSwitcherScreen = ({
|
|
|
237
389
|
})
|
|
238
390
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
239
391
|
style: [styles.removeButton, {
|
|
240
|
-
borderColor: colors.destructive
|
|
392
|
+
borderColor: colors.destructive,
|
|
393
|
+
backgroundColor: colors.background
|
|
241
394
|
}],
|
|
242
|
-
onPress: () => handleRemoveSession(
|
|
243
|
-
disabled: isSwitching || isRemoving
|
|
395
|
+
onPress: () => handleRemoveSession(sessionWithUser.sessionId),
|
|
396
|
+
disabled: isSwitching || isRemoving,
|
|
244
397
|
children: isRemoving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
245
398
|
color: colors.destructive,
|
|
246
399
|
size: "small"
|
|
@@ -252,57 +405,7 @@ const AccountSwitcherScreen = ({
|
|
|
252
405
|
})
|
|
253
406
|
})]
|
|
254
407
|
})]
|
|
255
|
-
},
|
|
256
|
-
};
|
|
257
|
-
const renderDeviceSessionItem = deviceSession => {
|
|
258
|
-
const isCurrentSession = deviceSession.isCurrent;
|
|
259
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
260
|
-
style: [styles.userItem, {
|
|
261
|
-
backgroundColor: isCurrentSession ? colors.activeCard : colors.surface,
|
|
262
|
-
borderColor: isCurrentSession ? colors.accent : colors.border
|
|
263
|
-
}],
|
|
264
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
265
|
-
style: styles.userInfo,
|
|
266
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
267
|
-
style: [styles.username, {
|
|
268
|
-
color: colors.text
|
|
269
|
-
}],
|
|
270
|
-
children: [deviceSession.deviceName, isCurrentSession && ' (This Device)']
|
|
271
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
272
|
-
style: [styles.email, {
|
|
273
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
274
|
-
}],
|
|
275
|
-
children: ["Last active: ", new Date(deviceSession.lastActive).toLocaleDateString()]
|
|
276
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
277
|
-
style: [styles.email, {
|
|
278
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
279
|
-
}],
|
|
280
|
-
children: ["Device ID: ", deviceSession.deviceId.substring(0, 8), "..."]
|
|
281
|
-
}), isCurrentSession && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
282
|
-
style: [styles.activeBadge, {
|
|
283
|
-
backgroundColor: colors.success
|
|
284
|
-
}],
|
|
285
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
286
|
-
style: styles.activeBadgeText,
|
|
287
|
-
children: "Current"
|
|
288
|
-
})
|
|
289
|
-
})]
|
|
290
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
291
|
-
style: styles.userActions,
|
|
292
|
-
children: !isCurrentSession && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
293
|
-
style: [styles.removeButton, {
|
|
294
|
-
borderColor: colors.destructive
|
|
295
|
-
}],
|
|
296
|
-
onPress: () => handleRemoteSessionLogout(deviceSession.sessionId, deviceSession.deviceName),
|
|
297
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
298
|
-
style: [styles.removeButtonText, {
|
|
299
|
-
color: colors.destructive
|
|
300
|
-
}],
|
|
301
|
-
children: "Logout"
|
|
302
|
-
})
|
|
303
|
-
})
|
|
304
|
-
})]
|
|
305
|
-
}, deviceSession.sessionId);
|
|
408
|
+
}, sessionWithUser.sessionId);
|
|
306
409
|
};
|
|
307
410
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
308
411
|
style: [styles.container, {
|
|
@@ -323,115 +426,159 @@ const AccountSwitcherScreen = ({
|
|
|
323
426
|
style: [styles.title, {
|
|
324
427
|
color: colors.text
|
|
325
428
|
}],
|
|
326
|
-
children: "
|
|
429
|
+
children: "Accounts"
|
|
327
430
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
328
|
-
style: styles.
|
|
431
|
+
style: styles.headerSpacer
|
|
329
432
|
})]
|
|
330
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
331
|
-
style: styles.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
433
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
434
|
+
style: styles.content,
|
|
435
|
+
showsVerticalScrollIndicator: false,
|
|
436
|
+
contentContainerStyle: styles.scrollContent,
|
|
437
|
+
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
438
|
+
style: styles.loadingContainer,
|
|
439
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
440
|
+
size: "large",
|
|
441
|
+
color: colors.accent
|
|
442
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
443
|
+
style: [styles.loadingText, {
|
|
444
|
+
color: colors.secondaryText
|
|
338
445
|
}],
|
|
339
|
-
children: "
|
|
340
|
-
})
|
|
341
|
-
})
|
|
342
|
-
style: styles.usersContainer,
|
|
446
|
+
children: "Loading accounts..."
|
|
447
|
+
})]
|
|
448
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
343
449
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
344
450
|
style: [styles.sectionTitle, {
|
|
345
451
|
color: colors.text
|
|
346
452
|
}],
|
|
347
|
-
children: ["
|
|
348
|
-
}),
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
354
|
-
style: [styles.sectionTitle, {
|
|
355
|
-
color: colors.text
|
|
453
|
+
children: ["Saved Accounts (", sessionsWithUsers.length, ")"]
|
|
454
|
+
}), sessionsWithUsers.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
455
|
+
style: styles.emptyState,
|
|
456
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
457
|
+
style: [styles.emptyText, {
|
|
458
|
+
color: colors.secondaryText
|
|
356
459
|
}],
|
|
357
|
-
children: "
|
|
358
|
-
})
|
|
359
|
-
|
|
360
|
-
|
|
460
|
+
children: "No saved accounts found"
|
|
461
|
+
})
|
|
462
|
+
}) : sessionsWithUsers.map(renderSessionItem), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
463
|
+
style: styles.actionsSection,
|
|
464
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
465
|
+
style: [styles.actionButton, {
|
|
466
|
+
borderColor: colors.border,
|
|
467
|
+
backgroundColor: colors.card
|
|
361
468
|
}],
|
|
362
|
-
onPress: () =>
|
|
469
|
+
onPress: () => navigate?.('SignIn'),
|
|
363
470
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
364
|
-
style: [styles.
|
|
365
|
-
color: colors.
|
|
471
|
+
style: [styles.actionButtonText, {
|
|
472
|
+
color: colors.text
|
|
473
|
+
}],
|
|
474
|
+
children: "+ Add Another Account"
|
|
475
|
+
})
|
|
476
|
+
}), sessionsWithUsers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
477
|
+
style: [styles.actionButton, styles.dangerButton, {
|
|
478
|
+
borderColor: colors.destructive,
|
|
479
|
+
backgroundColor: colors.background
|
|
480
|
+
}],
|
|
481
|
+
onPress: handleLogoutAll,
|
|
482
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
483
|
+
style: [styles.dangerButtonText, {
|
|
484
|
+
color: colors.destructive
|
|
366
485
|
}],
|
|
367
|
-
children:
|
|
486
|
+
children: "Sign Out All Accounts"
|
|
368
487
|
})
|
|
369
488
|
})]
|
|
370
|
-
}),
|
|
371
|
-
|
|
489
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
490
|
+
style: styles.actionsSection,
|
|
491
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
492
|
+
style: [styles.actionButton, {
|
|
493
|
+
borderColor: colors.border,
|
|
494
|
+
backgroundColor: colors.card
|
|
495
|
+
}],
|
|
496
|
+
onPress: () => setShowDeviceManagement(!showDeviceManagement),
|
|
497
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
498
|
+
style: [styles.actionButtonText, {
|
|
499
|
+
color: colors.text
|
|
500
|
+
}],
|
|
501
|
+
children: showDeviceManagement ? '− Hide Device Management' : '+ Manage Device Sessions'
|
|
502
|
+
})
|
|
503
|
+
})
|
|
504
|
+
}), showDeviceManagement && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
505
|
+
style: [styles.deviceManagementSection, {
|
|
506
|
+
backgroundColor: colors.card,
|
|
507
|
+
borderColor: colors.border
|
|
508
|
+
}],
|
|
509
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
510
|
+
style: [styles.sectionTitle, {
|
|
511
|
+
color: colors.text
|
|
512
|
+
}],
|
|
513
|
+
children: "Device Sessions"
|
|
514
|
+
}), loadingDeviceSessions ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
372
515
|
style: styles.loadingContainer,
|
|
373
516
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
374
|
-
|
|
375
|
-
|
|
517
|
+
size: "large",
|
|
518
|
+
color: colors.accent
|
|
376
519
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
377
520
|
style: [styles.loadingText, {
|
|
378
521
|
color: colors.secondaryText
|
|
379
522
|
}],
|
|
380
523
|
children: "Loading device sessions..."
|
|
381
524
|
})]
|
|
382
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
style: [styles.actionButton, {
|
|
386
|
-
borderColor: colors.destructive,
|
|
387
|
-
marginTop: 12
|
|
388
|
-
}],
|
|
389
|
-
onPress: handleLogoutAllDevices,
|
|
390
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
391
|
-
style: [styles.actionButtonText, {
|
|
392
|
-
color: colors.destructive
|
|
393
|
-
}],
|
|
394
|
-
children: "Logout All Other Devices"
|
|
395
|
-
})
|
|
396
|
-
})]
|
|
397
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
525
|
+
}) : deviceSessions.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
526
|
+
style: styles.emptyState,
|
|
527
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
398
528
|
style: [styles.emptyText, {
|
|
399
529
|
color: colors.secondaryText
|
|
400
530
|
}],
|
|
401
|
-
children: "No
|
|
531
|
+
children: "No device sessions found"
|
|
402
532
|
})
|
|
403
|
-
})
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
533
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
534
|
+
children: [deviceSessions.map(renderDeviceSessionItem), deviceSessions.filter(session => !session.isCurrent).length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
535
|
+
style: [styles.actionButton, styles.dangerButton, {
|
|
536
|
+
borderColor: colors.destructive,
|
|
537
|
+
backgroundColor: colors.background,
|
|
538
|
+
marginTop: 20
|
|
539
|
+
}],
|
|
540
|
+
onPress: handleLogoutAllDevices,
|
|
541
|
+
disabled: loggingOutAllDevices,
|
|
542
|
+
children: loggingOutAllDevices ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
543
|
+
color: colors.destructive,
|
|
544
|
+
size: "small"
|
|
545
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
546
|
+
style: [styles.dangerButtonText, {
|
|
547
|
+
color: colors.destructive
|
|
548
|
+
}],
|
|
549
|
+
children: "Sign Out All Other Devices"
|
|
550
|
+
})
|
|
551
|
+
})]
|
|
552
|
+
})]
|
|
553
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
554
|
+
style: styles.actionsSection,
|
|
555
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
556
|
+
style: [styles.actionButton, {
|
|
557
|
+
borderColor: colors.border,
|
|
558
|
+
backgroundColor: colors.card
|
|
415
559
|
}],
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
428
|
-
style: [styles.dangerButtonText, {
|
|
429
|
-
color: colors.destructive
|
|
560
|
+
onPress: () => navigate?.('SignIn'),
|
|
561
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
562
|
+
style: [styles.actionButtonText, {
|
|
563
|
+
color: colors.text
|
|
564
|
+
}],
|
|
565
|
+
children: "+ Add Another Account"
|
|
566
|
+
})
|
|
567
|
+
}), sessionsWithUsers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
568
|
+
style: [styles.actionButton, styles.dangerButton, {
|
|
569
|
+
borderColor: colors.destructive,
|
|
570
|
+
backgroundColor: colors.background
|
|
430
571
|
}],
|
|
431
|
-
|
|
432
|
-
|
|
572
|
+
onPress: handleLogoutAll,
|
|
573
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
574
|
+
style: [styles.dangerButtonText, {
|
|
575
|
+
color: colors.destructive
|
|
576
|
+
}],
|
|
577
|
+
children: "Sign Out All Accounts"
|
|
578
|
+
})
|
|
579
|
+
})]
|
|
433
580
|
})]
|
|
434
|
-
})
|
|
581
|
+
})
|
|
435
582
|
})]
|
|
436
583
|
});
|
|
437
584
|
};
|
|
@@ -444,168 +591,187 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
444
591
|
alignItems: 'center',
|
|
445
592
|
justifyContent: 'space-between',
|
|
446
593
|
paddingHorizontal: 20,
|
|
447
|
-
paddingTop:
|
|
448
|
-
paddingBottom:
|
|
449
|
-
borderBottomWidth: 1,
|
|
450
|
-
borderBottomColor: 'rgba(0, 0, 0, 0.1)'
|
|
594
|
+
paddingTop: 20,
|
|
595
|
+
paddingBottom: 10
|
|
451
596
|
},
|
|
452
597
|
backButton: {
|
|
453
|
-
|
|
454
|
-
paddingHorizontal: 4
|
|
598
|
+
padding: 8
|
|
455
599
|
},
|
|
456
600
|
backButtonText: {
|
|
457
601
|
fontSize: 18,
|
|
458
|
-
fontFamily: _fonts.fontFamilies.
|
|
602
|
+
fontFamily: _fonts.fontFamilies.phuduMedium
|
|
459
603
|
},
|
|
460
604
|
title: {
|
|
461
|
-
fontSize:
|
|
462
|
-
fontFamily: _fonts.fontFamilies.
|
|
605
|
+
fontSize: 24,
|
|
606
|
+
fontFamily: _fonts.fontFamilies.phuduBold,
|
|
463
607
|
textAlign: 'center'
|
|
464
608
|
},
|
|
465
|
-
|
|
466
|
-
width:
|
|
609
|
+
headerSpacer: {
|
|
610
|
+
width: 40
|
|
467
611
|
},
|
|
468
|
-
|
|
469
|
-
flex: 1
|
|
470
|
-
|
|
471
|
-
scrollContainer: {
|
|
472
|
-
padding: 20
|
|
612
|
+
content: {
|
|
613
|
+
flex: 1,
|
|
614
|
+
paddingHorizontal: 20
|
|
473
615
|
},
|
|
474
|
-
|
|
475
|
-
|
|
616
|
+
scrollContent: {
|
|
617
|
+
paddingBottom: 40
|
|
476
618
|
},
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
619
|
+
loadingContainer: {
|
|
620
|
+
flex: 1,
|
|
621
|
+
justifyContent: 'center',
|
|
622
|
+
alignItems: 'center',
|
|
623
|
+
paddingTop: 60
|
|
481
624
|
},
|
|
482
|
-
|
|
483
|
-
|
|
625
|
+
loadingText: {
|
|
626
|
+
marginTop: 16,
|
|
627
|
+
fontSize: 16,
|
|
628
|
+
fontFamily: _fonts.fontFamilies.phudu
|
|
484
629
|
},
|
|
485
630
|
sectionTitle: {
|
|
486
|
-
fontSize:
|
|
631
|
+
fontSize: 20,
|
|
487
632
|
fontFamily: _fonts.fontFamilies.phuduSemiBold,
|
|
488
|
-
marginBottom:
|
|
633
|
+
marginBottom: 20,
|
|
634
|
+
marginTop: 10
|
|
635
|
+
},
|
|
636
|
+
emptyState: {
|
|
637
|
+
alignItems: 'center',
|
|
638
|
+
paddingVertical: 40
|
|
639
|
+
},
|
|
640
|
+
emptyText: {
|
|
641
|
+
fontSize: 16,
|
|
642
|
+
fontFamily: _fonts.fontFamilies.phudu,
|
|
643
|
+
textAlign: 'center'
|
|
489
644
|
},
|
|
490
|
-
|
|
645
|
+
sessionCard: {
|
|
646
|
+
borderRadius: 16,
|
|
647
|
+
marginBottom: 16,
|
|
648
|
+
padding: 20,
|
|
649
|
+
shadowOffset: {
|
|
650
|
+
width: 0,
|
|
651
|
+
height: 2
|
|
652
|
+
},
|
|
653
|
+
shadowOpacity: 0.1,
|
|
654
|
+
shadowRadius: 8,
|
|
655
|
+
elevation: 3
|
|
656
|
+
},
|
|
657
|
+
sessionHeader: {
|
|
491
658
|
flexDirection: 'row',
|
|
492
659
|
alignItems: 'center',
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
660
|
+
marginBottom: 16
|
|
661
|
+
},
|
|
662
|
+
avatarContainer: {
|
|
663
|
+
position: 'relative',
|
|
664
|
+
marginRight: 16
|
|
665
|
+
},
|
|
666
|
+
avatar: {
|
|
667
|
+
width: 60,
|
|
668
|
+
height: 60,
|
|
669
|
+
borderRadius: 30
|
|
670
|
+
},
|
|
671
|
+
avatarPlaceholder: {
|
|
672
|
+
width: 60,
|
|
673
|
+
height: 60,
|
|
674
|
+
borderRadius: 30,
|
|
675
|
+
justifyContent: 'center',
|
|
676
|
+
alignItems: 'center'
|
|
677
|
+
},
|
|
678
|
+
avatarText: {
|
|
679
|
+
fontSize: 24,
|
|
680
|
+
fontFamily: _fonts.fontFamilies.phuduBold
|
|
681
|
+
},
|
|
682
|
+
activeBadge: {
|
|
683
|
+
position: 'absolute',
|
|
684
|
+
bottom: -2,
|
|
685
|
+
right: -2,
|
|
686
|
+
width: 20,
|
|
687
|
+
height: 20,
|
|
688
|
+
borderRadius: 10,
|
|
689
|
+
justifyContent: 'center',
|
|
690
|
+
alignItems: 'center'
|
|
691
|
+
},
|
|
692
|
+
activeBadgeText: {
|
|
693
|
+
color: 'white',
|
|
694
|
+
fontSize: 12,
|
|
695
|
+
fontFamily: _fonts.fontFamilies.phuduBold
|
|
498
696
|
},
|
|
499
697
|
userInfo: {
|
|
500
|
-
flex: 1
|
|
698
|
+
flex: 1,
|
|
699
|
+
justifyContent: 'center'
|
|
501
700
|
},
|
|
502
|
-
|
|
503
|
-
fontSize:
|
|
701
|
+
displayName: {
|
|
702
|
+
fontSize: 18,
|
|
504
703
|
fontFamily: _fonts.fontFamilies.phuduSemiBold,
|
|
505
704
|
marginBottom: 4
|
|
506
705
|
},
|
|
507
|
-
|
|
706
|
+
username: {
|
|
508
707
|
fontSize: 14,
|
|
509
708
|
fontFamily: _fonts.fontFamilies.phudu,
|
|
510
|
-
marginBottom:
|
|
511
|
-
},
|
|
512
|
-
activeBadge: {
|
|
513
|
-
paddingHorizontal: 8,
|
|
514
|
-
paddingVertical: 4,
|
|
515
|
-
borderRadius: 6,
|
|
516
|
-
alignSelf: 'flex-start'
|
|
709
|
+
marginBottom: 4
|
|
517
710
|
},
|
|
518
|
-
|
|
519
|
-
color: '#FFFFFF',
|
|
711
|
+
lastActive: {
|
|
520
712
|
fontSize: 12,
|
|
521
|
-
fontFamily: _fonts.fontFamilies.
|
|
713
|
+
fontFamily: _fonts.fontFamilies.phudu
|
|
522
714
|
},
|
|
523
|
-
|
|
715
|
+
sessionActions: {
|
|
524
716
|
flexDirection: 'row',
|
|
525
|
-
|
|
717
|
+
justifyContent: 'space-between',
|
|
718
|
+
gap: 12
|
|
526
719
|
},
|
|
527
720
|
switchButton: {
|
|
528
|
-
|
|
529
|
-
paddingVertical:
|
|
530
|
-
|
|
721
|
+
flex: 1,
|
|
722
|
+
paddingVertical: 12,
|
|
723
|
+
paddingHorizontal: 20,
|
|
531
724
|
borderWidth: 1,
|
|
532
|
-
|
|
533
|
-
alignItems: 'center'
|
|
725
|
+
borderRadius: 8,
|
|
726
|
+
alignItems: 'center',
|
|
727
|
+
justifyContent: 'center'
|
|
534
728
|
},
|
|
535
729
|
switchButtonText: {
|
|
536
730
|
fontSize: 14,
|
|
537
|
-
fontFamily: _fonts.fontFamilies.
|
|
731
|
+
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
538
732
|
},
|
|
539
733
|
removeButton: {
|
|
540
|
-
|
|
541
|
-
paddingVertical:
|
|
542
|
-
|
|
734
|
+
flex: 1,
|
|
735
|
+
paddingVertical: 12,
|
|
736
|
+
paddingHorizontal: 20,
|
|
543
737
|
borderWidth: 1,
|
|
544
|
-
|
|
545
|
-
alignItems: 'center'
|
|
738
|
+
borderRadius: 8,
|
|
739
|
+
alignItems: 'center',
|
|
740
|
+
justifyContent: 'center'
|
|
546
741
|
},
|
|
547
742
|
removeButtonText: {
|
|
548
743
|
fontSize: 14,
|
|
549
|
-
fontFamily: _fonts.fontFamilies.
|
|
744
|
+
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
550
745
|
},
|
|
551
|
-
|
|
746
|
+
actionsSection: {
|
|
747
|
+
marginTop: 40,
|
|
552
748
|
gap: 16
|
|
553
749
|
},
|
|
554
750
|
actionButton: {
|
|
555
751
|
paddingVertical: 16,
|
|
556
752
|
paddingHorizontal: 20,
|
|
557
|
-
borderRadius: 12,
|
|
558
753
|
borderWidth: 1,
|
|
559
|
-
|
|
754
|
+
borderRadius: 12,
|
|
755
|
+
alignItems: 'center',
|
|
756
|
+
justifyContent: 'center'
|
|
560
757
|
},
|
|
561
758
|
actionButtonText: {
|
|
562
759
|
fontSize: 16,
|
|
563
|
-
fontFamily: _fonts.fontFamilies.
|
|
760
|
+
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
564
761
|
},
|
|
565
762
|
dangerButton: {
|
|
566
|
-
|
|
567
|
-
paddingHorizontal: 20,
|
|
568
|
-
borderRadius: 12,
|
|
569
|
-
alignItems: 'center'
|
|
763
|
+
// Additional styles for danger buttons if needed
|
|
570
764
|
},
|
|
571
765
|
dangerButtonText: {
|
|
572
766
|
fontSize: 16,
|
|
573
|
-
fontFamily: _fonts.fontFamilies.
|
|
574
|
-
},
|
|
575
|
-
sectionHeader: {
|
|
576
|
-
flexDirection: 'row',
|
|
577
|
-
alignItems: 'center',
|
|
578
|
-
justifyContent: 'space-between',
|
|
579
|
-
marginBottom: 16
|
|
767
|
+
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
580
768
|
},
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
borderRadius:
|
|
769
|
+
deviceManagementSection: {
|
|
770
|
+
marginTop: 20,
|
|
771
|
+
padding: 16,
|
|
772
|
+
borderRadius: 12,
|
|
585
773
|
borderWidth: 1
|
|
586
|
-
},
|
|
587
|
-
toggleButtonText: {
|
|
588
|
-
fontSize: 14,
|
|
589
|
-
fontFamily: _fonts.fontFamilies.phuduMedium
|
|
590
|
-
},
|
|
591
|
-
loadingContainer: {
|
|
592
|
-
flexDirection: 'row',
|
|
593
|
-
alignItems: 'center',
|
|
594
|
-
justifyContent: 'center',
|
|
595
|
-
paddingVertical: 20,
|
|
596
|
-
gap: 8
|
|
597
|
-
},
|
|
598
|
-
loadingText: {
|
|
599
|
-
fontSize: 14,
|
|
600
|
-
fontFamily: _fonts.fontFamilies.phudu
|
|
601
|
-
},
|
|
602
|
-
emptyText: {
|
|
603
|
-
fontSize: 14,
|
|
604
|
-
fontFamily: _fonts.fontFamilies.phudu,
|
|
605
|
-
textAlign: 'center',
|
|
606
|
-
paddingVertical: 20,
|
|
607
|
-
fontStyle: 'italic'
|
|
608
774
|
}
|
|
609
775
|
});
|
|
610
|
-
var _default = exports.default =
|
|
776
|
+
var _default = exports.default = ModernAccountSwitcherScreen;
|
|
611
777
|
//# sourceMappingURL=AccountSwitcherScreen.js.map
|