@mx-cartographer/experiences 9.3.1-alpha.al0 → 9.3.1
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/CHANGELOG.md +2 -7
- package/dist/cashflow/CashflowOnboarding.es.js +1 -1
- package/dist/core/api/SettingsApi.d.ts +0 -4
- package/dist/core/api/SettingsApi.es.js +4 -5
- package/dist/core/api/SettingsApi.es.js.map +1 -1
- package/dist/core/constants/ApiEndpoints.d.ts +0 -1
- package/dist/core/constants/ApiEndpoints.es.js +0 -1
- package/dist/core/constants/ApiEndpoints.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.es.js +46 -46
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/FinstrongStore.es.js +1 -1
- package/dist/core/stores/SettingsStore.d.ts +0 -4
- package/dist/core/stores/SettingsStore.es.js +73 -80
- package/dist/core/stores/SettingsStore.es.js.map +1 -1
- package/dist/core/types/localization/SettingsCopy.d.ts +0 -6
- package/dist/core/utils/DateUtil.d.ts +1 -0
- package/dist/core/utils/DateUtil.es.js +48 -47
- package/dist/core/utils/DateUtil.es.js.map +1 -1
- package/dist/core/utils/DebtUtils.es.js +6 -6
- package/dist/core/utils/GoalsUtil.es.js +1 -1
- package/dist/core/utils/RecurringTransactionsUtil.es.js +5 -5
- package/dist/core/utils/TransactionUtils.es.js +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +4 -4
- package/dist/settings/components/profile/ProfileTab.d.ts +1 -1
- package/dist/settings/components/profile/ProfileTab.es.js +108 -115
- package/dist/settings/components/profile/ProfileTab.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js +37 -20
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js +17 -11
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js.map +1 -1
- package/dist/settings/constants/Settings.d.ts +0 -8
- package/dist/settings/constants/Settings.es.js +3 -10
- package/dist/settings/constants/Settings.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/settings/components/profile/actions/ResetPasswordAction.d.ts +0 -4
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js +0 -94
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js.map +0 -1
|
@@ -4,8 +4,8 @@ import { ListItemAction as v } from "../../../common/components/ListItemAction.e
|
|
|
4
4
|
import i from "react";
|
|
5
5
|
import { observer as A } from "mobx-react-lite";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
import { getUnixTime as T } from "date-fns/getUnixTime";
|
|
8
7
|
import { fromUnixTime as s } from "date-fns/fromUnixTime";
|
|
8
|
+
import { getUnixTime as T } from "date-fns/getUnixTime";
|
|
9
9
|
import { AdapterDateFns as x } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
10
10
|
import { DatePicker as D } from "@mui/x-date-pickers";
|
|
11
11
|
import { LocalizationProvider as g } from "@mui/x-date-pickers/LocalizationProvider";
|
|
@@ -10,8 +10,8 @@ import { MerchantLogo as P, Text as a } from "@mxenabled/mxui";
|
|
|
10
10
|
import { Cancel as U, CheckCircle as B, Icon as Y } from "@mxenabled/mx-icons";
|
|
11
11
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
12
12
|
import F from "@mui/material/IconButton";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { fromUnixTime as H } from "date-fns/fromUnixTime";
|
|
14
|
+
import { getUnixTime as W } from "date-fns/getUnixTime";
|
|
15
15
|
import $ from "@mui/material/Divider";
|
|
16
16
|
import K from "@mui/material/List";
|
|
17
17
|
import V from "@mui/material/ListItemText";
|
|
@@ -33,7 +33,7 @@ var X = (d, u) => {
|
|
|
33
33
|
key: `missed-${e.expectedDate.getTime()}`,
|
|
34
34
|
name: e.name,
|
|
35
35
|
amount: e.amount,
|
|
36
|
-
date:
|
|
36
|
+
date: W(e.expectedDate),
|
|
37
37
|
merchantGuid: e.merchantGuid,
|
|
38
38
|
categoryGuid: e.categoryGuid,
|
|
39
39
|
category: "",
|
|
@@ -88,7 +88,7 @@ var X = (d, u) => {
|
|
|
88
88
|
justifyContent: "space-between",
|
|
89
89
|
children: [/* @__PURE__ */ r(a, {
|
|
90
90
|
variant: "caption",
|
|
91
|
-
children: E(
|
|
91
|
+
children: E(H(t.date), A.MONTH_DAY_YEAR)
|
|
92
92
|
}), /* @__PURE__ */ i(l, {
|
|
93
93
|
alignItems: "center",
|
|
94
94
|
direction: "row",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
interface ProfileFormProps {
|
|
3
3
|
availableWidth?: number;
|
|
4
|
-
|
|
4
|
+
handleOnLeavClick?: () => void;
|
|
5
5
|
}
|
|
6
6
|
declare const _default: React.FunctionComponent<ProfileFormProps>;
|
|
7
7
|
export default _default;
|
|
@@ -1,185 +1,178 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { useScreenSize as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import j from "./actions/VerifyPhoneAction.es.js";
|
|
1
|
+
import { useAppConfig as L, useGlobalCopyStore as z, useSettingsStore as I, useUserStore as R } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { useScreenSize as N } from "../../../common/hooks/useScreenSize.es.js";
|
|
3
|
+
import j from "../../../common/components/dialog/Dialog.es.js";
|
|
4
|
+
import H from "./actions/VerifyEmailAction.es.js";
|
|
5
|
+
import J from "./actions/VerifyPhoneAction.es.js";
|
|
7
6
|
import p from "react";
|
|
8
|
-
import { observer as
|
|
9
|
-
import
|
|
10
|
-
import { H3 as
|
|
11
|
-
import
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { alpha as b, useTheme as
|
|
14
|
-
import
|
|
15
|
-
import { getUnixTime as
|
|
16
|
-
import
|
|
17
|
-
import { AdapterDateFns as
|
|
18
|
-
import { DatePicker as
|
|
19
|
-
import { LocalizationProvider as
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
first_name:
|
|
23
|
-
last_name:
|
|
24
|
-
email:
|
|
25
|
-
phone:
|
|
26
|
-
birthday:
|
|
27
|
-
postal_code:
|
|
28
|
-
credit_score:
|
|
29
|
-
}), [
|
|
7
|
+
import { observer as O } from "mobx-react-lite";
|
|
8
|
+
import d from "@mui/material/Stack";
|
|
9
|
+
import { H3 as $, P as G } from "@mxenabled/mxui";
|
|
10
|
+
import K from "@mui/material/Button";
|
|
11
|
+
import { Fragment as Y, jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
12
|
+
import { alpha as b, useTheme as q } from "@mui/material/styles";
|
|
13
|
+
import Q from "@mui/material/Box";
|
|
14
|
+
import { getUnixTime as W } from "date-fns/getUnixTime";
|
|
15
|
+
import m from "@mui/material/TextField";
|
|
16
|
+
import { AdapterDateFns as X } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
17
|
+
import { DatePicker as Z } from "@mui/x-date-pickers";
|
|
18
|
+
import { LocalizationProvider as ee } from "@mui/x-date-pickers/LocalizationProvider";
|
|
19
|
+
var te = ({ availableWidth: T, handleOnLeavClick: u }) => {
|
|
20
|
+
const f = q(), { common: U, settings: o } = z(), { isDesktop: y, isMobile: s, isSmallMobile: h, isTablet: v } = N(T), { config: x } = L(), { updateUser: D } = I(), { user: a } = R(), [r, V] = p.useState({
|
|
21
|
+
first_name: a.first_name,
|
|
22
|
+
last_name: a.last_name,
|
|
23
|
+
email: a.email,
|
|
24
|
+
phone: a.phone,
|
|
25
|
+
birthday: a.birthday,
|
|
26
|
+
postal_code: a.postal_code,
|
|
27
|
+
credit_score: a.credit_score
|
|
28
|
+
}), [c, C] = p.useState(!1), [k, g] = p.useState(!1), _ = p.useRef(null), w = r.email && !a.email_is_verified && !c, S = r.phone && !a.phone_is_verified && !c;
|
|
30
29
|
p.useEffect(() => {
|
|
31
|
-
if (
|
|
32
|
-
const e = (
|
|
33
|
-
_.current && !_.current.contains(
|
|
30
|
+
if (u) {
|
|
31
|
+
const e = (l) => {
|
|
32
|
+
_.current && !_.current.contains(l.target) && c && g(!0);
|
|
34
33
|
};
|
|
35
34
|
return document.addEventListener("mousedown", e), () => {
|
|
36
35
|
document.removeEventListener("mousedown", e);
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const e = /* @__PURE__ */ new Date(
|
|
43
|
-
return new Date(
|
|
38
|
+
}, [c]);
|
|
39
|
+
const P = () => {
|
|
40
|
+
if (r.birthday) {
|
|
41
|
+
const e = /* @__PURE__ */ new Date(r.birthday * 1e3), l = e.getUTCFullYear(), F = e.getUTCMonth(), M = e.getUTCDate();
|
|
42
|
+
return new Date(l, F, M);
|
|
44
43
|
}
|
|
45
|
-
},
|
|
46
|
-
await
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
g(!1),
|
|
52
|
-
},
|
|
44
|
+
}, E = async () => {
|
|
45
|
+
await D({
|
|
46
|
+
...a,
|
|
47
|
+
...r
|
|
48
|
+
}), C(!1);
|
|
49
|
+
}, A = () => {
|
|
50
|
+
g(!1), u && u();
|
|
51
|
+
}, B = () => {
|
|
53
52
|
g(!1);
|
|
54
53
|
}, n = (e) => {
|
|
55
|
-
const
|
|
56
|
-
...
|
|
54
|
+
const l = {
|
|
55
|
+
...r,
|
|
57
56
|
...e
|
|
58
57
|
};
|
|
59
|
-
|
|
60
|
-
...
|
|
61
|
-
...
|
|
62
|
-
}) !== JSON.stringify(
|
|
58
|
+
V(l), C(JSON.stringify({
|
|
59
|
+
...a,
|
|
60
|
+
...l
|
|
61
|
+
}) !== JSON.stringify(a));
|
|
63
62
|
};
|
|
64
|
-
return /* @__PURE__ */ i(
|
|
63
|
+
return /* @__PURE__ */ i(Y, { children: [/* @__PURE__ */ i(Q, {
|
|
65
64
|
component: "form",
|
|
66
65
|
ref: _,
|
|
67
66
|
sx: {
|
|
68
67
|
backgroundColor: "background.paper",
|
|
69
68
|
p: 24,
|
|
70
|
-
|
|
69
|
+
width: h ? 320 : v ? 680 : y ? 990 : 400,
|
|
70
|
+
"& .MuiTextField-root": { width: h ? 272 : v ? 328 : y ? 483 : 352 }
|
|
71
71
|
},
|
|
72
72
|
children: [
|
|
73
|
-
/* @__PURE__ */ t(
|
|
74
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t($, { children: o.personal_details }),
|
|
74
|
+
/* @__PURE__ */ t(G, {
|
|
75
75
|
variant: "body1",
|
|
76
76
|
children: o.update_information
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */ i(
|
|
79
|
-
direction:
|
|
80
|
-
spacing: 24,
|
|
78
|
+
/* @__PURE__ */ i(d, {
|
|
79
|
+
direction: s ? "column" : "row",
|
|
80
|
+
spacing: s ? 44 : 24,
|
|
81
81
|
sx: {
|
|
82
|
-
mb:
|
|
83
|
-
pt:
|
|
82
|
+
mb: 44,
|
|
83
|
+
pt: 32
|
|
84
84
|
},
|
|
85
|
-
children: [/* @__PURE__ */ t(
|
|
86
|
-
defaultValue:
|
|
85
|
+
children: [/* @__PURE__ */ t(m, {
|
|
86
|
+
defaultValue: r.first_name,
|
|
87
87
|
label: o.first_name,
|
|
88
88
|
onChange: (e) => n({ first_name: e.target.value })
|
|
89
|
-
}), /* @__PURE__ */ t(
|
|
90
|
-
defaultValue:
|
|
89
|
+
}), /* @__PURE__ */ t(m, {
|
|
90
|
+
defaultValue: r.last_name,
|
|
91
91
|
label: o.last_name,
|
|
92
92
|
onChange: (e) => n({ last_name: e.target.value })
|
|
93
93
|
})]
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */ i(
|
|
96
|
-
direction:
|
|
97
|
-
children: [
|
|
95
|
+
/* @__PURE__ */ i(d, {
|
|
96
|
+
direction: s ? "column" : "row",
|
|
97
|
+
children: [x.display_email_edit_field_in_settings && /* @__PURE__ */ i(d, {
|
|
98
98
|
sx: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
mr: c ? 0 : 24
|
|
99
|
+
mb: w ? 20 : 44,
|
|
100
|
+
mr: s ? 0 : 24
|
|
102
101
|
},
|
|
103
|
-
children: [/* @__PURE__ */ t(
|
|
104
|
-
defaultValue:
|
|
102
|
+
children: [/* @__PURE__ */ t(m, {
|
|
103
|
+
defaultValue: r.email,
|
|
105
104
|
label: o.email_address,
|
|
106
105
|
onChange: (e) => n({ email: e.target.value })
|
|
107
|
-
}),
|
|
108
|
-
}),
|
|
109
|
-
sx: {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
children: [/* @__PURE__ */ t(d, {
|
|
114
|
-
defaultValue: a.phone,
|
|
106
|
+
}), w && /* @__PURE__ */ t(H, {})]
|
|
107
|
+
}), x.display_sms_edit_field_in_settings && /* @__PURE__ */ i(d, {
|
|
108
|
+
sx: { mb: S ? 20 : 44 },
|
|
109
|
+
children: [/* @__PURE__ */ t(m, {
|
|
110
|
+
defaultValue: r.phone,
|
|
115
111
|
label: o.mobile_number,
|
|
116
112
|
onChange: (e) => n({ phone: e.target.value }),
|
|
117
113
|
type: "tel"
|
|
118
|
-
}),
|
|
114
|
+
}), S && /* @__PURE__ */ t(J, {})]
|
|
119
115
|
})]
|
|
120
116
|
}),
|
|
121
|
-
/* @__PURE__ */ i(
|
|
122
|
-
direction:
|
|
123
|
-
spacing: 24,
|
|
124
|
-
sx: { mb:
|
|
125
|
-
children: [/* @__PURE__ */ t(
|
|
126
|
-
dateAdapter:
|
|
127
|
-
children: /* @__PURE__ */ t(
|
|
117
|
+
/* @__PURE__ */ i(d, {
|
|
118
|
+
direction: s ? "column" : "row",
|
|
119
|
+
spacing: s ? 44 : 24,
|
|
120
|
+
sx: { mb: 44 },
|
|
121
|
+
children: [/* @__PURE__ */ t(ee, {
|
|
122
|
+
dateAdapter: X,
|
|
123
|
+
children: /* @__PURE__ */ t(Z, {
|
|
128
124
|
label: o.birthdate,
|
|
129
|
-
onChange: (e) => n({ birthday:
|
|
125
|
+
onChange: (e) => n({ birthday: W(e) }),
|
|
130
126
|
slotProps: {
|
|
131
127
|
nextIconButton: { sx: {
|
|
132
128
|
color: "primary.main",
|
|
133
|
-
"&:hover": { backgroundColor: b(
|
|
129
|
+
"&:hover": { backgroundColor: b(f.palette.primary.light, 0.1) }
|
|
134
130
|
} },
|
|
135
131
|
previousIconButton: { sx: {
|
|
136
132
|
color: "primary.main",
|
|
137
|
-
"&:hover": { backgroundColor: b(
|
|
133
|
+
"&:hover": { backgroundColor: b(f.palette.primary.light, 0.1) }
|
|
138
134
|
} }
|
|
139
135
|
},
|
|
140
136
|
sx: {
|
|
141
137
|
width: "100%",
|
|
142
138
|
"& .MuiIconButton-edgeEnd": {
|
|
143
139
|
color: "primary.main",
|
|
144
|
-
"&:hover": { backgroundColor: b(
|
|
140
|
+
"&:hover": { backgroundColor: b(f.palette.primary.light, 0.1) }
|
|
145
141
|
}
|
|
146
142
|
},
|
|
147
|
-
value:
|
|
143
|
+
value: P()
|
|
148
144
|
})
|
|
149
|
-
}), /* @__PURE__ */ t(
|
|
150
|
-
defaultValue:
|
|
145
|
+
}), /* @__PURE__ */ t(m, {
|
|
146
|
+
defaultValue: r.postal_code,
|
|
151
147
|
label: o.zip_code,
|
|
152
148
|
onChange: (e) => n({ postal_code: e.target.value })
|
|
153
149
|
})]
|
|
154
150
|
}),
|
|
155
|
-
/* @__PURE__ */ i(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
children: w.save_button
|
|
168
|
-
})
|
|
169
|
-
] })
|
|
151
|
+
/* @__PURE__ */ i(d, { children: [/* @__PURE__ */ t(m, {
|
|
152
|
+
defaultValue: r.credit_score,
|
|
153
|
+
label: o.credit_score,
|
|
154
|
+
onChange: (e) => n({ credit_score: Number(e.target.value) }),
|
|
155
|
+
sx: { mb: 44 }
|
|
156
|
+
}), /* @__PURE__ */ t(K, {
|
|
157
|
+
disabled: !c,
|
|
158
|
+
onClick: E,
|
|
159
|
+
sx: { width: h ? 272 : 124 },
|
|
160
|
+
variant: "contained",
|
|
161
|
+
children: U.save_button
|
|
162
|
+
})] })
|
|
170
163
|
]
|
|
171
|
-
}), /* @__PURE__ */ t(
|
|
164
|
+
}), /* @__PURE__ */ t(j, {
|
|
172
165
|
copy: { title: o.discard_changes },
|
|
173
|
-
isOpen:
|
|
174
|
-
onClose:
|
|
175
|
-
onSecondaryAction:
|
|
166
|
+
isOpen: k,
|
|
167
|
+
onClose: B,
|
|
168
|
+
onSecondaryAction: A,
|
|
176
169
|
primaryText: o.keep_editing,
|
|
177
170
|
secondaryText: o.leave,
|
|
178
171
|
children: o.discard_changes_message
|
|
179
172
|
})] });
|
|
180
|
-
},
|
|
173
|
+
}, ve = O(te);
|
|
181
174
|
export {
|
|
182
|
-
|
|
175
|
+
ve as default
|
|
183
176
|
};
|
|
184
177
|
|
|
185
178
|
//# sourceMappingURL=ProfileTab.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileTab.es.js","names":[],"sources":["../../../../src/settings/components/profile/ProfileTab.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { getUnixTime } from 'date-fns/getUnixTime'\n\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'\nimport { DatePicker } from '@mui/x-date-pickers'\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\n\nimport { alpha, useTheme } from '@mui/material/styles'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { H3, P } from '@mxenabled/mxui'\n\nimport {\n useAppConfig,\n useGlobalCopyStore,\n useScreenSize,\n useSettingsStore,\n useUserStore,\n Dialog,\n} from '../../../common'\nimport { type EditableUser } from '../../../core'\nimport ResetPasswordAction from './actions/ResetPasswordAction'\nimport VerifyEmailAction from './actions/VerifyEmailAction'\nimport VerifyPhoneAction from './actions/VerifyPhoneAction'\n\ninterface ProfileFormProps {\n availableWidth?: number\n handleOnLeaveClick?: () => void\n}\n\ntype UserInput = {\n [U in keyof EditableUser]: EditableUser[U]\n}\n\nconst ProfileForm: React.FC<ProfileFormProps> = ({ availableWidth, handleOnLeaveClick }) => {\n const theme = useTheme()\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { isMobile } = useScreenSize(availableWidth)\n const { config } = useAppConfig()\n const { updateUser } = useSettingsStore()\n const { user } = useUserStore()\n\n const [modifiedUser, setModifiedUser] = React.useState<EditableUser>({\n first_name: user.first_name,\n last_name: user.last_name,\n email: user.email,\n phone: user.phone,\n birthday: user.birthday,\n postal_code: user.postal_code,\n credit_score: user.credit_score,\n })\n const [hasUnsavedChanges, setHasUnsavedChanges] = React.useState(false)\n const [showLeaveDialog, setShowLeaveDialog] = React.useState(false)\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n const showVerifyEmail = modifiedUser.email && !user.email_is_verified && !hasUnsavedChanges\n const showVerifyPhone = modifiedUser.phone && !user.phone_is_verified && !hasUnsavedChanges\n\n React.useEffect(() => {\n if (handleOnLeaveClick) {\n const handleClickOutside = (event: MouseEvent) => {\n if (boxRef.current && !boxRef.current.contains(event.target as Node) && hasUnsavedChanges) {\n setShowLeaveDialog(true)\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }\n return undefined\n }, [hasUnsavedChanges])\n\n // eslint-disable-next-line consistent-return\n const formatReadableBirthday = () => {\n if (modifiedUser.birthday) {\n const utc = new Date(modifiedUser.birthday * 1000)\n const year = utc.getUTCFullYear()\n const month = utc.getUTCMonth()\n const day = utc.getUTCDate()\n return new Date(year, month, day)\n }\n }\n\n const handleSave = async () => {\n await updateUser({ ...user, ...modifiedUser })\n setHasUnsavedChanges(false)\n }\n\n const handleLeaveDialog = () => {\n setShowLeaveDialog(false)\n\n if (handleOnLeaveClick) {\n handleOnLeaveClick()\n }\n }\n\n const handleKeepEditing = () => {\n setShowLeaveDialog(false)\n }\n\n const handleInput = (update: UserInput) => {\n const changedUser = {\n ...modifiedUser,\n ...update,\n }\n setModifiedUser(changedUser)\n setHasUnsavedChanges(JSON.stringify({ ...user, ...changedUser }) !== JSON.stringify(user))\n }\n\n return (\n <>\n <Box\n component=\"form\"\n ref={boxRef}\n sx={{\n backgroundColor: 'background.paper',\n p: 24,\n '& .MuiTextField-root': {\n flex: 1,\n },\n }}\n >\n <H3>{settingsCopy.personal_details}</H3>\n <P variant=\"body1\">{settingsCopy.update_information}</P>\n <Stack direction={isMobile ? 'column' : 'row'} spacing={24} sx={{ mb: 24, pt: 24 }}>\n <TextField\n defaultValue={modifiedUser.first_name}\n label={settingsCopy.first_name}\n onChange={(e) => handleInput({ first_name: e.target.value })}\n />\n <TextField\n defaultValue={modifiedUser.last_name}\n label={settingsCopy.last_name}\n onChange={(e) => handleInput({ last_name: e.target.value })}\n />\n </Stack>\n <Stack direction={isMobile ? 'column' : 'row'}>\n {config.display_email_edit_field_in_settings && (\n <Stack sx={{ flex: 1, mb: showVerifyEmail ? 20 : 24, mr: isMobile ? 0 : 24 }}>\n <TextField\n defaultValue={modifiedUser.email}\n label={settingsCopy.email_address}\n onChange={(e) => handleInput({ email: e.target.value })}\n />\n {showVerifyEmail && <VerifyEmailAction />}\n </Stack>\n )}\n {config.display_sms_edit_field_in_settings && (\n <Stack sx={{ flex: 1, mb: showVerifyPhone ? 20 : 24 }}>\n <TextField\n defaultValue={modifiedUser.phone}\n label={settingsCopy.mobile_number}\n onChange={(e) => handleInput({ phone: e.target.value })}\n type=\"tel\"\n />\n {showVerifyPhone && <VerifyPhoneAction />}\n </Stack>\n )}\n </Stack>\n <Stack direction={isMobile ? 'column' : 'row'} spacing={24} sx={{ mb: 24 }}>\n <LocalizationProvider dateAdapter={AdapterDateFns}>\n <DatePicker\n label={settingsCopy.birthdate}\n onChange={(value) => handleInput({ birthday: getUnixTime(value as Date) })}\n slotProps={{\n nextIconButton: {\n sx: {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n previousIconButton: {\n sx: {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n }}\n sx={{\n width: '100%',\n '& .MuiIconButton-edgeEnd': {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n }}\n value={formatReadableBirthday()}\n />\n </LocalizationProvider>\n <TextField\n defaultValue={modifiedUser.postal_code}\n label={settingsCopy.zip_code}\n onChange={(e) => handleInput({ postal_code: e.target.value })}\n />\n </Stack>\n <Stack>\n <TextField\n defaultValue={modifiedUser.credit_score}\n label={settingsCopy.credit_score}\n onChange={(e) => handleInput({ credit_score: Number(e.target.value) })}\n />\n {config.display_password_options_in_settings && <ResetPasswordAction />}\n <Button\n disabled={!hasUnsavedChanges}\n onClick={handleSave}\n sx={{ width: isMobile ? '100%' : 124 }}\n variant=\"contained\"\n >\n {commonCopy.save_button}\n </Button>\n </Stack>\n </Box>\n <Dialog\n copy={{ title: settingsCopy.discard_changes }}\n isOpen={showLeaveDialog}\n onClose={handleKeepEditing}\n onSecondaryAction={handleLeaveDialog}\n primaryText={settingsCopy.keep_editing}\n secondaryText={settingsCopy.leave}\n >\n {settingsCopy.discard_changes_message}\n </Dialog>\n </>\n )\n}\n\nexport default observer(ProfileForm)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,IAAM,IAAA,CAA2C,EAAE,gBAAA,GAAgB,oBAAA,EAAA,MAAyB;AAC1F,QAAM,IAAQ,EAAS,GACjB,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB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,EAAA,CAAA;AAAA,IACJ;AAAA,EACL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAE,OAAO,EAAa,gBAAgB;AAAA,IAC5C,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,aAAa,EAAa;AAAA,IAC1B,eAAe,EAAa;AAAA,IAE3B,UAAA,EAAa;AAAA,EACR,CAAA,CACR,EAAA,CAAA;AAEN,GAEA,KAAe,EAAS,CAAW"}
|
|
1
|
+
{"version":3,"file":"ProfileTab.es.js","names":[],"sources":["../../../../src/settings/components/profile/ProfileTab.tsx"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n\nimport React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { getUnixTime } from 'date-fns/getUnixTime'\n\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'\nimport { DatePicker } from '@mui/x-date-pickers'\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\n\nimport { alpha, useTheme } from '@mui/material/styles'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { H3, P } from '@mxenabled/mxui'\n\nimport {\n useAppConfig,\n useGlobalCopyStore,\n useScreenSize,\n useSettingsStore,\n useUserStore,\n Dialog,\n} from '../../../common'\nimport { type EditableUser } from '../../../core'\nimport VerifyEmailAction from './actions/VerifyEmailAction'\nimport VerifyPhoneAction from './actions/VerifyPhoneAction'\n\ninterface ProfileFormProps {\n availableWidth?: number\n handleOnLeavClick?: () => void\n}\n\ntype UserInput = {\n [U in keyof EditableUser]: EditableUser[U]\n}\n\nconst ProfileForm: React.FC<ProfileFormProps> = ({ availableWidth, handleOnLeavClick }) => {\n const theme = useTheme()\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { isDesktop, isMobile, isSmallMobile, isTablet } = useScreenSize(availableWidth)\n const { config } = useAppConfig()\n const { updateUser } = useSettingsStore()\n const { user } = useUserStore()\n\n const [modifiedUser, setModifiedUser] = React.useState<EditableUser>({\n first_name: user.first_name,\n last_name: user.last_name,\n email: user.email,\n phone: user.phone,\n birthday: user.birthday,\n postal_code: user.postal_code,\n credit_score: user.credit_score,\n })\n const [hasUnsavedChanges, setHasUnsavedChanges] = React.useState(false)\n const [showLeaveDialog, setShowLeaveDialog] = React.useState(false)\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n const showVerifyEmail = modifiedUser.email && !user.email_is_verified && !hasUnsavedChanges\n const showVerifyPhone = modifiedUser.phone && !user.phone_is_verified && !hasUnsavedChanges\n\n React.useEffect(() => {\n if (handleOnLeavClick) {\n const handleClickOutside = (event: MouseEvent) => {\n if (boxRef.current && !boxRef.current.contains(event.target as Node) && hasUnsavedChanges) {\n setShowLeaveDialog(true)\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }\n return undefined\n }, [hasUnsavedChanges])\n\n // eslint-disable-next-line consistent-return\n const formatReadableBirthday = () => {\n if (modifiedUser.birthday) {\n const utc = new Date(modifiedUser.birthday * 1000)\n const year = utc.getUTCFullYear()\n const month = utc.getUTCMonth()\n const day = utc.getUTCDate()\n return new Date(year, month, day)\n }\n }\n\n const handleSave = async () => {\n await updateUser({ ...user, ...modifiedUser })\n setHasUnsavedChanges(false)\n }\n\n const handleLeaveDialog = () => {\n setShowLeaveDialog(false)\n\n if (handleOnLeavClick) {\n handleOnLeavClick()\n }\n }\n\n const handleKeepEditing = () => {\n setShowLeaveDialog(false)\n }\n\n const handleInput = (update: UserInput) => {\n const changedUser = {\n ...modifiedUser,\n ...update,\n }\n setModifiedUser(changedUser)\n setHasUnsavedChanges(JSON.stringify({ ...user, ...changedUser }) !== JSON.stringify(user))\n }\n\n return (\n <>\n <Box\n component=\"form\"\n ref={boxRef}\n sx={{\n backgroundColor: 'background.paper',\n p: 24,\n width: isSmallMobile ? 320 : isTablet ? 680 : isDesktop ? 990 : 400,\n '& .MuiTextField-root': {\n width: isSmallMobile ? 272 : isTablet ? 328 : isDesktop ? 483 : 352,\n },\n }}\n >\n <H3>{settingsCopy.personal_details}</H3>\n <P variant=\"body1\">{settingsCopy.update_information}</P>\n <Stack\n direction={isMobile ? 'column' : 'row'}\n spacing={isMobile ? 44 : 24}\n sx={{ mb: 44, pt: 32 }}\n >\n <TextField\n defaultValue={modifiedUser.first_name}\n label={settingsCopy.first_name}\n onChange={(e) => handleInput({ first_name: e.target.value })}\n />\n <TextField\n defaultValue={modifiedUser.last_name}\n label={settingsCopy.last_name}\n onChange={(e) => handleInput({ last_name: e.target.value })}\n />\n </Stack>\n <Stack direction={isMobile ? 'column' : 'row'}>\n {config.display_email_edit_field_in_settings && (\n <Stack sx={{ mb: showVerifyEmail ? 20 : 44, mr: isMobile ? 0 : 24 }}>\n <TextField\n defaultValue={modifiedUser.email}\n label={settingsCopy.email_address}\n onChange={(e) => handleInput({ email: e.target.value })}\n />\n {showVerifyEmail && <VerifyEmailAction />}\n </Stack>\n )}\n {config.display_sms_edit_field_in_settings && (\n <Stack sx={{ mb: showVerifyPhone ? 20 : 44 }}>\n <TextField\n defaultValue={modifiedUser.phone}\n label={settingsCopy.mobile_number}\n onChange={(e) => handleInput({ phone: e.target.value })}\n type=\"tel\"\n />\n {showVerifyPhone && <VerifyPhoneAction />}\n </Stack>\n )}\n </Stack>\n <Stack direction={isMobile ? 'column' : 'row'} spacing={isMobile ? 44 : 24} sx={{ mb: 44 }}>\n <LocalizationProvider dateAdapter={AdapterDateFns}>\n <DatePicker\n label={settingsCopy.birthdate}\n onChange={(value) => handleInput({ birthday: getUnixTime(value as Date) })}\n slotProps={{\n nextIconButton: {\n sx: {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n previousIconButton: {\n sx: {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n }}\n sx={{\n width: '100%',\n '& .MuiIconButton-edgeEnd': {\n color: 'primary.main',\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n }}\n value={formatReadableBirthday()}\n />\n </LocalizationProvider>\n <TextField\n defaultValue={modifiedUser.postal_code}\n label={settingsCopy.zip_code}\n onChange={(e) => handleInput({ postal_code: e.target.value })}\n />\n </Stack>\n <Stack>\n <TextField\n defaultValue={modifiedUser.credit_score}\n label={settingsCopy.credit_score}\n onChange={(e) => handleInput({ credit_score: Number(e.target.value) })}\n sx={{ mb: 44 }}\n />\n <Button\n disabled={!hasUnsavedChanges}\n onClick={handleSave}\n sx={{ width: isSmallMobile ? 272 : 124 }}\n variant=\"contained\"\n >\n {commonCopy.save_button}\n </Button>\n </Stack>\n </Box>\n <Dialog\n copy={{ title: settingsCopy.discard_changes }}\n isOpen={showLeaveDialog}\n onClose={handleKeepEditing}\n onSecondaryAction={handleLeaveDialog}\n primaryText={settingsCopy.keep_editing}\n secondaryText={settingsCopy.leave}\n >\n {settingsCopy.discard_changes_message}\n </Dialog>\n </>\n )\n}\n\nexport default observer(ProfileForm)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,IAAM,KAAA,CAA2C,EAAE,gBAAA,GAAgB,mBAAA,EAAA,MAAwB;AACzF,QAAM,IAAQ,EAAS,GACjB,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB,EAAmB,GACpE,EAAE,WAAA,GAAW,UAAA,GAAU,eAAA,GAAe,UAAA,EAAA,IAAa,EAAc,CAAc,GAC/E,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,MAAA,EAAA,IAAS,EAAa,GAExB,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAuB;AAAA,IACnE,YAAY,EAAK;AAAA,IACjB,WAAW,EAAK;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,OAAO,EAAK;AAAA,IACZ,UAAU,EAAK;A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S,EAAW"}
|
|
@@ -4,35 +4,46 @@ import a from "react";
|
|
|
4
4
|
import { observer as y } from "mobx-react-lite";
|
|
5
5
|
import g from "@mui/material/Stack";
|
|
6
6
|
import { Text as o } from "@mxenabled/mxui";
|
|
7
|
-
import
|
|
8
|
-
import { ChevronRight as
|
|
9
|
-
import { jsx as
|
|
7
|
+
import b from "@mui/material/Button";
|
|
8
|
+
import { ChevronRight as v } from "@mxenabled/mx-icons";
|
|
9
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
10
10
|
import { useTheme as C } from "@mui/material/styles";
|
|
11
|
-
var
|
|
12
|
-
const { common: s, settings:
|
|
11
|
+
var E = y(() => {
|
|
12
|
+
const { common: s, settings: e } = f(), { sendEmailVerification: c } = h(), { user: l } = u(), m = C(), [p, i] = a.useState(!1), n = () => {
|
|
13
13
|
i(!1);
|
|
14
14
|
}, d = () => {
|
|
15
15
|
i(!0);
|
|
16
16
|
};
|
|
17
|
-
return /* @__PURE__ */ r(a.Fragment, { children: [/* @__PURE__ */ r(
|
|
17
|
+
return /* @__PURE__ */ r(a.Fragment, { children: [/* @__PURE__ */ r(b, {
|
|
18
18
|
onClick: d,
|
|
19
19
|
sx: {
|
|
20
20
|
height: "auto",
|
|
21
21
|
p: 4,
|
|
22
22
|
width: "fit-content"
|
|
23
23
|
},
|
|
24
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ t(o, {
|
|
25
25
|
variant: "body2",
|
|
26
|
-
children:
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
-
}), /* @__PURE__ */
|
|
29
|
-
copy: { title:
|
|
26
|
+
children: e.verify_email
|
|
27
|
+
}), /* @__PURE__ */ t(v, {})]
|
|
28
|
+
}), /* @__PURE__ */ t(x, {
|
|
29
|
+
copy: { title: "" },
|
|
30
30
|
isOpen: p,
|
|
31
31
|
onClose: n,
|
|
32
32
|
onPrimaryAction: c,
|
|
33
33
|
onSecondaryAction: n,
|
|
34
|
-
primaryText:
|
|
34
|
+
primaryText: e.send_verification,
|
|
35
35
|
secondaryText: s.back,
|
|
36
|
+
sx: {
|
|
37
|
+
"& .MuiDialogContent-root": {
|
|
38
|
+
pt: 0,
|
|
39
|
+
width: 400
|
|
40
|
+
},
|
|
41
|
+
"& .MuiToolbar-root:last-child": {
|
|
42
|
+
gap: 16,
|
|
43
|
+
padding: "32px 60px 48px",
|
|
44
|
+
justifyContent: "center"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
36
47
|
children: /* @__PURE__ */ r(g, {
|
|
37
48
|
spacing: 16,
|
|
38
49
|
sx: {
|
|
@@ -41,31 +52,37 @@ var V = y(() => {
|
|
|
41
52
|
width: "100%"
|
|
42
53
|
},
|
|
43
54
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ t(o, {
|
|
56
|
+
bold: !0,
|
|
57
|
+
truncate: !1,
|
|
58
|
+
variant: "body1",
|
|
59
|
+
children: e.confirm_your_email
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ t(o, {
|
|
45
62
|
truncate: !1,
|
|
46
63
|
variant: "body2",
|
|
47
|
-
children:
|
|
64
|
+
children: e.confirm_email
|
|
48
65
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ t(o, {
|
|
50
67
|
sx: {
|
|
51
|
-
border: `1px solid ${
|
|
68
|
+
border: `1px solid ${m.palette.neutral.light}`,
|
|
52
69
|
borderRadius: "4px",
|
|
53
70
|
p: "16px 32px"
|
|
54
71
|
},
|
|
55
72
|
variant: "h3",
|
|
56
|
-
children:
|
|
73
|
+
children: l.email
|
|
57
74
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ t(o, {
|
|
59
76
|
truncate: !1,
|
|
60
77
|
variant: "body2",
|
|
61
|
-
children:
|
|
78
|
+
children: e.verification_notice_email
|
|
62
79
|
})
|
|
63
80
|
]
|
|
64
81
|
})
|
|
65
82
|
})] });
|
|
66
83
|
});
|
|
67
84
|
export {
|
|
68
|
-
|
|
85
|
+
E as default
|
|
69
86
|
};
|
|
70
87
|
|
|
71
88
|
//# sourceMappingURL=VerifyEmailAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyEmailAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyEmailAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { Dialog, useGlobalCopyStore, useSettingsStore, useUserStore } from '../../../../common'\n\nconst VerifyEmailAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { sendEmailVerification } = useSettingsStore()\n const { user } = useUserStore()\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n\n const handleClose = (): void => {\n setIsOpen(false)\n }\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n return (\n <React.Fragment>\n <Button onClick={handleOpen} sx={{ height: 'auto', p: 4, width: 'fit-content' }}>\n <Text variant=\"body2\">{settingsCopy.verify_email}</Text>\n <ChevronRight />\n </Button>\n <Dialog\n copy={{ title:
|
|
1
|
+
{"version":3,"file":"VerifyEmailAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyEmailAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { Dialog, useGlobalCopyStore, useSettingsStore, useUserStore } from '../../../../common'\n\nconst VerifyEmailAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { sendEmailVerification } = useSettingsStore()\n const { user } = useUserStore()\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n\n const handleClose = (): void => {\n setIsOpen(false)\n }\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n return (\n <React.Fragment>\n <Button onClick={handleOpen} sx={{ height: 'auto', p: 4, width: 'fit-content' }}>\n <Text variant=\"body2\">{settingsCopy.verify_email}</Text>\n <ChevronRight />\n </Button>\n <Dialog\n copy={{ title: '' }}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={sendEmailVerification}\n onSecondaryAction={handleClose}\n primaryText={settingsCopy.send_verification}\n secondaryText={commonCopy.back}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n\n '& .MuiToolbar-root:last-child': {\n gap: 16,\n padding: '32px 60px 48px',\n justifyContent: 'center',\n },\n }}\n >\n <Stack spacing={16} sx={{ px: 40, textAlign: 'center', width: '100%' }}>\n <Text bold={true} truncate={false} variant=\"body1\">\n {settingsCopy.confirm_your_email}\n </Text>\n <Text truncate={false} variant=\"body2\">\n {settingsCopy.confirm_email}\n </Text>\n <Text\n sx={{\n border: `1px solid ${theme.palette.neutral.light}`,\n borderRadius: '4px',\n p: '16px 32px',\n }}\n variant=\"h3\"\n >\n {user.email}\n </Text>\n <Text truncate={false} variant=\"body2\">\n {settingsCopy.verification_notice_email}\n </Text>\n </Stack>\n </Dialog>\n </React.Fragment>\n )\n})\n\nexport default VerifyEmailAction\n"],"mappings":";;;;;;;;;;AAYA,IAAM,IAAoB,EAAA,MAAe;AACvC,QAAM,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB,EAAmB,GACpE,EAAE,uBAAA,EAAA,IAA0B,EAAiB,GAC7C,EAAE,MAAA,EAAA,IAAS,EAAa,GACxB,IAAQ,EAAS,GAEjB,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAK,GAE1C,IAAA,MAA0B;AAC9B,IAAA,EAAU,EAAK;A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AAQ,aAAa,EAAM,QAAQ,QAAQ,KAAA;AAAA,YAC3C,cAAc;AAAA,YACd,GAAG;AAAA,UACL;AAAA,UACA,SAAQ;AAAA,UAEP,UAAA,EAAK;AAAA,QACF,CAAA;AAAA,QACN,gBAAA,EAAC,GAAD;AAAA,UAAM,UAAU;AAAA,UAAO,SAAQ;AAAA,UAC5B,UAAA,EAAa;AAAA,QACV,CAAA;AAAA,MACD;AAAA;EACD,CAAA,CACM,EAAA,CAAA;AAEpB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useGlobalCopyStore as v, useSettingsStore as
|
|
2
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as v, useSettingsStore as b, useUserStore as C } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import T from "../../../../common/components/dialog/Dialog.es.js";
|
|
3
3
|
import S from "./VerifyTokenAction.es.js";
|
|
4
4
|
import r from "react";
|
|
5
5
|
import { observer as k } from "mobx-react-lite";
|
|
@@ -10,10 +10,10 @@ import { ChevronRight as w } from "@mxenabled/mx-icons";
|
|
|
10
10
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
11
11
|
import { useTheme as A } from "@mui/material/styles";
|
|
12
12
|
var $ = k(() => {
|
|
13
|
-
const { common: c, settings: o } = v(), { sendPhoneVerification: l, verifyPhoneToken: p } =
|
|
14
|
-
|
|
13
|
+
const { common: c, settings: o } = v(), { sendPhoneVerification: l, verifyPhoneToken: p } = b(), { user: f } = C(), h = A(), [d, a] = r.useState(!1), [m, n] = r.useState(!1), s = () => {
|
|
14
|
+
a(!1);
|
|
15
15
|
}, y = () => {
|
|
16
|
-
|
|
16
|
+
a(!0);
|
|
17
17
|
}, u = () => {
|
|
18
18
|
l().finally(() => {
|
|
19
19
|
n(!0);
|
|
@@ -36,12 +36,12 @@ var $ = k(() => {
|
|
|
36
36
|
children: o.verify_phone
|
|
37
37
|
}), /* @__PURE__ */ e(w, {})]
|
|
38
38
|
}),
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
copy: { title:
|
|
41
|
-
isOpen:
|
|
42
|
-
onClose:
|
|
39
|
+
/* @__PURE__ */ e(T, {
|
|
40
|
+
copy: { title: "" },
|
|
41
|
+
isOpen: d,
|
|
42
|
+
onClose: s,
|
|
43
43
|
onPrimaryAction: u,
|
|
44
|
-
onSecondaryAction:
|
|
44
|
+
onSecondaryAction: s,
|
|
45
45
|
primaryText: o.send_verification,
|
|
46
46
|
secondaryText: c.back,
|
|
47
47
|
sx: {
|
|
@@ -63,6 +63,12 @@ var $ = k(() => {
|
|
|
63
63
|
width: "100%"
|
|
64
64
|
},
|
|
65
65
|
children: [
|
|
66
|
+
/* @__PURE__ */ e(t, {
|
|
67
|
+
bold: !0,
|
|
68
|
+
truncate: !1,
|
|
69
|
+
variant: "body1",
|
|
70
|
+
children: o.confirm_your_phone
|
|
71
|
+
}),
|
|
66
72
|
/* @__PURE__ */ e(t, {
|
|
67
73
|
truncate: !1,
|
|
68
74
|
variant: "body2",
|
|
@@ -88,7 +94,7 @@ var $ = k(() => {
|
|
|
88
94
|
/* @__PURE__ */ e(S, {
|
|
89
95
|
handleClose: () => n(!1),
|
|
90
96
|
handleVerify: x,
|
|
91
|
-
isOpen:
|
|
97
|
+
isOpen: m
|
|
92
98
|
})
|
|
93
99
|
] });
|
|
94
100
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyPhoneAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyPhoneAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { Dialog, useGlobalCopyStore, useSettingsStore, useUserStore } from '../../../../common'\nimport VerifyTokenAction from './VerifyTokenAction'\n\nconst VerifyPhoneAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { sendPhoneVerification, verifyPhoneToken } = useSettingsStore()\n const { user } = useUserStore()\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n const [showVerifyToken, setShowVerifyToken] = React.useState(false)\n\n const handleClose = (): void => {\n setIsOpen(false)\n }\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n const handlePhoneVerify = () => {\n sendPhoneVerification().finally(() => {\n setShowVerifyToken(true)\n })\n }\n\n const handleTokenVerify = (token: string) => {\n verifyPhoneToken(token).finally(() => {\n setShowVerifyToken(false)\n })\n }\n\n return (\n <React.Fragment>\n <Button onClick={handleOpen} sx={{ height: 'auto', p: 4, width: 'fit-content' }}>\n <Text variant=\"body2\">{settingsCopy.verify_phone}</Text>\n <ChevronRight />\n </Button>\n <Dialog\n copy={{ title:
|
|
1
|
+
{"version":3,"file":"VerifyPhoneAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyPhoneAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { Dialog, useGlobalCopyStore, useSettingsStore, useUserStore } from '../../../../common'\nimport VerifyTokenAction from './VerifyTokenAction'\n\nconst VerifyPhoneAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { sendPhoneVerification, verifyPhoneToken } = useSettingsStore()\n const { user } = useUserStore()\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n const [showVerifyToken, setShowVerifyToken] = React.useState(false)\n\n const handleClose = (): void => {\n setIsOpen(false)\n }\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n const handlePhoneVerify = () => {\n sendPhoneVerification().finally(() => {\n setShowVerifyToken(true)\n })\n }\n\n const handleTokenVerify = (token: string) => {\n verifyPhoneToken(token).finally(() => {\n setShowVerifyToken(false)\n })\n }\n\n return (\n <React.Fragment>\n <Button onClick={handleOpen} sx={{ height: 'auto', p: 4, width: 'fit-content' }}>\n <Text variant=\"body2\">{settingsCopy.verify_phone}</Text>\n <ChevronRight />\n </Button>\n <Dialog\n copy={{ title: '' }}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={handlePhoneVerify}\n onSecondaryAction={handleClose}\n primaryText={settingsCopy.send_verification}\n secondaryText={commonCopy.back}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n\n '& .MuiToolbar-root:last-child': {\n gap: 16,\n padding: '32px 60px 48px',\n justifyContent: 'center',\n },\n }}\n >\n <Stack spacing={16} sx={{ px: 40, textAlign: 'center', width: '100%' }}>\n <Text bold={true} truncate={false} variant=\"body1\">\n {settingsCopy.confirm_your_phone}\n </Text>\n <Text truncate={false} variant=\"body2\">\n {settingsCopy.confirm_phone}\n </Text>\n <Text\n sx={{\n border: `1px solid ${theme.palette.neutral.light}`,\n borderRadius: '4px',\n p: '16px 32px',\n }}\n variant=\"h3\"\n >\n {user.phone}\n </Text>\n <Text truncate={false} variant=\"body2\">\n {settingsCopy.verification_notice_phone}\n </Text>\n </Stack>\n </Dialog>\n <VerifyTokenAction\n handleClose={() => setShowVerifyToken(false)}\n handleVerify={handleTokenVerify}\n isOpen={showVerifyToken}\n />\n </React.Fragment>\n )\n})\n\nexport default VerifyPhoneAction\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,IAAoB,EAAA,MAAe;AACvC,QAAM,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB,EAAmB,GACpE,EAAE,uBAAA,GAAuB,kBAAA,EAAA,IAAqB,EAAiB,GAC/D,EAAE,MAAA,EAAA,IAAS,EAAa,GACxB,IAAQ,EAAS,GAEjB,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAK,GAC1C,CAAC,GAAiB,CAAA,IA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