@adminide-stack/yantra-mobile 12.0.54 → 12.0.55-alpha.0
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/components/CustomDrawer.js +203 -150
- package/lib/components/CustomDrawer.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderMoreMenu.js +9 -2
- package/lib/components/NavigationHeader/HeaderMoreMenu.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderSettingsMenu.js +2 -2
- package/lib/components/NavigationHeader/HeaderSettingsMenu.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderToolbarButton.js +4 -1
- package/lib/components/NavigationHeader/HeaderToolbarButton.js.map +1 -1
- package/lib/components/NavigationHeader/NavigationHeader.js +4 -3
- package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
- package/lib/components/ProfileAvatar.js +44 -0
- package/lib/components/ProfileAvatar.js.map +1 -0
- package/lib/compute.js +53 -1
- package/lib/compute.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +55 -0
- package/lib/screens/Account/index.js +393 -0
- package/lib/screens/Account/index.js.map +1 -0
- package/lib/screens/Account/splitDisplayName.js +15 -0
- package/lib/screens/Account/splitDisplayName.js.map +1 -0
- package/lib/screens/Chat/index.js +4 -3
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +4 -3
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/HomeSuggestions.js +1 -1
- package/lib/screens/Home/components/HomeSuggestions.js.map +1 -1
- package/lib/theme/AppThemeProvider.js +74 -0
- package/lib/theme/AppThemeProvider.js.map +1 -0
- package/lib/theme/appTheme.js +9 -0
- package/lib/theme/appTheme.js.map +1 -0
- package/lib/theme/mobileTokens.js +52 -13
- package/lib/theme/mobileTokens.js.map +1 -1
- package/lib/utils/authUserDisplay.js +27 -9
- package/lib/utils/authUserDisplay.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useMemo,useCallback,useEffect}from'react';import {StyleSheet,View,Image,Pressable,ActivityIndicator}from'react-native';import {DrawerContentScrollView}from'@react-navigation/drawer';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useRoute,CommonActions}from'@react-navigation/native';import {afterNativeModalClose}from'../utils/drawerNavigation.js';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useDispatch,useSelector}from'react-redux';import {userSelector,logoutAndRedirect}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery}from'common/graphql';import {mobileTokens}from'../theme/mobileTokens.js';import {pickAuthEmail,pickPrimaryDisplayName,
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useMemo,useCallback,useEffect}from'react';import {StyleSheet,View,Image,Pressable,ActivityIndicator}from'react-native';import {DrawerContentScrollView}from'@react-navigation/drawer';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useRoute,CommonActions}from'@react-navigation/native';import {afterNativeModalClose}from'../utils/drawerNavigation.js';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useDispatch,useSelector}from'react-redux';import {userSelector,logoutAndRedirect}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery}from'common/graphql';import {mobileTokens,mobileColors}from'../theme/mobileTokens.js';import {useAppTheme}from'../theme/AppThemeProvider.js';import {pickAuthEmail,pickPrimaryDisplayName,pickProfilePhotoUrl}from'../utils/authUserDisplay.js';import {ProfileAvatar}from'./ProfileAvatar.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -18,15 +18,22 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
const APP_ICON = require("../assets/icon.png");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
function drawerPalette(isDark) {
|
|
22
|
+
const color = mobileColors(isDark);
|
|
23
|
+
return {
|
|
24
|
+
bg: color.bg,
|
|
25
|
+
surface: color.surface,
|
|
26
|
+
border: color.border,
|
|
27
|
+
text: color.text,
|
|
28
|
+
textSecondary: color.textMuted,
|
|
29
|
+
icon: isDark ? "#cbd5e1" : "#334155",
|
|
30
|
+
rowHighlight: isDark ? "rgba(148,163,184,0.12)" : color.primarySoft,
|
|
31
|
+
focusedText: isDark ? "#f8fafc" : color.primary,
|
|
32
|
+
chevron: isDark ? "#64748b" : "#c4c4c4",
|
|
33
|
+
surfaceMuted: color.surfaceMuted,
|
|
34
|
+
primaryBorder: color.primaryBorder
|
|
35
|
+
};
|
|
36
|
+
}
|
|
30
37
|
function routeLabel(descriptor, route) {
|
|
31
38
|
var _a, _b, _c;
|
|
32
39
|
const optLabel = (_a = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _a.drawerLabel;
|
|
@@ -42,7 +49,7 @@ function isVisibleDrawerRoute(route, descriptor) {
|
|
|
42
49
|
if (routeName.includes("WebBuilder") || routeName.toLowerCase().includes("webbuilder")) {
|
|
43
50
|
return false;
|
|
44
51
|
}
|
|
45
|
-
if (/ChatHistory/i.test(routeName) || /CanvasNative/i.test(routeName) || /(^|\.)Apps$/i.test(routeName)) {
|
|
52
|
+
if (/ChatHistory/i.test(routeName) || /CanvasNative/i.test(routeName) || /(^|\.)Apps$/i.test(routeName) || /(^|\.)Account$/i.test(routeName)) {
|
|
46
53
|
return false;
|
|
47
54
|
}
|
|
48
55
|
const itemStyle = (_b = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _b.drawerItemStyle;
|
|
@@ -70,23 +77,64 @@ function DrawerListRow({
|
|
|
70
77
|
focused,
|
|
71
78
|
onPress,
|
|
72
79
|
showDivider,
|
|
73
|
-
iconNode
|
|
80
|
+
iconNode,
|
|
81
|
+
palette
|
|
74
82
|
}) {
|
|
75
83
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
76
84
|
/* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityState: {
|
|
77
85
|
selected: Boolean(focused)
|
|
78
86
|
}, onPress, style: ({
|
|
79
87
|
pressed
|
|
80
|
-
}) => [styles.listRow,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */ jsx(Ionicons, { name: "
|
|
88
|
+
}) => [styles.listRow, {
|
|
89
|
+
backgroundColor: focused || pressed ? palette.rowHighlight : palette.surface
|
|
90
|
+
}], children: [
|
|
91
|
+
iconNode != null ? iconNode : /* @__PURE__ */ jsx(Ionicons, { name: icon != null ? icon : "ellipse-outline", size: 22, color: focused ? palette.focusedText : palette.icon }),
|
|
92
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.listLabel, {
|
|
93
|
+
color: focused ? palette.focusedText : palette.text
|
|
94
|
+
}, focused && styles.listLabelFocused], children: label }),
|
|
95
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: palette.chevron, style: styles.navChevron })
|
|
84
96
|
] }),
|
|
85
|
-
showDivider ? /* @__PURE__ */ jsx(View, { style: styles.rowDivider
|
|
97
|
+
showDivider ? /* @__PURE__ */ jsx(View, { style: [styles.rowDivider, {
|
|
98
|
+
backgroundColor: palette.border
|
|
99
|
+
}] }) : null
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
function DrawerAppearanceRow({
|
|
103
|
+
isDark,
|
|
104
|
+
onChange,
|
|
105
|
+
palette
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ jsxs(View, { accessibilityRole: "adjustable", accessibilityLabel: "Appearance", style: [styles.listRow, styles.appearanceRow, {
|
|
108
|
+
backgroundColor: palette.surface,
|
|
109
|
+
borderColor: palette.border
|
|
110
|
+
}], children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "contrast-outline", size: 20, color: palette.icon }),
|
|
112
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.listLabel, {
|
|
113
|
+
color: palette.text
|
|
114
|
+
}], children: "Appearance" }),
|
|
115
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.appearanceToggle, {
|
|
116
|
+
backgroundColor: palette.surfaceMuted,
|
|
117
|
+
borderColor: palette.border
|
|
118
|
+
}], children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Light", accessibilityState: {
|
|
120
|
+
selected: !isDark
|
|
121
|
+
}, onPress: () => onChange(false), style: [styles.appearanceToggleBtn, !isDark && {
|
|
122
|
+
backgroundColor: palette.rowHighlight,
|
|
123
|
+
borderColor: palette.primaryBorder
|
|
124
|
+
}], hitSlop: 4, children: /* @__PURE__ */ jsx(Ionicons, { name: !isDark ? "sunny" : "sunny-outline", size: 16, color: !isDark ? palette.focusedText : palette.icon }) }),
|
|
125
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Dark", accessibilityState: {
|
|
126
|
+
selected: isDark
|
|
127
|
+
}, onPress: () => onChange(true), style: [styles.appearanceToggleBtn, isDark && {
|
|
128
|
+
backgroundColor: palette.rowHighlight,
|
|
129
|
+
borderColor: palette.primaryBorder
|
|
130
|
+
}], hitSlop: 4, children: /* @__PURE__ */ jsx(Ionicons, { name: isDark ? "moon" : "moon-outline", size: 16, color: isDark ? palette.focusedText : palette.icon }) })
|
|
131
|
+
] })
|
|
86
132
|
] });
|
|
87
133
|
}
|
|
88
134
|
function DrawerProfileHeader({
|
|
89
|
-
isAuthenticated
|
|
135
|
+
isAuthenticated,
|
|
136
|
+
onPress,
|
|
137
|
+
palette
|
|
90
138
|
}) {
|
|
91
139
|
var _a;
|
|
92
140
|
const authUser = useSelector(userSelector);
|
|
@@ -98,30 +146,30 @@ function DrawerProfileHeader({
|
|
|
98
146
|
skip: !isAuthenticated
|
|
99
147
|
});
|
|
100
148
|
const photoUrl = useMemo(() => {
|
|
101
|
-
var _a2
|
|
102
|
-
|
|
103
|
-
if (fromProfile) return fromProfile;
|
|
104
|
-
return pickAuthPicture(authUser);
|
|
149
|
+
var _a2;
|
|
150
|
+
return pickProfilePhotoUrl((_a2 = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a2.photos, authUser);
|
|
105
151
|
}, [(_a = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a.photos, authUser]);
|
|
106
152
|
const displayName = useMemo(() => pickPrimaryDisplayName(authUser), [authUser]);
|
|
107
153
|
const email = useMemo(() => pickAuthEmail(authUser), [authUser]);
|
|
108
|
-
const subtitle = useMemo(() => {
|
|
109
|
-
var _a2, _b, _c;
|
|
110
|
-
const u = authUser;
|
|
111
|
-
const nick = ((_c = (_b = (_a2 = u == null ? void 0 : u.profile) == null ? void 0 : _a2.nickname) != null ? _b : u == null ? void 0 : u.nickname) != null ? _c : "").trim();
|
|
112
|
-
if (!nick || nick === displayName.trim()) return null;
|
|
113
|
-
return `@${nick.replace(/^@/, "")}`;
|
|
114
|
-
}, [authUser, displayName]);
|
|
115
154
|
if (!isAuthenticated) return null;
|
|
116
|
-
return /* @__PURE__ */ jsx(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
return /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Account", onPress, style: ({
|
|
156
|
+
pressed
|
|
157
|
+
}) => [styles.profileCard, {
|
|
158
|
+
backgroundColor: palette.surface,
|
|
159
|
+
borderColor: palette.border
|
|
160
|
+
}, pressed && {
|
|
161
|
+
backgroundColor: palette.rowHighlight
|
|
162
|
+
}], children: /* @__PURE__ */ jsxs(View, { style: styles.profileCardInner, children: [
|
|
163
|
+
/* @__PURE__ */ jsx(ProfileAvatar, { uri: photoUrl, name: displayName, size: 44 }),
|
|
120
164
|
/* @__PURE__ */ jsxs(View, { style: styles.profileMeta, children: [
|
|
121
|
-
/* @__PURE__ */ jsx(Text, { style: styles.profileName,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
165
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.profileName, {
|
|
166
|
+
color: palette.text
|
|
167
|
+
}], numberOfLines: 1, children: displayName }),
|
|
168
|
+
email ? /* @__PURE__ */ jsx(Text, { style: [styles.profileEmail, {
|
|
169
|
+
color: palette.textSecondary
|
|
170
|
+
}], numberOfLines: 1, children: email }) : null
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 18, color: palette.chevron })
|
|
125
173
|
] }) });
|
|
126
174
|
}
|
|
127
175
|
function CustomDrawer(props) {
|
|
@@ -137,6 +185,11 @@ function CustomDrawer(props) {
|
|
|
137
185
|
const route = useRoute();
|
|
138
186
|
const insets = useSafeAreaInsets();
|
|
139
187
|
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
188
|
+
const {
|
|
189
|
+
isDark,
|
|
190
|
+
setDarkMode
|
|
191
|
+
} = useAppTheme();
|
|
192
|
+
const palette = useMemo(() => drawerPalette(isDark), [isDark]);
|
|
140
193
|
const orgName = useMemo(() => pickFocusedOrgName(state, route), [state, route]);
|
|
141
194
|
const focusedRouteName = String((_c = (_b = (_a = state == null ? void 0 : state.routes) == null ? void 0 : _a[state == null ? void 0 : state.index]) == null ? void 0 : _b.name) != null ? _c : "");
|
|
142
195
|
const historyFocused = /ChatHistory/i.test(focusedRouteName);
|
|
@@ -216,19 +269,41 @@ function CustomDrawer(props) {
|
|
|
216
269
|
} : void 0);
|
|
217
270
|
});
|
|
218
271
|
}, [isLoggingOut, navigation, orgName]);
|
|
272
|
+
const handleOpenAccount = useCallback(() => {
|
|
273
|
+
var _a2;
|
|
274
|
+
if (isLoggingOut) return;
|
|
275
|
+
(_a2 = navigation == null ? void 0 : navigation.closeDrawer) == null ? void 0 : _a2.call(navigation);
|
|
276
|
+
afterNativeModalClose(() => {
|
|
277
|
+
var _a3;
|
|
278
|
+
(_a3 = navigation == null ? void 0 : navigation.navigate) == null ? void 0 : _a3.call(navigation, "MainStack.Account", orgName ? {
|
|
279
|
+
orgName
|
|
280
|
+
} : void 0);
|
|
281
|
+
});
|
|
282
|
+
}, [isLoggingOut, navigation, orgName]);
|
|
219
283
|
useEffect(() => {
|
|
220
284
|
if (authUser) {
|
|
221
285
|
setIsLoggingOut(false);
|
|
222
286
|
}
|
|
223
287
|
}, [authUser]);
|
|
224
|
-
return /* @__PURE__ */ jsx(SafeAreaView, { style: styles.safeArea,
|
|
225
|
-
|
|
226
|
-
|
|
288
|
+
return /* @__PURE__ */ jsx(SafeAreaView, { style: [styles.safeArea, {
|
|
289
|
+
backgroundColor: palette.bg
|
|
290
|
+
}], edges: ["left", "bottom"], children: /* @__PURE__ */ jsxs(View, { style: styles.drawerColumn, children: [
|
|
291
|
+
/* @__PURE__ */ jsxs(DrawerContentScrollView, __spreadProps(__spreadValues({}, props), { style: [styles.scroll, {
|
|
292
|
+
backgroundColor: palette.bg
|
|
293
|
+
}], contentContainerStyle: scrollContentStyle, children: [
|
|
294
|
+
/* @__PURE__ */ jsx(View, { style: [styles.brandBlock, {
|
|
295
|
+
borderBottomColor: palette.border
|
|
296
|
+
}], children: /* @__PURE__ */ jsxs(View, { style: styles.brandStrip, children: [
|
|
227
297
|
/* @__PURE__ */ jsx(Image, { source: APP_ICON, style: styles.brandIconSmall, resizeMode: "contain" }),
|
|
228
|
-
/* @__PURE__ */ jsx(Text, { style: styles.brandStripTitle,
|
|
298
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.brandStripTitle, {
|
|
299
|
+
color: palette.text
|
|
300
|
+
}], children: "Yantra" })
|
|
229
301
|
] }) }),
|
|
230
|
-
/* @__PURE__ */ jsx(DrawerProfileHeader, { isAuthenticated }),
|
|
231
|
-
isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: styles.menuCard,
|
|
302
|
+
/* @__PURE__ */ jsx(DrawerProfileHeader, { isAuthenticated, onPress: handleOpenAccount, palette }),
|
|
303
|
+
isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: [styles.menuCard, {
|
|
304
|
+
backgroundColor: palette.surface,
|
|
305
|
+
borderColor: palette.border
|
|
306
|
+
}], children: [
|
|
232
307
|
visibleRoutes.map((r) => {
|
|
233
308
|
var _a2, _b2;
|
|
234
309
|
const descriptor = descriptors == null ? void 0 : descriptors[r.key];
|
|
@@ -236,8 +311,8 @@ function CustomDrawer(props) {
|
|
|
236
311
|
const label = routeLabel(descriptor, r);
|
|
237
312
|
const iconFn = (_b2 = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _b2.drawerIcon;
|
|
238
313
|
const fallbackIcon = label.trim().toLowerCase() === "chat" ? "chatbubbles-outline" : "home-outline";
|
|
239
|
-
return /* @__PURE__ */ jsx(DrawerListRow, { label, focused, showDivider: true, icon: fallbackIcon, iconNode: typeof iconFn === "function" ? iconFn({
|
|
240
|
-
color: focused ?
|
|
314
|
+
return /* @__PURE__ */ jsx(DrawerListRow, { label, focused, showDivider: true, icon: fallbackIcon, palette, iconNode: typeof iconFn === "function" ? iconFn({
|
|
315
|
+
color: focused ? palette.focusedText : palette.icon,
|
|
241
316
|
size: 22,
|
|
242
317
|
focused
|
|
243
318
|
}) : void 0, onPress: () => {
|
|
@@ -247,14 +322,21 @@ function CustomDrawer(props) {
|
|
|
247
322
|
} : void 0);
|
|
248
323
|
} }, r.key);
|
|
249
324
|
}),
|
|
250
|
-
/* @__PURE__ */ jsx(DrawerListRow, { icon: "apps-outline", label: "Apps", focused: appsFocused, onPress: handleOpenApps, showDivider: true }),
|
|
251
|
-
/* @__PURE__ */ jsx(DrawerListRow, { icon: "time-outline", label: "History", focused: historyFocused, onPress: handleOpenHistory, showDivider: true }),
|
|
252
|
-
/* @__PURE__ */ jsx(DrawerListRow, { icon: "card-outline", label: "Billing", focused: billingFocused, onPress: handleOpenBilling })
|
|
325
|
+
/* @__PURE__ */ jsx(DrawerListRow, { icon: "apps-outline", label: "Apps", focused: appsFocused, onPress: handleOpenApps, showDivider: true, palette }),
|
|
326
|
+
/* @__PURE__ */ jsx(DrawerListRow, { icon: "time-outline", label: "History", focused: historyFocused, onPress: handleOpenHistory, showDivider: true, palette }),
|
|
327
|
+
/* @__PURE__ */ jsx(DrawerListRow, { icon: "card-outline", label: "Billing", focused: billingFocused, onPress: handleOpenBilling, palette })
|
|
253
328
|
] }) : null,
|
|
254
|
-
!isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: styles.loggedOutStateCard,
|
|
329
|
+
!isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: [styles.loggedOutStateCard, {
|
|
330
|
+
backgroundColor: palette.surface,
|
|
331
|
+
borderColor: palette.border
|
|
332
|
+
}], children: [
|
|
255
333
|
/* @__PURE__ */ jsx(View, { style: styles.loggedOutStateIconWrap, children: /* @__PURE__ */ jsx(Ionicons, { name: "shield-checkmark-outline", size: 22, color: mobileTokens.color.primary }) }),
|
|
256
|
-
/* @__PURE__ */ jsx(Text, { style: styles.loggedOutStateTitle,
|
|
257
|
-
|
|
334
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.loggedOutStateTitle, {
|
|
335
|
+
color: palette.text
|
|
336
|
+
}], children: "Sign in to continue" }),
|
|
337
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.loggedOutStateSubtitle, {
|
|
338
|
+
color: palette.textSecondary
|
|
339
|
+
}], children: "Access your chat history, profile, and personalized workspace after login." }),
|
|
258
340
|
/* @__PURE__ */ jsxs(Pressable, { onPress: handleLogin, accessibilityRole: "button", accessibilityLabel: "Log in", style: ({
|
|
259
341
|
pressed
|
|
260
342
|
}) => [styles.loggedOutStateButton, pressed && styles.loggedOutStateButtonPressed], children: [
|
|
@@ -263,18 +345,29 @@ function CustomDrawer(props) {
|
|
|
263
345
|
] })
|
|
264
346
|
] }) : null
|
|
265
347
|
] })),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
/* @__PURE__ */ jsx(
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
|
|
348
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.footerStack, {
|
|
349
|
+
backgroundColor: palette.bg
|
|
350
|
+
}], children: [
|
|
351
|
+
/* @__PURE__ */ jsx(DrawerAppearanceRow, { isDark, onChange: setDarkMode, palette }),
|
|
352
|
+
showLogout && isAuthenticated ? /* @__PURE__ */ jsxs(Pressable, { onPress: handleLogout, disabled: isLoggingOut, accessibilityRole: "button", accessibilityLabel: "Log out", style: ({
|
|
353
|
+
pressed
|
|
354
|
+
}) => [styles.logoutButton, {
|
|
355
|
+
backgroundColor: pressed && !isLoggingOut ? palette.rowHighlight : palette.surface,
|
|
356
|
+
borderColor: palette.border
|
|
357
|
+
}], children: [
|
|
358
|
+
isLoggingOut ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.icon }) : /* @__PURE__ */ jsx(Ionicons, { name: "log-out-outline", size: 22, color: palette.icon }),
|
|
359
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.logoutLabel, {
|
|
360
|
+
color: palette.text
|
|
361
|
+
}], children: isLoggingOut ? "Logging out..." : "Log out" })
|
|
362
|
+
] }) : showLogout ? /* @__PURE__ */ jsx(Text, { style: [styles.loggedOutFooterHint, {
|
|
363
|
+
color: palette.textSecondary
|
|
364
|
+
}], children: "You are currently signed out" }) : null
|
|
365
|
+
] })
|
|
272
366
|
] }) });
|
|
273
367
|
}
|
|
274
368
|
const styles = StyleSheet.create({
|
|
275
369
|
safeArea: {
|
|
276
|
-
flex: 1
|
|
277
|
-
backgroundColor: PALETTE.bg
|
|
370
|
+
flex: 1
|
|
278
371
|
},
|
|
279
372
|
drawerColumn: {
|
|
280
373
|
flex: 1
|
|
@@ -290,8 +383,7 @@ const styles = StyleSheet.create({
|
|
|
290
383
|
brandBlock: {
|
|
291
384
|
marginBottom: 16,
|
|
292
385
|
paddingBottom: 14,
|
|
293
|
-
borderBottomWidth: StyleSheet.hairlineWidth
|
|
294
|
-
borderBottomColor: PALETTE.border
|
|
386
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
295
387
|
},
|
|
296
388
|
brandStrip: {
|
|
297
389
|
flexDirection: "row",
|
|
@@ -304,108 +396,63 @@ const styles = StyleSheet.create({
|
|
|
304
396
|
borderRadius: 10
|
|
305
397
|
},
|
|
306
398
|
brandStripTitle: {
|
|
307
|
-
color: PALETTE.text,
|
|
308
399
|
fontSize: 22,
|
|
309
400
|
fontWeight: "800",
|
|
310
401
|
letterSpacing: -0.6
|
|
311
402
|
},
|
|
312
403
|
profileCard: {
|
|
313
|
-
borderRadius:
|
|
404
|
+
borderRadius: 20,
|
|
314
405
|
overflow: "hidden",
|
|
315
406
|
marginBottom: 20,
|
|
316
|
-
|
|
317
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
318
|
-
borderColor: PALETTE.border
|
|
407
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
319
408
|
},
|
|
320
409
|
profileCardInner: {
|
|
321
410
|
flexDirection: "row",
|
|
322
|
-
padding: 16,
|
|
323
|
-
gap: 14
|
|
324
|
-
},
|
|
325
|
-
avatarOuter: {
|
|
326
|
-
width: 56,
|
|
327
|
-
height: 56,
|
|
328
|
-
borderRadius: 28,
|
|
329
|
-
overflow: "hidden",
|
|
330
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
331
|
-
borderColor: PALETTE.border,
|
|
332
|
-
backgroundColor: PALETTE.rowHighlight
|
|
333
|
-
},
|
|
334
|
-
avatarImage: {
|
|
335
|
-
width: "100%",
|
|
336
|
-
height: "100%"
|
|
337
|
-
},
|
|
338
|
-
avatarPlaceholder: {
|
|
339
|
-
flex: 1,
|
|
340
411
|
alignItems: "center",
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
fontSize: 20,
|
|
346
|
-
fontWeight: "700",
|
|
347
|
-
color: mobileTokens.color.primary,
|
|
348
|
-
letterSpacing: 0.3
|
|
412
|
+
paddingVertical: 14,
|
|
413
|
+
paddingLeft: 14,
|
|
414
|
+
paddingRight: 12,
|
|
415
|
+
gap: 12
|
|
349
416
|
},
|
|
350
417
|
profileMeta: {
|
|
351
418
|
flex: 1,
|
|
352
419
|
minWidth: 0,
|
|
353
|
-
justifyContent: "center"
|
|
420
|
+
justifyContent: "center",
|
|
421
|
+
gap: 2
|
|
354
422
|
},
|
|
355
423
|
profileName: {
|
|
356
|
-
fontSize:
|
|
424
|
+
fontSize: 16,
|
|
357
425
|
fontWeight: "600",
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
lineHeight: 24
|
|
361
|
-
},
|
|
362
|
-
profileUsername: {
|
|
363
|
-
marginTop: 4,
|
|
364
|
-
fontSize: 14,
|
|
365
|
-
fontWeight: "500",
|
|
366
|
-
color: PALETTE.textSecondary,
|
|
367
|
-
letterSpacing: -0.1
|
|
426
|
+
letterSpacing: -0.2,
|
|
427
|
+
lineHeight: 20
|
|
368
428
|
},
|
|
369
429
|
profileEmail: {
|
|
370
|
-
marginTop: 6,
|
|
371
430
|
fontSize: 13,
|
|
372
431
|
fontWeight: "400",
|
|
373
|
-
|
|
432
|
+
lineHeight: 17
|
|
374
433
|
},
|
|
375
434
|
menuCard: {
|
|
376
435
|
borderRadius: 16,
|
|
377
436
|
overflow: "hidden",
|
|
378
|
-
|
|
379
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
380
|
-
borderColor: PALETTE.border
|
|
437
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
381
438
|
},
|
|
382
439
|
listRow: {
|
|
383
440
|
flexDirection: "row",
|
|
384
441
|
alignItems: "center",
|
|
385
442
|
paddingVertical: 15,
|
|
386
443
|
paddingHorizontal: 16,
|
|
387
|
-
gap: 14
|
|
388
|
-
backgroundColor: PALETTE.surface
|
|
389
|
-
},
|
|
390
|
-
listRowFocused: {
|
|
391
|
-
backgroundColor: PALETTE.rowHighlight
|
|
392
|
-
},
|
|
393
|
-
listRowPressed: {
|
|
394
|
-
backgroundColor: PALETTE.rowHighlight
|
|
444
|
+
gap: 14
|
|
395
445
|
},
|
|
396
446
|
listLabel: {
|
|
397
447
|
flex: 1,
|
|
398
448
|
fontSize: 16,
|
|
399
|
-
fontWeight: "400"
|
|
400
|
-
color: PALETTE.text
|
|
449
|
+
fontWeight: "400"
|
|
401
450
|
},
|
|
402
451
|
listLabelFocused: {
|
|
403
|
-
fontWeight: "600"
|
|
404
|
-
color: mobileTokens.color.primary
|
|
452
|
+
fontWeight: "600"
|
|
405
453
|
},
|
|
406
454
|
rowDivider: {
|
|
407
455
|
height: StyleSheet.hairlineWidth,
|
|
408
|
-
backgroundColor: PALETTE.border,
|
|
409
456
|
marginLeft: 52
|
|
410
457
|
},
|
|
411
458
|
loggedOutStateCard: {
|
|
@@ -413,9 +460,7 @@ const styles = StyleSheet.create({
|
|
|
413
460
|
borderRadius: 14,
|
|
414
461
|
paddingHorizontal: 16,
|
|
415
462
|
paddingVertical: 18,
|
|
416
|
-
backgroundColor: PALETTE.surface,
|
|
417
463
|
borderWidth: StyleSheet.hairlineWidth,
|
|
418
|
-
borderColor: PALETTE.border,
|
|
419
464
|
alignItems: "center",
|
|
420
465
|
gap: 10
|
|
421
466
|
},
|
|
@@ -432,13 +477,11 @@ const styles = StyleSheet.create({
|
|
|
432
477
|
loggedOutStateTitle: {
|
|
433
478
|
fontSize: 17,
|
|
434
479
|
fontWeight: "700",
|
|
435
|
-
color: PALETTE.text,
|
|
436
480
|
letterSpacing: -0.2
|
|
437
481
|
},
|
|
438
482
|
loggedOutStateSubtitle: {
|
|
439
483
|
fontSize: 13,
|
|
440
484
|
lineHeight: 19,
|
|
441
|
-
color: PALETTE.textSecondary,
|
|
442
485
|
textAlign: "center",
|
|
443
486
|
paddingHorizontal: 4
|
|
444
487
|
},
|
|
@@ -463,43 +506,53 @@ const styles = StyleSheet.create({
|
|
|
463
506
|
navChevron: {
|
|
464
507
|
marginLeft: "auto"
|
|
465
508
|
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
509
|
+
appearanceRow: {
|
|
510
|
+
borderRadius: 16,
|
|
511
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
512
|
+
marginBottom: 10,
|
|
513
|
+
paddingVertical: 8,
|
|
514
|
+
paddingHorizontal: 12,
|
|
515
|
+
gap: 10
|
|
473
516
|
},
|
|
474
|
-
|
|
517
|
+
appearanceToggle: {
|
|
475
518
|
flexDirection: "row",
|
|
476
519
|
alignItems: "center",
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
520
|
+
marginLeft: "auto",
|
|
521
|
+
borderRadius: 8,
|
|
522
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
523
|
+
padding: 2,
|
|
524
|
+
gap: 1
|
|
481
525
|
},
|
|
482
|
-
|
|
483
|
-
width:
|
|
484
|
-
height:
|
|
485
|
-
borderRadius:
|
|
486
|
-
backgroundColor: "#fef2f2",
|
|
526
|
+
appearanceToggleBtn: {
|
|
527
|
+
width: 28,
|
|
528
|
+
height: 28,
|
|
529
|
+
borderRadius: 6,
|
|
487
530
|
alignItems: "center",
|
|
488
|
-
justifyContent: "center"
|
|
531
|
+
justifyContent: "center",
|
|
532
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
533
|
+
borderColor: "transparent"
|
|
489
534
|
},
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
535
|
+
footerStack: {
|
|
536
|
+
paddingHorizontal: 18,
|
|
537
|
+
paddingTop: 8,
|
|
538
|
+
paddingBottom: 12
|
|
539
|
+
},
|
|
540
|
+
logoutButton: {
|
|
541
|
+
flexDirection: "row",
|
|
542
|
+
alignItems: "center",
|
|
543
|
+
gap: 14,
|
|
544
|
+
paddingVertical: 15,
|
|
545
|
+
paddingHorizontal: 16,
|
|
546
|
+
borderRadius: 16,
|
|
547
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
493
548
|
},
|
|
494
549
|
logoutLabel: {
|
|
495
550
|
fontSize: 16,
|
|
496
|
-
fontWeight: "
|
|
497
|
-
color: "#b91c1c"
|
|
551
|
+
fontWeight: "400"
|
|
498
552
|
},
|
|
499
553
|
loggedOutFooterHint: {
|
|
500
554
|
fontSize: 12,
|
|
501
555
|
textAlign: "center",
|
|
502
|
-
color: PALETTE.textSecondary,
|
|
503
556
|
paddingVertical: 8
|
|
504
557
|
}
|
|
505
558
|
});export{CustomDrawer as default};//# sourceMappingURL=CustomDrawer.js.map
|