@os-team/profile 1.1.11 → 1.1.13
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/dist/cjs/components/profile/ProfileButton.js +1 -2
- package/dist/cjs/components/profile/ProfileButton.js.map +1 -1
- package/dist/cjs/components/profile/ProfileConfigContext.js +5 -7
- package/dist/cjs/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileContext.js +5 -7
- package/dist/cjs/components/profile/ProfileContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawer.js +4 -5
- package/dist/cjs/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawerContent.js +23 -24
- package/dist/cjs/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/cjs/components/profile/ProfileNavigationItem.js +1 -2
- package/dist/cjs/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js +36 -21
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +39 -22
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/cjs/components/profile/ProtectedWrapper.js +4 -5
- package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatar.js +4 -5
- package/dist/cjs/components/profile/UserAvatar.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatarAddon.js +1 -2
- package/dist/cjs/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +2 -3
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +2 -3
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +2 -3
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +2 -3
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawer.js +4 -5
- package/dist/cjs/components/session/SessionDrawer.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawerContent.js +4 -5
- package/dist/cjs/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/cjs/components/session/SessionList.js +8 -12
- package/dist/cjs/components/session/SessionList.js.map +1 -1
- package/dist/cjs/components/session/SessionListItem.js +10 -15
- package/dist/cjs/components/session/SessionListItem.js.map +1 -1
- package/dist/cjs/components/session/SessionListSkeleton.js +1 -2
- package/dist/cjs/components/session/SessionListSkeleton.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js +2 -3
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +2 -3
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js +2 -3
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js +2 -3
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/cjs/components/session/formatDate.js +1 -2
- package/dist/cjs/components/session/formatDate.js.map +1 -1
- package/dist/cjs/components/session/getLastSeen.js +1 -2
- package/dist/cjs/components/session/getLastSeen.js.map +1 -1
- package/dist/cjs/components/shared/ButtonUpdate.js +1 -2
- package/dist/cjs/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/cjs/components/shared/ErrorResult.js +1 -2
- package/dist/cjs/components/shared/ErrorResult.js.map +1 -1
- package/dist/cjs/components/shared/FormError.js +1 -2
- package/dist/cjs/components/shared/FormError.js.map +1 -1
- package/dist/cjs/components/shared/MainLoader.js +1 -2
- package/dist/cjs/components/shared/MainLoader.js.map +1 -1
- package/dist/cjs/components/shared/icons/AndroidIcon.js +1 -2
- package/dist/cjs/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/AppleIcon.js +1 -2
- package/dist/cjs/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/BrowserIcon.js +1 -2
- package/dist/cjs/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/ProfileIcon.js +1 -2
- package/dist/cjs/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js +1 -2
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/getErrorMessage.js +2 -3
- package/dist/cjs/utils/getErrorMessage.js.map +1 -1
- package/dist/cjs/utils/getUserFullName.js +1 -2
- package/dist/cjs/utils/getUserFullName.js.map +1 -1
- package/dist/cjs/utils/handleFormErrors.js +3 -5
- package/dist/cjs/utils/handleFormErrors.js.map +1 -1
- package/dist/esm/components/profile/ProfileDrawerContent.js +16 -16
- package/dist/esm/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameModal.js +25 -15
- package/dist/esm/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js +31 -19
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/esm/components/session/SessionListItem.js +1 -1
- package/dist/esm/components/session/SessionListItem.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionDrawerContentQuery.graphql.js +1 -1
- package/dist/esm/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +1 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItem_session.graphql.js +1 -1
- package/dist/esm/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListRefetchQuery.graphql.js +1 -1
- package/dist/esm/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/types/src/lib/components/profile/ProfileDrawerContent.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/ProfileUpdateNameModal.d.ts +1 -1
- package/dist/types/src/lib/components/profile/ProfileUpdateNameModal.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/ProfileUpdatePasswordModal.d.ts +1 -1
- package/dist/types/src/lib/components/profile/ProfileUpdatePasswordModal.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts +1 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts +2 -2
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts +4 -4
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts +4 -4
- package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListItem_session.graphql.d.ts +12 -12
- package/dist/types/src/lib/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts +1 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +1 -1
- package/package.json +35 -35
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +0 -65
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +0 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +0 -80
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +0 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +0 -58
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +0 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +0 -73
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts +0 -14
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts +0 -20
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.js","names":["_react","_interopRequireDefault","require","_core","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ProfileButton","props","createElement","Button","type","wide","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '@os-design/core';\n\nconst ProfileButton: React.FC<ButtonProps> = (props) => (\n <Button type='ghost' wide='always' {...props} />\n);\n\nexport default ProfileButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAsD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEtD,IAAMQ,aAAoC,GAAG,SAAvCA,aAAoCA,CAAIC,KAAK;EAAA,oBACjDtB,MAAA,CAAAM,OAAA,CAAAiB,aAAA,CAACpB,KAAA,CAAAqB,MAAM,EAAAjB,QAAA;IAACkB,IAAI,EAAC,OAAO;IAACC,IAAI,EAAC;EAAQ,GAAKJ,KAAK,CAAG,CAAC;AAAA,CACjD;AAAC,IAAAK,QAAA,
|
|
1
|
+
{"version":3,"file":"ProfileButton.js","names":["_react","_interopRequireDefault","require","_core","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ProfileButton","props","createElement","Button","type","wide","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '@os-design/core';\n\nconst ProfileButton: React.FC<ButtonProps> = (props) => (\n <Button type='ghost' wide='always' {...props} />\n);\n\nexport default ProfileButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAsD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEtD,IAAMQ,aAAoC,GAAG,SAAvCA,aAAoCA,CAAIC,KAAK;EAAA,oBACjDtB,MAAA,CAAAM,OAAA,CAAAiB,aAAA,CAACpB,KAAA,CAAAqB,MAAM,EAAAjB,QAAA;IAACkB,IAAI,EAAC,OAAO;IAACC,IAAI,EAAC;EAAQ,GAAKJ,KAAK,CAAG,CAAC;AAAA,CACjD;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEae,aAAa"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useProfileConfig = exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
var ProfileConfig = /*#__PURE__*/_react.default.createContext({
|
|
12
12
|
bucketId: ''
|
|
13
13
|
});
|
|
14
14
|
ProfileConfig.displayName = 'ProfileConfig';
|
|
15
|
-
var useProfileConfig = function useProfileConfig() {
|
|
15
|
+
var useProfileConfig = exports.useProfileConfig = function useProfileConfig() {
|
|
16
16
|
return (0, _react.useContext)(ProfileConfig);
|
|
17
17
|
};
|
|
18
|
-
exports.
|
|
19
|
-
var _default = ProfileConfig;
|
|
20
|
-
exports.default = _default;
|
|
18
|
+
var _default = exports.default = ProfileConfig;
|
|
21
19
|
//# sourceMappingURL=ProfileConfigContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileConfigContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"file":"ProfileConfigContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ProfileConfig","React","createContext","bucketId","displayName","useProfileConfig","exports","useContext","_default"],"sources":["../../../../src/lib/components/profile/ProfileConfigContext.ts"],"sourcesContent":["import React, { useContext } from 'react';\n\nexport interface ProfileConfigProps {\n bucketId: string;\n}\n\nconst ProfileConfig = React.createContext<ProfileConfigProps>({\n bucketId: '',\n});\n\nProfileConfig.displayName = 'ProfileConfig';\n\nexport const useProfileConfig = (): ProfileConfigProps =>\n useContext(ProfileConfig);\n\nexport default ProfileConfig;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAM1C,IAAMY,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAAqB;EAC5DC,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEFH,aAAa,CAACI,WAAW,GAAG,eAAe;AAEpC,IAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAA;EAAA,OAC3B,IAAAE,iBAAU,EAACP,aAAa,CAAC;AAAA;AAAC,IAAAQ,QAAA,GAAAF,OAAA,CAAArB,OAAA,GAEbe,aAAa"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useProfile = exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
var ProfileContext = /*#__PURE__*/_react.default.createContext({
|
|
12
12
|
id: '',
|
|
13
13
|
email: ''
|
|
14
14
|
});
|
|
15
15
|
ProfileContext.displayName = 'ProfileContext';
|
|
16
|
-
var useProfile = function useProfile() {
|
|
16
|
+
var useProfile = exports.useProfile = function useProfile() {
|
|
17
17
|
return (0, _react.useContext)(ProfileContext);
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
20
|
-
var _default = ProfileContext;
|
|
21
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = ProfileContext;
|
|
22
20
|
//# sourceMappingURL=ProfileContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"file":"ProfileContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ProfileContext","React","createContext","id","email","displayName","useProfile","exports","useContext","_default"],"sources":["../../../../src/lib/components/profile/ProfileContext.ts"],"sourcesContent":["import React, { useContext } from 'react';\n\nexport interface ProfileContextProps {\n id: string;\n email: string;\n firstName?: string;\n lastName?: string;\n avatar?: string;\n}\n\nconst ProfileContext = React.createContext<ProfileContextProps>({\n id: '',\n email: '',\n});\n\nProfileContext.displayName = 'ProfileContext';\n\nexport const useProfile = (): ProfileContextProps => useContext(ProfileContext);\n\nexport default ProfileContext;\n"],"mappings":";;;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E,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC,CAAC;AAEFJ,cAAc,CAACK,WAAW,GAAG,gBAAgB;AAEtC,IAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,SAAbA,UAAUA,CAAA;EAAA,OAA8B,IAAAE,iBAAU,EAACR,cAAc,CAAC;AAAA;AAAC,IAAAS,QAAA,GAAAF,OAAA,CAAAtB,OAAA,GAEjEe,cAAc"}
|
|
@@ -11,13 +11,13 @@ var _MainLoader = _interopRequireDefault(require("../shared/MainLoader"));
|
|
|
11
11
|
var _excluded = ["actions", "children"];
|
|
12
12
|
var _templateObject;
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _typeof(
|
|
14
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
var LazyProfileDrawerContent = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
22
22
|
return Promise.resolve().then(function () {
|
|
23
23
|
return _interopRequireWildcard(require('./ProfileDrawerContent'));
|
|
@@ -37,6 +37,5 @@ var ProfileDrawer = function ProfileDrawer(_ref) {
|
|
|
37
37
|
actions: actions
|
|
38
38
|
}, children)));
|
|
39
39
|
};
|
|
40
|
-
var _default = ProfileDrawer;
|
|
41
|
-
exports.default = _default;
|
|
40
|
+
var _default = exports.default = ProfileDrawer;
|
|
42
41
|
//# sourceMappingURL=ProfileDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawer.js","names":["_react","_interopRequireWildcard","require","_core","_styled","_interopRequireDefault","_MainLoader","_excluded","_templateObject","obj","__esModule","default","_typeof","Symbol","iterator","constructor","prototype","_extends","Object","assign","bind","target","i","arguments","length","source","key","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"file":"ProfileDrawer.js","names":["_react","_interopRequireWildcard","require","_core","_styled","_interopRequireDefault","_MainLoader","_excluded","_templateObject","obj","__esModule","default","_typeof","o","Symbol","iterator","constructor","prototype","_extends","Object","assign","bind","target","i","arguments","length","source","key","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","defineProperty","getOwnPropertyDescriptor","u","set","LazyProfileDrawerContent","lazy","Promise","resolve","then","StyledDrawer","styled","Drawer","ProfileDrawer","_ref","actions","children","rest","createElement","placement","width","Suspense","fallback","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawer.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { Drawer, DrawerProps } from '@os-design/core';\nimport styled from '@emotion/styled';\nimport { ProfileDrawerContentProps } from './ProfileDrawerContent';\nimport MainLoader from '../shared/MainLoader';\n\nconst LazyProfileDrawerContent = lazy(() => import('./ProfileDrawerContent'));\n\nexport type ProfileDrawerProps = ProfileDrawerContentProps & DrawerProps;\n\nconst StyledDrawer = styled(Drawer)`\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n`;\n\nconst ProfileDrawer: React.FC<ProfileDrawerProps> = ({\n actions,\n children,\n ...rest\n}) => (\n <StyledDrawer placement='right' width='15em' {...rest}>\n <Suspense fallback={<MainLoader />}>\n <LazyProfileDrawerContent actions={actions}>\n {children}\n </LazyProfileDrawerContent>\n </Suspense>\n </StyledDr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AAA,CAAPC,OAAO;IACPC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACLC,IAAI,GAAA1C,wBAAA,CAAAuC,IAAA,EAAA/D,SAAA;EAAA,oBAEPP,MAAA,CAAAW,OAAA,CAAA+D,aAAA,CAACR,YAAY,EAAAhD,QAAA;IAACyD,SAAS,EAAC,OAAO;IAACC,KAAK,EAAC;EAAM,GAAKH,IAAI,gBACnDzE,MAAA,CAAAW,OAAA,CAAA+D,aAAA,CAAC1E,MAAA,CAAA6E,QAAQ;IAACC,QAAQ,eAAE9E,MAAA,CAAAW,OAAA,CAAA+D,aAAA,CAACpE,WAAA,CAAAK,OAAU,MAAE;EAAE,gBACjCX,MAAA,CAAAW,OAAA,CAAA+D,aAAA,CAACb,wBAAwB;IAACU,OAAO,EAAEA;EAAQ,GACxCC,QACuB,CAClB,CACE,CAAC;AAAA,CAChB;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEa0D,aAAa"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _core = require("@os-design/core");
|
|
10
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
+
var _core = require("@os-design/core");
|
|
11
10
|
var _theming = require("@os-design/theming");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactI18next = require("react-i18next");
|
|
13
13
|
var _hooks = require("react-relay/hooks");
|
|
14
|
-
var
|
|
15
|
-
var _ProfileContext = require("./ProfileContext");
|
|
14
|
+
var _getErrorMessage = _interopRequireDefault(require("../../utils/getErrorMessage"));
|
|
16
15
|
var _ProfileButton = _interopRequireDefault(require("./ProfileButton"));
|
|
16
|
+
var _ProfileContext = require("./ProfileContext");
|
|
17
17
|
var _ProfileUpdateNameModal = _interopRequireDefault(require("./ProfileUpdateNameModal"));
|
|
18
18
|
var _ProfileUpdatePasswordModal = _interopRequireDefault(require("./ProfileUpdatePasswordModal"));
|
|
19
|
-
var
|
|
19
|
+
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
20
20
|
var _ProfileDrawerContentUpdateAvatarMutation, _ProfileDrawerContentSignOutMutation, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
25
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
27
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28
|
-
function _iterableToArrayLimit(
|
|
28
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
30
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
31
31
|
var AvatarContainer = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
@@ -39,11 +39,11 @@ var Email = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedT
|
|
|
39
39
|
var ActionsContainer = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 1.5em;\n"])));
|
|
40
40
|
var Footer = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n"])));
|
|
41
41
|
var HiddenInput = _styled.default.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: none;\n"])));
|
|
42
|
-
var
|
|
42
|
+
var query = _ProfileDrawerContentUpdateAvatarMutation !== void 0 ? _ProfileDrawerContentUpdateAvatarMutation : (_ProfileDrawerContentUpdateAvatarMutation = require("./__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql"), _ProfileDrawerContentUpdateAvatarMutation.hash && _ProfileDrawerContentUpdateAvatarMutation.hash !== "cf72a6314772ed0d1f182b197c858505" && console.error("The definition of 'ProfileDrawerContentUpdateAvatarMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProfileDrawerContentUpdateAvatarMutation);
|
|
43
43
|
var DeleteAvatarButton = function DeleteAvatarButton() {
|
|
44
44
|
var _useTranslation = (0, _reactI18next.useTranslation)(['profile']),
|
|
45
45
|
t = _useTranslation.t;
|
|
46
|
-
var _useMutation = (0, _hooks.useMutation)(
|
|
46
|
+
var _useMutation = (0, _hooks.useMutation)(query),
|
|
47
47
|
_useMutation2 = _slicedToArray(_useMutation, 2),
|
|
48
48
|
commit = _useMutation2[0],
|
|
49
49
|
loading = _useMutation2[1];
|
|
@@ -72,7 +72,7 @@ var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
|
72
72
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(['profile']),
|
|
73
73
|
t = _useTranslation2.t;
|
|
74
74
|
var fileInputRef = (0, _react.useRef)(null);
|
|
75
|
-
var _useMutation3 = (0, _hooks.useMutation)(
|
|
75
|
+
var _useMutation3 = (0, _hooks.useMutation)(query),
|
|
76
76
|
_useMutation4 = _slicedToArray(_useMutation3, 2),
|
|
77
77
|
commit = _useMutation4[0],
|
|
78
78
|
loading = _useMutation4[1];
|
|
@@ -117,16 +117,16 @@ var UpdateNameButton = function UpdateNameButton(_ref2) {
|
|
|
117
117
|
t = _useTranslation3.t;
|
|
118
118
|
var _useState = (0, _react.useState)(false),
|
|
119
119
|
_useState2 = _slicedToArray(_useState, 2),
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
modalVisible = _useState2[0],
|
|
121
|
+
setModalVisible = _useState2[1];
|
|
122
122
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
123
123
|
onClick: function onClick() {
|
|
124
|
-
return
|
|
124
|
+
return setModalVisible(true);
|
|
125
125
|
}
|
|
126
126
|
}, t("profile:".concat(hasName ? 'changeName' : 'setName'))), /*#__PURE__*/_react.default.createElement(_ProfileUpdateNameModal.default, {
|
|
127
|
-
|
|
127
|
+
visible: modalVisible,
|
|
128
128
|
onClose: function onClose() {
|
|
129
|
-
return
|
|
129
|
+
return setModalVisible(false);
|
|
130
130
|
}
|
|
131
131
|
}));
|
|
132
132
|
};
|
|
@@ -135,16 +135,16 @@ var ChangePasswordButton = function ChangePasswordButton() {
|
|
|
135
135
|
t = _useTranslation4.t;
|
|
136
136
|
var _useState3 = (0, _react.useState)(false),
|
|
137
137
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
modalVisible = _useState4[0],
|
|
139
|
+
setModalVisible = _useState4[1];
|
|
140
140
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
141
141
|
onClick: function onClick() {
|
|
142
|
-
return
|
|
142
|
+
return setModalVisible(true);
|
|
143
143
|
}
|
|
144
144
|
}, t('profile:changePassword')), /*#__PURE__*/_react.default.createElement(_ProfileUpdatePasswordModal.default, {
|
|
145
|
-
|
|
145
|
+
visible: modalVisible,
|
|
146
146
|
onClose: function onClose() {
|
|
147
|
-
return
|
|
147
|
+
return setModalVisible(false);
|
|
148
148
|
}
|
|
149
149
|
}));
|
|
150
150
|
};
|
|
@@ -193,6 +193,5 @@ var ProfileDrawerContent = function ProfileDrawerContent(_ref3) {
|
|
|
193
193
|
hasName: !!fullName
|
|
194
194
|
}), /*#__PURE__*/_react.default.createElement(ChangePasswordButton, null), actions, /*#__PURE__*/_react.default.createElement(SignOutButton, null), children), /*#__PURE__*/_react.default.createElement(Footer, null, /*#__PURE__*/_react.default.createElement(_core.ThemeSwitcher, null)));
|
|
195
195
|
};
|
|
196
|
-
var _default = ProfileDrawerContent;
|
|
197
|
-
exports.default = _default;
|
|
196
|
+
var _default = exports.default = ProfileDrawerContent;
|
|
198
197
|
//# sourceMappingURL=ProfileDrawerContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContent.js","names":["_react","_interopRequireWildcard","require","_core","_styled","_interopRequireDefault","_theming","_reactI18next","_hooks","_UserAvatar","_ProfileContext","_ProfileButton","_ProfileUpdateNameModal","_ProfileUpdatePasswordModal","_getErrorMessage","_ProfileDrawerContentUpdateAvatarMutation","_ProfileDrawerContentSignOutMutation","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_taggedTemplateLiteral","strings","raw","freeze","defineProperties","AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","profileDrawerContentUpdateAvatarMutation","hash","console","error","DeleteAvatarButton","_useTranslation","useTranslation","t","_useMutation","useMutation","_useMutation2","commit","loading","handler","useCallback","variables","avatar","onError","message","getErrorMessage","onCompleted","success","createElement","onClick","UpdateAvatarButton","_ref","hasAvatar","_useTranslation2","fileInputRef","useRef","_useMutation3","_useMutation4","e","target","files","file","uploadables","Fragment","current","click","concat","type","accept","onChange","ref","UpdateNameButton","_ref2","hasName","_useTranslation3","_useState","useState","_useState2","modalVisibility","setModalVisibility","visibility","onClose","ChangePasswordButton","_useTranslation4","_useState3","_useState4","SignOutButton","_useTranslation5","_useMutation5","_useMutation6","window","location","href","danger","ProfileDrawerContent","_ref3","actions","children","_useProfile","useProfile","email","firstName","lastName","fullName","useMemo","filter","join","size","ThemeSwitcher","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawerContent.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { message, ThemeSwitcher } from '@os-design/core';\nimport styled from '@emotion/styled';\nimport { clr } from '@os-design/theming';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport UserAvatar from './UserAvatar';\nimport { useProfile } from './ProfileContext';\nimport ProfileButton from './ProfileButton';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport { ProfileDrawerContentSignOutMutation } from './__generated__/ProfileDrawerContentSignOutMutation.graphql';\nimport { ProfileDrawerContentUpdateAvatarMutation } from './__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql';\nimport getErrorMessage from '../../utils/getErrorMessage';\n\nexport interface ProfileDrawerContentProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n /**\n * The children.\n */\n children?: React.ReactNode;\n}\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst profileDrawerContentUpdateAvatarMutation = graphql`\n mutation ProfileDrawerContentUpdateAvatarMutation(\n $input: UpdateAvatarInput!\n ) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(\n profileDrawerContentUpdateAvatarMutation\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation(['profile']);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(\n profileDrawerContentUpdateAvatarMutation\n );\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation(['profile']);\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] = useMutation<ProfileDrawerContentSignOutMutation>(\n graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawerContent: React.FC<ProfileDrawerContentProps> = ({\n actions,\n children,\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </>\n );\n};\n\nexport default ProfileDrawerContent;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA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ent.js","names":["_styled","_interopRequireDefault","require","_core","_theming","_react","_interopRequireWildcard","_reactI18next","_hooks","_getErrorMessage","_ProfileButton","_ProfileContext","_ProfileUpdateNameModal","_ProfileUpdatePasswordModal","_UserAvatar","_ProfileDrawerContentUpdateAvatarMutation","_ProfileDrawerContentSignOutMutation","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","len","length","arr2","l","Symbol","iterator","f","next","done","push","value","return","isArray","_taggedTemplateLiteral","strings","raw","freeze","defineProperties","AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","query","hash","console","error","DeleteAvatarButton","_useTranslation","useTranslation","_useMutation","useMutation","_useMutation2","commit","loading","handler","useCallback","variables","avatar","onError","message","getErrorMessage","onCompleted","success","createElement","onClick","UpdateAvatarButton","_ref","hasAvatar","_useTranslation2","fileInputRef","useRef","_useMutation3","_useMutation4","target","files","file","uploadables","Fragment","current","click","concat","type","accept","onChange","ref","UpdateNameButton","_ref2","hasName","_useTranslation3","_useState","useState","_useState2","modalVisible","setModalVisible","visible","onClose","ChangePasswordButton","_useTranslation4","_useState3","_useState4","SignOutButton","_useTranslation5","_useMutation5","_useMutation6","window","location","href","danger","ProfileDrawerContent","_ref3","actions","children","_useProfile","useProfile","email","firstName","lastName","fullName","useMemo","filter","join","size","ThemeSwitcher","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawerContent.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ThemeSwitcher, message } from '@os-design/core';\nimport { clr } from '@os-design/theming';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport getErrorMessage from '../../utils/getErrorMessage';\nimport ProfileButton from './ProfileButton';\nimport { useProfile } from './ProfileContext';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport UserAvatar from './UserAvatar';\nimport { ProfileDrawerContentSignOutMutation } from './__generated__/ProfileDrawerContentSignOutMutation.graphql';\nimport { ProfileDrawerContentUpdateAvatarMutation } from './__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql';\n\nexport interface ProfileDrawerContentProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n /**\n * The children.\n */\n children?: React.ReactNode;\n}\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst query = graphql`\n mutation ProfileDrawerContentUpdateAvatarMutation(\n $input: UpdateAvatarInput!\n ) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation(['profile']);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] = useMutation<ProfileDrawerContentSignOutMutation>(\n graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawerContent: React.FC<ProfileDrawerContentProps> = ({\n actions,\n children,\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </>\n );\n};\n\nexport default ProfileDrawerContent;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;A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ationItem(_ref) {
|
|
|
32
32
|
}
|
|
33
33
|
}, rest), t('profile:menu'));
|
|
34
34
|
};
|
|
35
|
-
var _default = ProfileNavigationItem;
|
|
36
|
-
exports.default = _default;
|
|
35
|
+
var _default = exports.default = ProfileNavigationItem;
|
|
37
36
|
//# sourceMappingURL=ProfileNavigationItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileNavigationItem.js","names":["_react","_interopRequireDefault","require","_media","_core","_reactI18next","_ProfileIcon","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ProfileNavigationItem","_ref","_ref$onClick","onClick","rest","_useTranslation","useTranslation","t","isMinMd","useIsMinWidth","createElement","NavigationItem","href","icon","onKeyDown","e","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileNavigationItem.tsx"],"sourcesContent":["import React from 'react';\nimport { useIsMinWidth } from '@os-design/media';\nimport { NavigationItem, NavigationItemProps } from '@os-design/core';\nimport { useTranslation } from 'react-i18next';\nimport ProfileIcon from '../shared/icons/ProfileIcon';\n\nexport interface ProfileNavigationItemProps\n extends Partial<NavigationItemProps> {\n onClick?: () => void;\n}\n\nconst ProfileNavigationItem: React.FC<ProfileNavigationItemProps> = ({\n onClick = () => {},\n ...rest\n}) => {\n const { t } = useTranslation(['profile']);\n const isMinMd = useIsMinWidth('md');\n\n if (isMinMd) return null;\n\n return (\n <NavigationItem\n href='#' // To make focusable\n icon={<ProfileIcon />}\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n {...rest}\n >\n {t('profile:menu')}\n </NavigationItem>\n );\n};\n\nexport default ProfileNavigationItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAA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,QAAA,
|
|
1
|
+
{"version":3,"file":"ProfileNavigationItem.js","names":["_react","_interopRequireDefault","require","_media","_core","_reactI18next","_ProfileIcon","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ProfileNavigationItem","_ref","_ref$onClick","onClick","rest","_useTranslation","useTranslation","t","isMinMd","useIsMinWidth","createElement","NavigationItem","href","icon","onKeyDown","e","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileNavigationItem.tsx"],"sourcesContent":["import React from 'react';\nimport { useIsMinWidth } from '@os-design/media';\nimport { NavigationItem, NavigationItemProps } from '@os-design/core';\nimport { useTranslation } from 'react-i18next';\nimport ProfileIcon from '../shared/icons/ProfileIcon';\n\nexport interface ProfileNavigationItemProps\n extends Partial<NavigationItemProps> {\n onClick?: () => void;\n}\n\nconst ProfileNavigationItem: React.FC<ProfileNavigationItemProps> = ({\n onClick = () => {},\n ...rest\n}) => {\n const { t } = useTranslation(['profile']);\n const isMinMd = useIsMinWidth('md');\n\n if (isMinMd) return null;\n\n return (\n <NavigationItem\n href='#' // To make focusable\n icon={<ProfileIcon />}\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n {...rest}\n >\n {t('profile:menu')}\n </NavigationItem>\n );\n};\n\nexport default ProfileNavigationItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAsD,IAAAK,SAAA;AAAA,SAAAN,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GA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