@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
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.EditBioModal = void 0;
|
|
7
|
-
var _react =
|
|
8
|
-
var
|
|
9
|
-
var _vectorIcons = require("@expo/vector-icons");
|
|
10
|
-
var _useThemeStyles = require("../../hooks/useThemeStyles.js");
|
|
11
|
-
var _useColorScheme = require("../../hooks/use-color-scheme.js");
|
|
12
|
-
var _useI18n = require("../../hooks/useI18n.js");
|
|
13
|
-
var _fonts = require("../../styles/fonts.js");
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _EditFieldModal = require("./EditFieldModal.js");
|
|
14
9
|
var _useProfileEditing = require("../../hooks/useProfileEditing.js");
|
|
10
|
+
var _useI18n = require("../../hooks/useI18n.js");
|
|
15
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
13
|
const EditBioModal = ({
|
|
18
14
|
visible,
|
|
19
15
|
onClose,
|
|
@@ -24,158 +20,30 @@ const EditBioModal = ({
|
|
|
24
20
|
const {
|
|
25
21
|
t
|
|
26
22
|
} = (0, _useI18n.useI18n)();
|
|
27
|
-
const colorScheme = (0, _useColorScheme.useColorScheme)();
|
|
28
|
-
const themeStyles = (0, _useThemeStyles.useThemeStyles)(theme || 'light', colorScheme);
|
|
29
|
-
const colors = themeStyles.colors;
|
|
30
23
|
const {
|
|
31
|
-
updateField
|
|
32
|
-
isSaving
|
|
24
|
+
updateField
|
|
33
25
|
} = (0, _useProfileEditing.useProfileEditing)();
|
|
34
|
-
|
|
35
|
-
(0, _react.useEffect)(() => {
|
|
36
|
-
if (visible) {
|
|
37
|
-
setBio(initialValue);
|
|
38
|
-
}
|
|
39
|
-
}, [visible, initialValue]);
|
|
40
|
-
const handleSave = async () => {
|
|
41
|
-
const success = await updateField('bio', bio);
|
|
42
|
-
if (success) {
|
|
43
|
-
onSave?.();
|
|
44
|
-
onClose();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditFieldModal.EditFieldModal, {
|
|
48
27
|
visible: visible,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
69
|
-
style: [styles.modalTitle, {
|
|
70
|
-
color: colors.text
|
|
71
|
-
}],
|
|
72
|
-
children: t('editProfile.items.bio.title') || 'Bio'
|
|
73
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
74
|
-
onPress: handleSave,
|
|
75
|
-
disabled: isSaving,
|
|
76
|
-
style: [styles.saveButton, {
|
|
77
|
-
opacity: isSaving ? 0.5 : 1
|
|
78
|
-
}],
|
|
79
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
80
|
-
style: [styles.saveButtonText, {
|
|
81
|
-
color: colors.tint
|
|
82
|
-
}],
|
|
83
|
-
children: isSaving ? 'Saving...' : 'Save'
|
|
84
|
-
})
|
|
85
|
-
})]
|
|
86
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
87
|
-
style: styles.modalBody,
|
|
88
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
89
|
-
style: styles.inputGroup,
|
|
90
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
91
|
-
style: [styles.label, {
|
|
92
|
-
color: colors.text
|
|
93
|
-
}],
|
|
94
|
-
children: t('editProfile.items.bio.label') || 'Bio'
|
|
95
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
96
|
-
style: [styles.textArea, {
|
|
97
|
-
backgroundColor: colors.card,
|
|
98
|
-
color: colors.text,
|
|
99
|
-
borderColor: colors.border
|
|
100
|
-
}],
|
|
101
|
-
value: bio,
|
|
102
|
-
onChangeText: setBio,
|
|
103
|
-
placeholder: t('editProfile.items.bio.placeholder') || 'Tell people about yourself...',
|
|
104
|
-
placeholderTextColor: colors.secondaryText,
|
|
105
|
-
autoFocus: true,
|
|
106
|
-
multiline: true,
|
|
107
|
-
numberOfLines: 6,
|
|
108
|
-
textAlignVertical: "top",
|
|
109
|
-
selectionColor: colors.tint
|
|
110
|
-
})]
|
|
111
|
-
})
|
|
112
|
-
})]
|
|
113
|
-
})
|
|
114
|
-
})
|
|
28
|
+
onClose: onClose,
|
|
29
|
+
title: t('editProfile.items.bio.title') || 'Bio',
|
|
30
|
+
theme: theme,
|
|
31
|
+
onSave: onSave,
|
|
32
|
+
variant: "single",
|
|
33
|
+
fields: [{
|
|
34
|
+
key: 'bio',
|
|
35
|
+
label: t('editProfile.items.bio.label') || 'Bio',
|
|
36
|
+
initialValue,
|
|
37
|
+
placeholder: t('editProfile.items.bio.placeholder') || 'Tell people about yourself...',
|
|
38
|
+
inputProps: {
|
|
39
|
+
multiline: true,
|
|
40
|
+
numberOfLines: 6
|
|
41
|
+
}
|
|
42
|
+
}],
|
|
43
|
+
onSubmit: async data => {
|
|
44
|
+
return await updateField('bio', data.bio);
|
|
45
|
+
}
|
|
115
46
|
});
|
|
116
47
|
};
|
|
117
48
|
exports.EditBioModal = EditBioModal;
|
|
118
|
-
const styles = _reactNative.StyleSheet.create({
|
|
119
|
-
modalOverlay: {
|
|
120
|
-
flex: 1,
|
|
121
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
122
|
-
justifyContent: 'flex-end'
|
|
123
|
-
},
|
|
124
|
-
modalContent: {
|
|
125
|
-
borderTopLeftRadius: 20,
|
|
126
|
-
borderTopRightRadius: 20,
|
|
127
|
-
paddingTop: _reactNative.Platform.OS === 'ios' ? 20 : 16,
|
|
128
|
-
maxHeight: '80%'
|
|
129
|
-
},
|
|
130
|
-
modalHeader: {
|
|
131
|
-
flexDirection: 'row',
|
|
132
|
-
alignItems: 'center',
|
|
133
|
-
justifyContent: 'space-between',
|
|
134
|
-
paddingHorizontal: 16,
|
|
135
|
-
paddingBottom: 16,
|
|
136
|
-
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
137
|
-
borderBottomColor: '#E5E5EA'
|
|
138
|
-
},
|
|
139
|
-
closeButton: {
|
|
140
|
-
width: 40,
|
|
141
|
-
height: 40,
|
|
142
|
-
alignItems: 'center',
|
|
143
|
-
justifyContent: 'center'
|
|
144
|
-
},
|
|
145
|
-
modalTitle: {
|
|
146
|
-
fontSize: 18,
|
|
147
|
-
fontWeight: '600',
|
|
148
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold,
|
|
149
|
-
flex: 1,
|
|
150
|
-
textAlign: 'center'
|
|
151
|
-
},
|
|
152
|
-
saveButton: {
|
|
153
|
-
paddingHorizontal: 16,
|
|
154
|
-
paddingVertical: 8
|
|
155
|
-
},
|
|
156
|
-
saveButtonText: {
|
|
157
|
-
fontSize: 16,
|
|
158
|
-
fontWeight: '600',
|
|
159
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
160
|
-
},
|
|
161
|
-
modalBody: {
|
|
162
|
-
padding: 16,
|
|
163
|
-
gap: 16
|
|
164
|
-
},
|
|
165
|
-
inputGroup: {
|
|
166
|
-
gap: 8
|
|
167
|
-
},
|
|
168
|
-
label: {
|
|
169
|
-
fontSize: 14,
|
|
170
|
-
fontWeight: '600',
|
|
171
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
172
|
-
},
|
|
173
|
-
textArea: {
|
|
174
|
-
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
175
|
-
borderRadius: 12,
|
|
176
|
-
padding: 16,
|
|
177
|
-
fontSize: 16,
|
|
178
|
-
minHeight: 120
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
49
|
//# sourceMappingURL=EditBioModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_EditFieldModal","_useProfileEditing","_useI18n","_jsxRuntime","e","__esModule","default","EditBioModal","visible","onClose","initialValue","theme","onSave","t","useI18n","updateField","useProfileEditing","jsx","EditFieldModal","title","variant","fields","key","label","placeholder","inputProps","multiline","numberOfLines","onSubmit","data","bio","exports"],"sourceRoot":"../../../../../src","sources":["ui/components/profile/EditBioModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA8C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAUvC,MAAMG,YAAyC,GAAGA,CAAC;EACxDC,OAAO;EACPC,OAAO;EACPC,YAAY,GAAG,EAAE;EACjBC,KAAK,GAAG,OAAO;EACfC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,gBAAO,EAAC,CAAC;EACvB,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,oCAAiB,EAAC,CAAC;EAE3C,oBACE,IAAAb,WAAA,CAAAc,GAAA,EAACjB,eAAA,CAAAkB,cAAc;IACbV,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBU,KAAK,EAAEN,CAAC,CAAC,6BAA6B,CAAC,IAAI,KAAM;IACjDF,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfQ,OAAO,EAAC,QAAQ;IAChBC,MAAM,EAAE,CACN;MACEC,GAAG,EAAE,KAAK;MACVC,KAAK,EAAEV,CAAC,CAAC,6BAA6B,CAAC,IAAI,KAAK;MAChDH,YAAY;MACZc,WAAW,EAAEX,CAAC,CAAC,mCAAmC,CAAC,IAAI,+BAA+B;MACtFY,UAAU,EAAE;QAAEC,SAAS,EAAE,IAAI;QAAEC,aAAa,EAAE;MAAE;IAClD,CAAC,CACD;IACFC,QAAQ,EAAE,MAAOC,IAAI,IAAK;MACxB,OAAO,MAAMd,WAAW,CAAC,KAAK,EAAEc,IAAI,CAACC,GAAa,CAAC;IACrD;EAAE,CACH,CAAC;AAEN,CAAC;AAACC,OAAA,CAAAxB,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.EditDisplayNameModal = void 0;
|
|
7
|
-
var _react =
|
|
8
|
-
var
|
|
9
|
-
var _vectorIcons = require("@expo/vector-icons");
|
|
10
|
-
var _useThemeStyles = require("../../hooks/useThemeStyles.js");
|
|
11
|
-
var _useColorScheme = require("../../hooks/use-color-scheme.js");
|
|
12
|
-
var _useI18n = require("../../hooks/useI18n.js");
|
|
13
|
-
var _fonts = require("../../styles/fonts.js");
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _EditFieldModal = require("./EditFieldModal.js");
|
|
14
9
|
var _useProfileEditing = require("../../hooks/useProfileEditing.js");
|
|
10
|
+
var _useI18n = require("../../hooks/useI18n.js");
|
|
15
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
13
|
const EditDisplayNameModal = ({
|
|
18
14
|
visible,
|
|
19
15
|
onClose,
|
|
@@ -25,180 +21,34 @@ const EditDisplayNameModal = ({
|
|
|
25
21
|
const {
|
|
26
22
|
t
|
|
27
23
|
} = (0, _useI18n.useI18n)();
|
|
28
|
-
const colorScheme = (0, _useColorScheme.useColorScheme)();
|
|
29
|
-
const themeStyles = (0, _useThemeStyles.useThemeStyles)(theme || 'light', colorScheme);
|
|
30
|
-
const colors = themeStyles.colors;
|
|
31
24
|
const {
|
|
32
|
-
saveProfile
|
|
33
|
-
isSaving
|
|
25
|
+
saveProfile
|
|
34
26
|
} = (0, _useProfileEditing.useProfileEditing)();
|
|
35
|
-
|
|
36
|
-
const [lastName, setLastName] = (0, _react.useState)(initialLastName);
|
|
37
|
-
(0, _react.useEffect)(() => {
|
|
38
|
-
if (visible) {
|
|
39
|
-
setDisplayName(initialDisplayName);
|
|
40
|
-
setLastName(initialLastName);
|
|
41
|
-
}
|
|
42
|
-
}, [visible, initialDisplayName, initialLastName]);
|
|
43
|
-
const handleSave = async () => {
|
|
44
|
-
const updates = {
|
|
45
|
-
displayName,
|
|
46
|
-
lastName
|
|
47
|
-
};
|
|
48
|
-
const success = await saveProfile(updates);
|
|
49
|
-
if (success) {
|
|
50
|
-
onSave?.();
|
|
51
|
-
onClose();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditFieldModal.EditFieldModal, {
|
|
55
28
|
visible: visible,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}],
|
|
79
|
-
children: t('editProfile.items.displayName.title') || 'Display Name'
|
|
80
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
81
|
-
onPress: handleSave,
|
|
82
|
-
disabled: isSaving,
|
|
83
|
-
style: [styles.saveButton, {
|
|
84
|
-
opacity: isSaving ? 0.5 : 1
|
|
85
|
-
}],
|
|
86
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
87
|
-
style: [styles.saveButtonText, {
|
|
88
|
-
color: colors.tint
|
|
89
|
-
}],
|
|
90
|
-
children: isSaving ? 'Saving...' : 'Save'
|
|
91
|
-
})
|
|
92
|
-
})]
|
|
93
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
94
|
-
style: styles.modalBody,
|
|
95
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
96
|
-
style: styles.inputGroup,
|
|
97
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
98
|
-
style: [styles.label, {
|
|
99
|
-
color: colors.text
|
|
100
|
-
}],
|
|
101
|
-
children: t('editProfile.items.displayName.firstName') || 'First Name'
|
|
102
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
103
|
-
style: [styles.input, {
|
|
104
|
-
backgroundColor: colors.card,
|
|
105
|
-
color: colors.text,
|
|
106
|
-
borderColor: colors.border
|
|
107
|
-
}],
|
|
108
|
-
value: displayName,
|
|
109
|
-
onChangeText: setDisplayName,
|
|
110
|
-
placeholder: t('editProfile.items.displayName.firstNamePlaceholder') || 'Enter first name',
|
|
111
|
-
placeholderTextColor: colors.secondaryText,
|
|
112
|
-
autoFocus: true,
|
|
113
|
-
selectionColor: colors.tint
|
|
114
|
-
})]
|
|
115
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
116
|
-
style: styles.inputGroup,
|
|
117
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
118
|
-
style: [styles.label, {
|
|
119
|
-
color: colors.text
|
|
120
|
-
}],
|
|
121
|
-
children: t('editProfile.items.displayName.lastName') || 'Last Name'
|
|
122
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
123
|
-
style: [styles.input, {
|
|
124
|
-
backgroundColor: colors.card,
|
|
125
|
-
color: colors.text,
|
|
126
|
-
borderColor: colors.border
|
|
127
|
-
}],
|
|
128
|
-
value: lastName,
|
|
129
|
-
onChangeText: setLastName,
|
|
130
|
-
placeholder: t('editProfile.items.displayName.lastNamePlaceholder') || 'Enter last name (optional)',
|
|
131
|
-
placeholderTextColor: colors.secondaryText,
|
|
132
|
-
selectionColor: colors.tint
|
|
133
|
-
})]
|
|
134
|
-
})]
|
|
135
|
-
})]
|
|
136
|
-
})
|
|
137
|
-
})
|
|
29
|
+
onClose: onClose,
|
|
30
|
+
title: t('editProfile.items.displayName.title') || 'Display Name',
|
|
31
|
+
theme: theme,
|
|
32
|
+
onSave: onSave,
|
|
33
|
+
variant: "multi",
|
|
34
|
+
fields: [{
|
|
35
|
+
key: 'displayName',
|
|
36
|
+
label: t('editProfile.items.displayName.firstName') || 'First Name',
|
|
37
|
+
initialValue: initialDisplayName,
|
|
38
|
+
placeholder: t('editProfile.items.displayName.firstNamePlaceholder') || 'Enter first name'
|
|
39
|
+
}, {
|
|
40
|
+
key: 'lastName',
|
|
41
|
+
label: t('editProfile.items.displayName.lastName') || 'Last Name',
|
|
42
|
+
initialValue: initialLastName,
|
|
43
|
+
placeholder: t('editProfile.items.displayName.lastNamePlaceholder') || 'Enter last name (optional)'
|
|
44
|
+
}],
|
|
45
|
+
onSubmit: async data => {
|
|
46
|
+
return await saveProfile({
|
|
47
|
+
displayName: data.displayName,
|
|
48
|
+
lastName: data.lastName
|
|
49
|
+
});
|
|
50
|
+
}
|
|
138
51
|
});
|
|
139
52
|
};
|
|
140
53
|
exports.EditDisplayNameModal = EditDisplayNameModal;
|
|
141
|
-
const styles = _reactNative.StyleSheet.create({
|
|
142
|
-
modalOverlay: {
|
|
143
|
-
flex: 1,
|
|
144
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
145
|
-
justifyContent: 'flex-end'
|
|
146
|
-
},
|
|
147
|
-
modalContent: {
|
|
148
|
-
borderTopLeftRadius: 20,
|
|
149
|
-
borderTopRightRadius: 20,
|
|
150
|
-
paddingTop: _reactNative.Platform.OS === 'ios' ? 20 : 16,
|
|
151
|
-
maxHeight: '80%'
|
|
152
|
-
},
|
|
153
|
-
modalHeader: {
|
|
154
|
-
flexDirection: 'row',
|
|
155
|
-
alignItems: 'center',
|
|
156
|
-
justifyContent: 'space-between',
|
|
157
|
-
paddingHorizontal: 16,
|
|
158
|
-
paddingBottom: 16,
|
|
159
|
-
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
160
|
-
borderBottomColor: '#E5E5EA'
|
|
161
|
-
},
|
|
162
|
-
closeButton: {
|
|
163
|
-
width: 40,
|
|
164
|
-
height: 40,
|
|
165
|
-
alignItems: 'center',
|
|
166
|
-
justifyContent: 'center'
|
|
167
|
-
},
|
|
168
|
-
modalTitle: {
|
|
169
|
-
fontSize: 18,
|
|
170
|
-
fontWeight: '600',
|
|
171
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold,
|
|
172
|
-
flex: 1,
|
|
173
|
-
textAlign: 'center'
|
|
174
|
-
},
|
|
175
|
-
saveButton: {
|
|
176
|
-
paddingHorizontal: 16,
|
|
177
|
-
paddingVertical: 8
|
|
178
|
-
},
|
|
179
|
-
saveButtonText: {
|
|
180
|
-
fontSize: 16,
|
|
181
|
-
fontWeight: '600',
|
|
182
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
183
|
-
},
|
|
184
|
-
modalBody: {
|
|
185
|
-
padding: 16,
|
|
186
|
-
gap: 16
|
|
187
|
-
},
|
|
188
|
-
inputGroup: {
|
|
189
|
-
gap: 8
|
|
190
|
-
},
|
|
191
|
-
label: {
|
|
192
|
-
fontSize: 14,
|
|
193
|
-
fontWeight: '600',
|
|
194
|
-
fontFamily: _fonts.fontFamilies.phuduSemiBold
|
|
195
|
-
},
|
|
196
|
-
input: {
|
|
197
|
-
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
198
|
-
borderRadius: 12,
|
|
199
|
-
padding: 16,
|
|
200
|
-
fontSize: 16,
|
|
201
|
-
minHeight: 52
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
54
|
//# sourceMappingURL=EditDisplayNameModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_EditFieldModal","_useProfileEditing","_useI18n","_jsxRuntime","e","__esModule","default","EditDisplayNameModal","visible","onClose","initialDisplayName","initialLastName","theme","onSave","t","useI18n","saveProfile","useProfileEditing","jsx","EditFieldModal","title","variant","fields","key","label","initialValue","placeholder","onSubmit","data","displayName","lastName","exports"],"sourceRoot":"../../../../../src","sources":["ui/components/profile/EditDisplayNameModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA8C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWvC,MAAMG,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,GAAG,IAAAC,gBAAO,EAAC,CAAC;EACvB,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,oCAAiB,EAAC,CAAC;EAE3C,oBACE,IAAAd,WAAA,CAAAe,GAAA,EAAClB,eAAA,CAAAmB,cAAc;IACbX,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBW,KAAK,EAAEN,CAAC,CAAC,qCAAqC,CAAC,IAAI,cAAe;IAClEF,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfQ,OAAO,EAAC,OAAO;IACfC,MAAM,EAAE,CACN;MACEC,GAAG,EAAE,aAAa;MAClBC,KAAK,EAAEV,CAAC,CAAC,yCAAyC,CAAC,IAAI,YAAY;MACnEW,YAAY,EAAEf,kBAAkB;MAChCgB,WAAW,EAAEZ,CAAC,CAAC,oDAAoD,CAAC,IAAI;IAC1E,CAAC,EACD;MACES,GAAG,EAAE,UAAU;MACfC,KAAK,EAAEV,CAAC,CAAC,wCAAwC,CAAC,IAAI,WAAW;MACjEW,YAAY,EAAEd,eAAe;MAC7Be,WAAW,EAAEZ,CAAC,CAAC,mDAAmD,CAAC,IAAI;IACzE,CAAC,CACD;IACFa,QAAQ,EAAE,MAAOC,IAAI,IAAK;MACxB,OAAO,MAAMZ,WAAW,CAAC;QACvBa,WAAW,EAAED,IAAI,CAACC,WAAqB;QACvCC,QAAQ,EAAEF,IAAI,CAACE;MACjB,CAAC,CAAC;IACJ;EAAE,CACH,CAAC;AAEN,CAAC;AAACC,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|