@oxyhq/services 5.21.6 → 5.21.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/crypto/keyManager.js +67 -22
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/index.js +66 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +57 -0
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditBioModal.js +24 -156
- package/lib/commonjs/ui/components/profile/EditBioModal.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +28 -178
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditEmailModal.js +32 -159
- package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditLocationModal.js +45 -227
- package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js +30 -155
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +177 -0
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -0
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -123
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -32
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +2 -31
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileFiltering.js +76 -0
- package/lib/commonjs/ui/hooks/useFileFiltering.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +2 -2
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/authHelpers.js +164 -0
- package/lib/commonjs/ui/utils/authHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/avatarUtils.js +18 -61
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/crypto/keyManager.js +67 -22
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +50 -0
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/module/ui/components/profile/EditBioModal.js +24 -156
- package/lib/module/ui/components/profile/EditBioModal.js.map +1 -1
- package/lib/module/ui/components/profile/EditDisplayNameModal.js +28 -178
- package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +1 -1
- package/lib/module/ui/components/profile/EditEmailModal.js +32 -159
- package/lib/module/ui/components/profile/EditEmailModal.js.map +1 -1
- package/lib/module/ui/components/profile/EditLocationModal.js +45 -227
- package/lib/module/ui/components/profile/EditLocationModal.js.map +1 -1
- package/lib/module/ui/components/profile/EditUsernameModal.js +30 -155
- package/lib/module/ui/components/profile/EditUsernameModal.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +173 -0
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -0
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +10 -122
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -32
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +2 -31
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/useFileFiltering.js +72 -0
- package/lib/module/ui/hooks/useFileFiltering.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +2 -2
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/utils/authHelpers.js +154 -0
- package/lib/module/ui/utils/authHelpers.js.map +1 -0
- package/lib/module/ui/utils/avatarUtils.js +18 -61
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/typescript/commonjs/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +6 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts +1 -0
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts +76 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts +29 -0
- package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts +99 -0
- package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +6 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts +1 -0
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts +76 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts +29 -0
- package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/authHelpers.d.ts +99 -0
- package/lib/typescript/module/ui/utils/authHelpers.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/crypto/keyManager.ts +23 -22
- package/src/index.ts +25 -0
- package/src/ui/components/fileManagement/AnimatedButton.tsx +56 -0
- package/src/ui/components/profile/EditBioModal.tsx +38 -176
- package/src/ui/components/profile/EditDisplayNameModal.tsx +48 -195
- package/src/ui/components/profile/EditEmailModal.tsx +49 -180
- package/src/ui/components/profile/EditLocationModal.tsx +76 -263
- package/src/ui/components/profile/EditUsernameModal.tsx +47 -175
- package/src/ui/hooks/mutations/mutationFactory.ts +215 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +48 -136
- package/src/ui/hooks/queries/useAccountQueries.ts +6 -33
- package/src/ui/hooks/queries/useServicesQueries.ts +6 -32
- package/src/ui/hooks/useFileFiltering.ts +115 -0
- package/src/ui/screens/FileManagementScreen.tsx +2 -2
- package/src/ui/utils/authHelpers.ts +183 -0
- package/src/ui/utils/avatarUtils.ts +25 -65
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React
|
|
4
|
-
import {
|
|
5
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
-
import { useThemeStyles } from "../../hooks/useThemeStyles.js";
|
|
7
|
-
import { useColorScheme } from "../../hooks/use-color-scheme.js";
|
|
8
|
-
import { useI18n } from "../../hooks/useI18n.js";
|
|
9
|
-
import { fontFamilies } from "../../styles/fonts.js";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { EditFieldModal } from "./EditFieldModal.js";
|
|
10
5
|
import { useProfileEditing } from "../../hooks/useProfileEditing.js";
|
|
11
|
-
import {
|
|
6
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
8
|
export const EditBioModal = ({
|
|
13
9
|
visible,
|
|
14
10
|
onClose,
|
|
@@ -19,157 +15,29 @@ export const EditBioModal = ({
|
|
|
19
15
|
const {
|
|
20
16
|
t
|
|
21
17
|
} = useI18n();
|
|
22
|
-
const colorScheme = useColorScheme();
|
|
23
|
-
const themeStyles = useThemeStyles(theme || 'light', colorScheme);
|
|
24
|
-
const colors = themeStyles.colors;
|
|
25
18
|
const {
|
|
26
|
-
updateField
|
|
27
|
-
isSaving
|
|
19
|
+
updateField
|
|
28
20
|
} = useProfileEditing();
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (visible) {
|
|
32
|
-
setBio(initialValue);
|
|
33
|
-
}
|
|
34
|
-
}, [visible, initialValue]);
|
|
35
|
-
const handleSave = async () => {
|
|
36
|
-
const success = await updateField('bio', bio);
|
|
37
|
-
if (success) {
|
|
38
|
-
onSave?.();
|
|
39
|
-
onClose();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
return /*#__PURE__*/_jsx(Modal, {
|
|
21
|
+
return /*#__PURE__*/_jsx(EditFieldModal, {
|
|
43
22
|
visible: visible,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
64
|
-
style: [styles.modalTitle, {
|
|
65
|
-
color: colors.text
|
|
66
|
-
}],
|
|
67
|
-
children: t('editProfile.items.bio.title') || 'Bio'
|
|
68
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
69
|
-
onPress: handleSave,
|
|
70
|
-
disabled: isSaving,
|
|
71
|
-
style: [styles.saveButton, {
|
|
72
|
-
opacity: isSaving ? 0.5 : 1
|
|
73
|
-
}],
|
|
74
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
75
|
-
style: [styles.saveButtonText, {
|
|
76
|
-
color: colors.tint
|
|
77
|
-
}],
|
|
78
|
-
children: isSaving ? 'Saving...' : 'Save'
|
|
79
|
-
})
|
|
80
|
-
})]
|
|
81
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
82
|
-
style: styles.modalBody,
|
|
83
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
84
|
-
style: styles.inputGroup,
|
|
85
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
86
|
-
style: [styles.label, {
|
|
87
|
-
color: colors.text
|
|
88
|
-
}],
|
|
89
|
-
children: t('editProfile.items.bio.label') || 'Bio'
|
|
90
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
91
|
-
style: [styles.textArea, {
|
|
92
|
-
backgroundColor: colors.card,
|
|
93
|
-
color: colors.text,
|
|
94
|
-
borderColor: colors.border
|
|
95
|
-
}],
|
|
96
|
-
value: bio,
|
|
97
|
-
onChangeText: setBio,
|
|
98
|
-
placeholder: t('editProfile.items.bio.placeholder') || 'Tell people about yourself...',
|
|
99
|
-
placeholderTextColor: colors.secondaryText,
|
|
100
|
-
autoFocus: true,
|
|
101
|
-
multiline: true,
|
|
102
|
-
numberOfLines: 6,
|
|
103
|
-
textAlignVertical: "top",
|
|
104
|
-
selectionColor: colors.tint
|
|
105
|
-
})]
|
|
106
|
-
})
|
|
107
|
-
})]
|
|
108
|
-
})
|
|
109
|
-
})
|
|
23
|
+
onClose: onClose,
|
|
24
|
+
title: t('editProfile.items.bio.title') || 'Bio',
|
|
25
|
+
theme: theme,
|
|
26
|
+
onSave: onSave,
|
|
27
|
+
variant: "single",
|
|
28
|
+
fields: [{
|
|
29
|
+
key: 'bio',
|
|
30
|
+
label: t('editProfile.items.bio.label') || 'Bio',
|
|
31
|
+
initialValue,
|
|
32
|
+
placeholder: t('editProfile.items.bio.placeholder') || 'Tell people about yourself...',
|
|
33
|
+
inputProps: {
|
|
34
|
+
multiline: true,
|
|
35
|
+
numberOfLines: 6
|
|
36
|
+
}
|
|
37
|
+
}],
|
|
38
|
+
onSubmit: async data => {
|
|
39
|
+
return await updateField('bio', data.bio);
|
|
40
|
+
}
|
|
110
41
|
});
|
|
111
42
|
};
|
|
112
|
-
const styles = StyleSheet.create({
|
|
113
|
-
modalOverlay: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
116
|
-
justifyContent: 'flex-end'
|
|
117
|
-
},
|
|
118
|
-
modalContent: {
|
|
119
|
-
borderTopLeftRadius: 20,
|
|
120
|
-
borderTopRightRadius: 20,
|
|
121
|
-
paddingTop: Platform.OS === 'ios' ? 20 : 16,
|
|
122
|
-
maxHeight: '80%'
|
|
123
|
-
},
|
|
124
|
-
modalHeader: {
|
|
125
|
-
flexDirection: 'row',
|
|
126
|
-
alignItems: 'center',
|
|
127
|
-
justifyContent: 'space-between',
|
|
128
|
-
paddingHorizontal: 16,
|
|
129
|
-
paddingBottom: 16,
|
|
130
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
131
|
-
borderBottomColor: '#E5E5EA'
|
|
132
|
-
},
|
|
133
|
-
closeButton: {
|
|
134
|
-
width: 40,
|
|
135
|
-
height: 40,
|
|
136
|
-
alignItems: 'center',
|
|
137
|
-
justifyContent: 'center'
|
|
138
|
-
},
|
|
139
|
-
modalTitle: {
|
|
140
|
-
fontSize: 18,
|
|
141
|
-
fontWeight: '600',
|
|
142
|
-
fontFamily: fontFamilies.phuduSemiBold,
|
|
143
|
-
flex: 1,
|
|
144
|
-
textAlign: 'center'
|
|
145
|
-
},
|
|
146
|
-
saveButton: {
|
|
147
|
-
paddingHorizontal: 16,
|
|
148
|
-
paddingVertical: 8
|
|
149
|
-
},
|
|
150
|
-
saveButtonText: {
|
|
151
|
-
fontSize: 16,
|
|
152
|
-
fontWeight: '600',
|
|
153
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
154
|
-
},
|
|
155
|
-
modalBody: {
|
|
156
|
-
padding: 16,
|
|
157
|
-
gap: 16
|
|
158
|
-
},
|
|
159
|
-
inputGroup: {
|
|
160
|
-
gap: 8
|
|
161
|
-
},
|
|
162
|
-
label: {
|
|
163
|
-
fontSize: 14,
|
|
164
|
-
fontWeight: '600',
|
|
165
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
166
|
-
},
|
|
167
|
-
textArea: {
|
|
168
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
169
|
-
borderRadius: 12,
|
|
170
|
-
padding: 16,
|
|
171
|
-
fontSize: 16,
|
|
172
|
-
minHeight: 120
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
43
|
//# sourceMappingURL=EditBioModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","EditFieldModal","useProfileEditing","useI18n","jsx","_jsx","EditBioModal","visible","onClose","initialValue","theme","onSave","t","updateField","title","variant","fields","key","label","placeholder","inputProps","multiline","numberOfLines","onSubmit","data","bio"],"sourceRoot":"../../../../../src","sources":["ui/components/profile/EditBioModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,iBAAiB,QAAQ,kCAA+B;AACjE,SAASC,OAAO,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAU9C,OAAO,MAAMC,YAAyC,GAAGA,CAAC;EACxDC,OAAO;EACPC,OAAO;EACPC,YAAY,GAAG,EAAE;EACjBC,KAAK,GAAG,OAAO;EACfC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGT,OAAO,CAAC,CAAC;EACvB,MAAM;IAAEU;EAAY,CAAC,GAAGX,iBAAiB,CAAC,CAAC;EAE3C,oBACEG,IAAA,CAACJ,cAAc;IACbM,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBM,KAAK,EAAEF,CAAC,CAAC,6BAA6B,CAAC,IAAI,KAAM;IACjDF,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfI,OAAO,EAAC,QAAQ;IAChBC,MAAM,EAAE,CACN;MACEC,GAAG,EAAE,KAAK;MACVC,KAAK,EAAEN,CAAC,CAAC,6BAA6B,CAAC,IAAI,KAAK;MAChDH,YAAY;MACZU,WAAW,EAAEP,CAAC,CAAC,mCAAmC,CAAC,IAAI,+BAA+B;MACtFQ,UAAU,EAAE;QAAEC,SAAS,EAAE,IAAI;QAAEC,aAAa,EAAE;MAAE;IAClD,CAAC,CACD;IACFC,QAAQ,EAAE,MAAOC,IAAI,IAAK;MACxB,OAAO,MAAMX,WAAW,CAAC,KAAK,EAAEW,IAAI,CAACC,GAAa,CAAC;IACrD;EAAE,CACH,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React
|
|
4
|
-
import {
|
|
5
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
-
import { useThemeStyles } from "../../hooks/useThemeStyles.js";
|
|
7
|
-
import { useColorScheme } from "../../hooks/use-color-scheme.js";
|
|
8
|
-
import { useI18n } from "../../hooks/useI18n.js";
|
|
9
|
-
import { fontFamilies } from "../../styles/fonts.js";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { EditFieldModal } from "./EditFieldModal.js";
|
|
10
5
|
import { useProfileEditing } from "../../hooks/useProfileEditing.js";
|
|
11
|
-
import {
|
|
6
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
8
|
export const EditDisplayNameModal = ({
|
|
13
9
|
visible,
|
|
14
10
|
onClose,
|
|
@@ -20,179 +16,33 @@ export const EditDisplayNameModal = ({
|
|
|
20
16
|
const {
|
|
21
17
|
t
|
|
22
18
|
} = useI18n();
|
|
23
|
-
const colorScheme = useColorScheme();
|
|
24
|
-
const themeStyles = useThemeStyles(theme || 'light', colorScheme);
|
|
25
|
-
const colors = themeStyles.colors;
|
|
26
19
|
const {
|
|
27
|
-
saveProfile
|
|
28
|
-
isSaving
|
|
20
|
+
saveProfile
|
|
29
21
|
} = useProfileEditing();
|
|
30
|
-
|
|
31
|
-
const [lastName, setLastName] = useState(initialLastName);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (visible) {
|
|
34
|
-
setDisplayName(initialDisplayName);
|
|
35
|
-
setLastName(initialLastName);
|
|
36
|
-
}
|
|
37
|
-
}, [visible, initialDisplayName, initialLastName]);
|
|
38
|
-
const handleSave = async () => {
|
|
39
|
-
const updates = {
|
|
40
|
-
displayName,
|
|
41
|
-
lastName
|
|
42
|
-
};
|
|
43
|
-
const success = await saveProfile(updates);
|
|
44
|
-
if (success) {
|
|
45
|
-
onSave?.();
|
|
46
|
-
onClose();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return /*#__PURE__*/_jsx(Modal, {
|
|
22
|
+
return /*#__PURE__*/_jsx(EditFieldModal, {
|
|
50
23
|
visible: visible,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}],
|
|
74
|
-
children: t('editProfile.items.displayName.title') || 'Display Name'
|
|
75
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
76
|
-
onPress: handleSave,
|
|
77
|
-
disabled: isSaving,
|
|
78
|
-
style: [styles.saveButton, {
|
|
79
|
-
opacity: isSaving ? 0.5 : 1
|
|
80
|
-
}],
|
|
81
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
82
|
-
style: [styles.saveButtonText, {
|
|
83
|
-
color: colors.tint
|
|
84
|
-
}],
|
|
85
|
-
children: isSaving ? 'Saving...' : 'Save'
|
|
86
|
-
})
|
|
87
|
-
})]
|
|
88
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
89
|
-
style: styles.modalBody,
|
|
90
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
91
|
-
style: styles.inputGroup,
|
|
92
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
93
|
-
style: [styles.label, {
|
|
94
|
-
color: colors.text
|
|
95
|
-
}],
|
|
96
|
-
children: t('editProfile.items.displayName.firstName') || 'First Name'
|
|
97
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
98
|
-
style: [styles.input, {
|
|
99
|
-
backgroundColor: colors.card,
|
|
100
|
-
color: colors.text,
|
|
101
|
-
borderColor: colors.border
|
|
102
|
-
}],
|
|
103
|
-
value: displayName,
|
|
104
|
-
onChangeText: setDisplayName,
|
|
105
|
-
placeholder: t('editProfile.items.displayName.firstNamePlaceholder') || 'Enter first name',
|
|
106
|
-
placeholderTextColor: colors.secondaryText,
|
|
107
|
-
autoFocus: true,
|
|
108
|
-
selectionColor: colors.tint
|
|
109
|
-
})]
|
|
110
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
111
|
-
style: styles.inputGroup,
|
|
112
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
113
|
-
style: [styles.label, {
|
|
114
|
-
color: colors.text
|
|
115
|
-
}],
|
|
116
|
-
children: t('editProfile.items.displayName.lastName') || 'Last Name'
|
|
117
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
118
|
-
style: [styles.input, {
|
|
119
|
-
backgroundColor: colors.card,
|
|
120
|
-
color: colors.text,
|
|
121
|
-
borderColor: colors.border
|
|
122
|
-
}],
|
|
123
|
-
value: lastName,
|
|
124
|
-
onChangeText: setLastName,
|
|
125
|
-
placeholder: t('editProfile.items.displayName.lastNamePlaceholder') || 'Enter last name (optional)',
|
|
126
|
-
placeholderTextColor: colors.secondaryText,
|
|
127
|
-
selectionColor: colors.tint
|
|
128
|
-
})]
|
|
129
|
-
})]
|
|
130
|
-
})]
|
|
131
|
-
})
|
|
132
|
-
})
|
|
24
|
+
onClose: onClose,
|
|
25
|
+
title: t('editProfile.items.displayName.title') || 'Display Name',
|
|
26
|
+
theme: theme,
|
|
27
|
+
onSave: onSave,
|
|
28
|
+
variant: "multi",
|
|
29
|
+
fields: [{
|
|
30
|
+
key: 'displayName',
|
|
31
|
+
label: t('editProfile.items.displayName.firstName') || 'First Name',
|
|
32
|
+
initialValue: initialDisplayName,
|
|
33
|
+
placeholder: t('editProfile.items.displayName.firstNamePlaceholder') || 'Enter first name'
|
|
34
|
+
}, {
|
|
35
|
+
key: 'lastName',
|
|
36
|
+
label: t('editProfile.items.displayName.lastName') || 'Last Name',
|
|
37
|
+
initialValue: initialLastName,
|
|
38
|
+
placeholder: t('editProfile.items.displayName.lastNamePlaceholder') || 'Enter last name (optional)'
|
|
39
|
+
}],
|
|
40
|
+
onSubmit: async data => {
|
|
41
|
+
return await saveProfile({
|
|
42
|
+
displayName: data.displayName,
|
|
43
|
+
lastName: data.lastName
|
|
44
|
+
});
|
|
45
|
+
}
|
|
133
46
|
});
|
|
134
47
|
};
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
modalOverlay: {
|
|
137
|
-
flex: 1,
|
|
138
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
139
|
-
justifyContent: 'flex-end'
|
|
140
|
-
},
|
|
141
|
-
modalContent: {
|
|
142
|
-
borderTopLeftRadius: 20,
|
|
143
|
-
borderTopRightRadius: 20,
|
|
144
|
-
paddingTop: Platform.OS === 'ios' ? 20 : 16,
|
|
145
|
-
maxHeight: '80%'
|
|
146
|
-
},
|
|
147
|
-
modalHeader: {
|
|
148
|
-
flexDirection: 'row',
|
|
149
|
-
alignItems: 'center',
|
|
150
|
-
justifyContent: 'space-between',
|
|
151
|
-
paddingHorizontal: 16,
|
|
152
|
-
paddingBottom: 16,
|
|
153
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
154
|
-
borderBottomColor: '#E5E5EA'
|
|
155
|
-
},
|
|
156
|
-
closeButton: {
|
|
157
|
-
width: 40,
|
|
158
|
-
height: 40,
|
|
159
|
-
alignItems: 'center',
|
|
160
|
-
justifyContent: 'center'
|
|
161
|
-
},
|
|
162
|
-
modalTitle: {
|
|
163
|
-
fontSize: 18,
|
|
164
|
-
fontWeight: '600',
|
|
165
|
-
fontFamily: fontFamilies.phuduSemiBold,
|
|
166
|
-
flex: 1,
|
|
167
|
-
textAlign: 'center'
|
|
168
|
-
},
|
|
169
|
-
saveButton: {
|
|
170
|
-
paddingHorizontal: 16,
|
|
171
|
-
paddingVertical: 8
|
|
172
|
-
},
|
|
173
|
-
saveButtonText: {
|
|
174
|
-
fontSize: 16,
|
|
175
|
-
fontWeight: '600',
|
|
176
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
177
|
-
},
|
|
178
|
-
modalBody: {
|
|
179
|
-
padding: 16,
|
|
180
|
-
gap: 16
|
|
181
|
-
},
|
|
182
|
-
inputGroup: {
|
|
183
|
-
gap: 8
|
|
184
|
-
},
|
|
185
|
-
label: {
|
|
186
|
-
fontSize: 14,
|
|
187
|
-
fontWeight: '600',
|
|
188
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
189
|
-
},
|
|
190
|
-
input: {
|
|
191
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
192
|
-
borderRadius: 12,
|
|
193
|
-
padding: 16,
|
|
194
|
-
fontSize: 16,
|
|
195
|
-
minHeight: 52
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
48
|
//# sourceMappingURL=EditDisplayNameModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","EditFieldModal","useProfileEditing","useI18n","jsx","_jsx","EditDisplayNameModal","visible","onClose","initialDisplayName","initialLastName","theme","onSave","t","saveProfile","title","variant","fields","key","label","initialValue","placeholder","onSubmit","data","displayName","lastName"],"sourceRoot":"../../../../../src","sources":["ui/components/profile/EditDisplayNameModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,iBAAiB,QAAQ,kCAA+B;AACjE,SAASC,OAAO,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAW9C,OAAO,MAAMC,oBAAyD,GAAGA,CAAC;EACxEC,OAAO;EACPC,OAAO;EACPC,kBAAkB,GAAG,EAAE;EACvBC,eAAe,GAAG,EAAE;EACpBC,KAAK,GAAG,OAAO;EACfC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGV,OAAO,CAAC,CAAC;EACvB,MAAM;IAAEW;EAAY,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EAE3C,oBACEG,IAAA,CAACJ,cAAc;IACbM,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBO,KAAK,EAAEF,CAAC,CAAC,qCAAqC,CAAC,IAAI,cAAe;IAClEF,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfI,OAAO,EAAC,OAAO;IACfC,MAAM,EAAE,CACN;MACEC,GAAG,EAAE,aAAa;MAClBC,KAAK,EAAEN,CAAC,CAAC,yCAAyC,CAAC,IAAI,YAAY;MACnEO,YAAY,EAAEX,kBAAkB;MAChCY,WAAW,EAAER,CAAC,CAAC,oDAAoD,CAAC,IAAI;IAC1E,CAAC,EACD;MACEK,GAAG,EAAE,UAAU;MACfC,KAAK,EAAEN,CAAC,CAAC,wCAAwC,CAAC,IAAI,WAAW;MACjEO,YAAY,EAAEV,eAAe;MAC7BW,WAAW,EAAER,CAAC,CAAC,mDAAmD,CAAC,IAAI;IACzE,CAAC,CACD;IACFS,QAAQ,EAAE,MAAOC,IAAI,IAAK;MACxB,OAAO,MAAMT,WAAW,CAAC;QACvBU,WAAW,EAAED,IAAI,CAACC,WAAqB;QACvCC,QAAQ,EAAEF,IAAI,CAACE;MACjB,CAAC,CAAC;IACJ;EAAE,CACH,CAAC;AAEN,CAAC","ignoreList":[]}
|