@os-team/profile 1.0.46 → 1.0.48
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/README.md +1 -1
- package/dist/cjs/{emotion.d.js → @types/emotion.d.js} +0 -0
- package/dist/cjs/@types/emotion.d.js.map +1 -0
- package/dist/cjs/@types/i18next.d.js +4 -0
- package/dist/cjs/@types/i18next.d.js.map +1 -0
- package/dist/cjs/components/profile/ProfileButton.js +0 -6
- package/dist/cjs/components/profile/ProfileButton.js.map +1 -1
- package/dist/cjs/components/profile/ProfileConfigContext.js +0 -8
- package/dist/cjs/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileContext.js +0 -8
- package/dist/cjs/components/profile/ProfileContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawer.js +2 -20
- package/dist/cjs/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawerContent.js +30 -86
- package/dist/cjs/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/cjs/components/profile/ProfileNavigationItem.js +4 -18
- package/dist/cjs/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameForm.js +3 -14
- package/dist/cjs/components/profile/ProfileUpdateNameForm.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js +21 -49
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordForm.js +3 -14
- package/dist/cjs/components/profile/ProfileUpdatePasswordForm.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +19 -45
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/cjs/components/profile/ProtectedWrapper.js +4 -19
- package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatar.js +5 -17
- package/dist/cjs/components/profile/UserAvatar.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatarAddon.js +2 -19
- package/dist/cjs/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +4 -9
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +33 -42
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +4 -9
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +33 -42
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +31 -48
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +27 -36
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +4 -9
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawer.js +2 -20
- package/dist/cjs/components/session/SessionDrawer.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawerContent.js +0 -15
- package/dist/cjs/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/cjs/components/session/SessionList.js +6 -39
- package/dist/cjs/components/session/SessionList.js.map +1 -1
- package/dist/cjs/components/session/SessionListItem.js +22 -84
- package/dist/cjs/components/session/SessionListItem.js.map +1 -1
- package/dist/cjs/components/session/SessionListSkeleton.js +2 -15
- package/dist/cjs/components/session/SessionListSkeleton.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +4 -9
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +27 -36
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js +1 -2
- 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 +0 -2
- package/dist/cjs/components/session/formatDate.js.map +1 -1
- package/dist/cjs/components/session/getLastSeen.js +0 -2
- package/dist/cjs/components/session/getLastSeen.js.map +1 -1
- package/dist/cjs/components/shared/ButtonUpdate.js +2 -9
- package/dist/cjs/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/cjs/components/shared/ErrorResult.js +4 -17
- package/dist/cjs/components/shared/ErrorResult.js.map +1 -1
- package/dist/cjs/components/shared/MainLoader.js +0 -10
- package/dist/cjs/components/shared/MainLoader.js.map +1 -1
- package/dist/cjs/components/shared/icons/AndroidIcon.js +0 -6
- package/dist/cjs/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/AppleIcon.js +0 -6
- package/dist/cjs/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/BrowserIcon.js +0 -6
- package/dist/cjs/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/ProfileIcon.js +0 -6
- package/dist/cjs/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js +0 -6
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/getUserFullName.js +2 -4
- package/dist/cjs/utils/getUserFullName.js.map +1 -1
- package/dist/esm/{emotion.d.js → @types/emotion.d.js} +0 -0
- package/dist/esm/@types/emotion.d.js.map +1 -0
- package/dist/esm/@types/i18next.d.js +2 -0
- package/dist/esm/@types/i18next.d.js.map +1 -0
- package/dist/esm/components/profile/ProfileButton.js +0 -3
- package/dist/esm/components/profile/ProfileButton.js.map +1 -1
- package/dist/esm/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/esm/components/profile/ProfileContext.js.map +1 -1
- package/dist/esm/components/profile/ProfileDrawer.js +0 -3
- package/dist/esm/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/esm/components/profile/ProfileDrawerContent.js +5 -16
- package/dist/esm/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/esm/components/profile/ProfileNavigationItem.js +1 -4
- package/dist/esm/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameForm.js +1 -4
- package/dist/esm/components/profile/ProfileUpdateNameForm.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameModal.js +3 -5
- package/dist/esm/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordForm.js +1 -4
- package/dist/esm/components/profile/ProfileUpdatePasswordForm.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js +3 -5
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/esm/components/profile/ProtectedWrapper.js +0 -4
- package/dist/esm/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/esm/components/profile/UserAvatar.js +0 -3
- package/dist/esm/components/profile/UserAvatar.js.map +1 -1
- package/dist/esm/components/profile/UserAvatarAddon.js +0 -3
- package/dist/esm/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +4 -8
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +33 -41
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +4 -8
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +33 -41
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +31 -47
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +27 -35
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +4 -8
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/SessionDrawer.js +1 -4
- package/dist/esm/components/session/SessionDrawer.js.map +1 -1
- package/dist/esm/components/session/SessionDrawerContent.js +0 -5
- package/dist/esm/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/esm/components/session/SessionList.js +1 -4
- package/dist/esm/components/session/SessionList.js.map +1 -1
- package/dist/esm/components/session/SessionListItem.js +3 -17
- package/dist/esm/components/session/SessionListItem.js.map +1 -1
- package/dist/esm/components/session/SessionListSkeleton.js +1 -3
- package/dist/esm/components/session/SessionListSkeleton.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 +4 -8
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +27 -35
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.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/esm/components/session/__generated__/SessionList_sessions.graphql.js +1 -1
- package/dist/esm/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/esm/components/session/formatDate.js +0 -1
- package/dist/esm/components/session/formatDate.js.map +1 -1
- package/dist/esm/components/session/getLastSeen.js +0 -1
- package/dist/esm/components/session/getLastSeen.js.map +1 -1
- package/dist/esm/components/shared/ButtonUpdate.js +1 -3
- package/dist/esm/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/esm/components/shared/ErrorResult.js +3 -5
- package/dist/esm/components/shared/ErrorResult.js.map +1 -1
- package/dist/esm/components/shared/MainLoader.js +0 -2
- package/dist/esm/components/shared/MainLoader.js.map +1 -1
- package/dist/esm/components/shared/icons/AndroidIcon.js +0 -1
- package/dist/esm/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/AppleIcon.js +0 -1
- package/dist/esm/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/BrowserIcon.js +0 -1
- package/dist/esm/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/ProfileIcon.js +0 -1
- package/dist/esm/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/UnknownDeviceIcon.js +0 -1
- package/dist/esm/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/getUserFullName.js +0 -1
- package/dist/esm/utils/getUserFullName.js.map +1 -1
- package/dist/types/{components → src/lib/components}/profile/ProfileButton.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileButton.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileConfigContext.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileConfigContext.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileContext.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileContext.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileDrawer.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileDrawer.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileDrawerContent.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileDrawerContent.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileNavigationItem.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileNavigationItem.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileUpdateNameForm.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileUpdateNameForm.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileUpdateNameModal.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileUpdateNameModal.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileUpdatePasswordForm.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileUpdatePasswordForm.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProfileUpdatePasswordModal.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProfileUpdatePasswordModal.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/ProtectedWrapper.d.ts +0 -0
- package/dist/types/src/lib/components/profile/ProtectedWrapper.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/UserAvatar.d.ts +0 -0
- package/dist/types/src/lib/components/profile/UserAvatar.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/UserAvatarAddon.d.ts +0 -0
- package/dist/types/src/lib/components/profile/UserAvatarAddon.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/SessionDrawer.d.ts +0 -0
- package/dist/types/src/lib/components/session/SessionDrawer.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/SessionDrawerContent.d.ts +0 -0
- package/dist/types/src/lib/components/session/SessionDrawerContent.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/SessionList.d.ts +0 -0
- package/dist/types/src/lib/components/session/SessionList.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/SessionListItem.d.ts +0 -0
- package/dist/types/src/lib/components/session/SessionListItem.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/SessionListSkeleton.d.ts +0 -0
- package/dist/types/src/lib/components/session/SessionListSkeleton.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionDrawerContentQuery.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionListItem_session.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionListRefetchQuery.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/__generated__/SessionList_sessions.graphql.d.ts +0 -0
- package/dist/types/src/lib/components/session/__generated__/SessionList_sessions.graphql.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/formatDate.d.ts +0 -0
- package/dist/types/src/lib/components/session/formatDate.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/session/getLastSeen.d.ts +0 -0
- package/dist/types/src/lib/components/session/getLastSeen.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/ButtonUpdate.d.ts +0 -0
- package/dist/types/src/lib/components/shared/ButtonUpdate.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/ErrorResult.d.ts +0 -0
- package/dist/types/src/lib/components/shared/ErrorResult.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/MainLoader.d.ts +0 -0
- package/dist/types/src/lib/components/shared/MainLoader.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/icons/AndroidIcon.d.ts +0 -0
- package/dist/types/src/lib/components/shared/icons/AndroidIcon.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/icons/AppleIcon.d.ts +0 -0
- package/dist/types/src/lib/components/shared/icons/AppleIcon.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/icons/BrowserIcon.d.ts +0 -0
- package/dist/types/src/lib/components/shared/icons/BrowserIcon.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/icons/ProfileIcon.d.ts +0 -0
- package/dist/types/src/lib/components/shared/icons/ProfileIcon.d.ts.map +1 -0
- package/dist/types/{components → src/lib/components}/shared/icons/UnknownDeviceIcon.d.ts +0 -0
- package/dist/types/src/lib/components/shared/icons/UnknownDeviceIcon.d.ts.map +1 -0
- package/dist/types/{index.d.ts → src/lib/index.d.ts} +0 -0
- package/dist/types/src/lib/index.d.ts.map +1 -0
- package/dist/types/{utils → src/lib/utils}/getUserFullName.d.ts +0 -0
- package/dist/types/src/lib/utils/getUserFullName.d.ts.map +1 -0
- package/package.json +32 -34
- package/dist/cjs/emotion.d.js.map +0 -1
- package/dist/esm/emotion.d.js.map +0 -1
- package/dist/types/components/profile/ProfileButton.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileConfigContext.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileContext.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileDrawer.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileDrawerContent.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileNavigationItem.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileUpdateNameForm.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileUpdateNameModal.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileUpdatePasswordForm.d.ts.map +0 -1
- package/dist/types/components/profile/ProfileUpdatePasswordModal.d.ts.map +0 -1
- package/dist/types/components/profile/ProtectedWrapper.d.ts.map +0 -1
- package/dist/types/components/profile/UserAvatar.d.ts.map +0 -1
- package/dist/types/components/profile/UserAvatarAddon.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +0 -1
- package/dist/types/components/session/SessionDrawer.d.ts.map +0 -1
- package/dist/types/components/session/SessionDrawerContent.d.ts.map +0 -1
- package/dist/types/components/session/SessionList.d.ts.map +0 -1
- package/dist/types/components/session/SessionListItem.d.ts.map +0 -1
- package/dist/types/components/session/SessionListSkeleton.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +0 -1
- package/dist/types/components/session/__generated__/SessionList_sessions.graphql.d.ts.map +0 -1
- package/dist/types/components/session/formatDate.d.ts.map +0 -1
- package/dist/types/components/session/getLastSeen.d.ts.map +0 -1
- package/dist/types/components/shared/ButtonUpdate.d.ts.map +0 -1
- package/dist/types/components/shared/ErrorResult.d.ts.map +0 -1
- package/dist/types/components/shared/MainLoader.d.ts.map +0 -1
- package/dist/types/components/shared/icons/AndroidIcon.d.ts.map +0 -1
- package/dist/types/components/shared/icons/AppleIcon.d.ts.map +0 -1
- package/dist/types/components/shared/icons/BrowserIcon.d.ts.map +0 -1
- package/dist/types/components/shared/icons/ProfileIcon.d.ts.map +0 -1
- package/dist/types/components/shared/icons/UnknownDeviceIcon.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/utils/getUserFullName.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -205,7 +205,7 @@ import HomeIcon from './icons/HomeIcon';
|
|
|
205
205
|
|
|
206
206
|
const Layout: React.FC = ({ children }) => {
|
|
207
207
|
const { pathname } = useLocation();
|
|
208
|
-
const { t } = useTranslation('profile');
|
|
208
|
+
const { t } = useTranslation(['profile']);
|
|
209
209
|
const [profileDrawerVisible, setProfileDrawerVisible] = useState(false);
|
|
210
210
|
const [sessionDrawerVisible, setSessionDrawerVisible] = useState(false);
|
|
211
211
|
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emotion.d.js","names":[],"sources":["../../../src/lib/@types/emotion.d.ts"],"sourcesContent":["import '@emotion/react';\nimport { Theme as BaseTheme } from '@os-design/theming';\n\ndeclare module '@emotion/react' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface Theme extends BaseTheme {}\n}\n"],"mappings":";;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18next.d.js","names":[],"sources":["../../../src/lib/@types/i18next.d.ts"],"sourcesContent":["import 'i18next';\nimport common from '../../../public/locales/en/common.json';\nimport profile from '../../../public/locales/en/profile.json';\n\ndeclare module 'i18next' {\n interface CustomTypeOptions {\n resources: {\n common: typeof common;\n profile: typeof profile;\n };\n }\n}\n"],"mappings":";;AAAA"}
|
|
@@ -4,22 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _core = require("@os-design/core");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
var ProfileButton = function ProfileButton(props) {
|
|
17
12
|
return /*#__PURE__*/_react.default.createElement(_core.Button, _extends({
|
|
18
13
|
type: "ghost",
|
|
19
14
|
wide: "always"
|
|
20
15
|
}, props));
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
var _default = ProfileButton;
|
|
24
18
|
exports.default = _default;
|
|
25
19
|
//# sourceMappingURL=ProfileButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.js","names":["ProfileButton","props"],"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":"
|
|
1
|
+
{"version":3,"file":"ProfileButton.js","names":["ProfileButton","props"],"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;AACA;AAAsD;AAAA;AAEtD,IAAMA,aAAoC,GAAG,SAAvCA,aAAoC,CAAIC,KAAK;EAAA,oBACjD,6BAAC,YAAM;IAAC,IAAI,EAAC,OAAO;IAAC,IAAI,EAAC;EAAQ,GAAKA,KAAK,EAAI;AAAA,CACjD;AAAC,eAEaD,aAAa;AAAA"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useProfileConfig = exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
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); }
|
|
13
|
-
|
|
14
10
|
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; }
|
|
15
|
-
|
|
16
11
|
var ProfileConfig = /*#__PURE__*/_react.default.createContext({
|
|
17
12
|
bucketId: ''
|
|
18
13
|
});
|
|
19
|
-
|
|
20
14
|
ProfileConfig.displayName = 'ProfileConfig';
|
|
21
|
-
|
|
22
15
|
var useProfileConfig = function useProfileConfig() {
|
|
23
16
|
return (0, _react.useContext)(ProfileConfig);
|
|
24
17
|
};
|
|
25
|
-
|
|
26
18
|
exports.useProfileConfig = useProfileConfig;
|
|
27
19
|
var _default = ProfileConfig;
|
|
28
20
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileConfigContext.js","names":["ProfileConfig","React","createContext","bucketId","displayName","useProfileConfig","useContext"],"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":"
|
|
1
|
+
{"version":3,"file":"ProfileConfigContext.js","names":["ProfileConfig","React","createContext","bucketId","displayName","useProfileConfig","useContext"],"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;AAA0C;AAAA;AAM1C,IAAMA,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAAqB;EAC5DC,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEFH,aAAa,CAACI,WAAW,GAAG,eAAe;AAEpC,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB;EAAA,OAC3B,IAAAC,iBAAU,EAACN,aAAa,CAAC;AAAA;AAAC;AAAA,eAEbA,aAAa;AAAA"}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useProfile = exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
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); }
|
|
13
|
-
|
|
14
10
|
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; }
|
|
15
|
-
|
|
16
11
|
var ProfileContext = /*#__PURE__*/_react.default.createContext({
|
|
17
12
|
id: '',
|
|
18
13
|
email: ''
|
|
19
14
|
});
|
|
20
|
-
|
|
21
15
|
ProfileContext.displayName = 'ProfileContext';
|
|
22
|
-
|
|
23
16
|
var useProfile = function useProfile() {
|
|
24
17
|
return (0, _react.useContext)(ProfileContext);
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
exports.useProfile = useProfile;
|
|
28
20
|
var _default = ProfileContext;
|
|
29
21
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileContext.js","names":["ProfileContext","React","createContext","id","email","displayName","useProfile","useContext"],"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":"
|
|
1
|
+
{"version":3,"file":"ProfileContext.js","names":["ProfileContext","React","createContext","id","email","displayName","useProfile","useContext"],"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":";;;;;;;AAAA;AAA0C;AAAA;AAU1C,IAAMA,cAAc,gBAAGC,cAAK,CAACC,aAAa,CAAsB;EAC9DC,EAAE,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC,CAAC;AAEFJ,cAAc,CAACK,WAAW,GAAG,gBAAgB;AAEtC,IAAMC,UAAU,GAAG,SAAbA,UAAU;EAAA,OAA8B,IAAAC,iBAAU,EAACP,cAAc,CAAC;AAAA;AAAC;AAAA,eAEjEA,cAAc;AAAA"}
|
|
@@ -4,47 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _core = require("@os-design/core");
|
|
11
|
-
|
|
12
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
|
|
14
10
|
var _MainLoader = _interopRequireDefault(require("../shared/MainLoader"));
|
|
15
|
-
|
|
16
11
|
var _excluded = ["actions", "children"];
|
|
17
|
-
|
|
18
12
|
var _templateObject;
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
23
|
-
|
|
24
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); }
|
|
25
|
-
|
|
26
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; }
|
|
27
|
-
|
|
28
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; }
|
|
29
|
-
|
|
30
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
31
|
-
|
|
32
19
|
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); }
|
|
33
|
-
|
|
34
20
|
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; }
|
|
35
|
-
|
|
36
21
|
var LazyProfileDrawerContent = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
37
22
|
return Promise.resolve().then(function () {
|
|
38
23
|
return _interopRequireWildcard(require('./ProfileDrawerContent'));
|
|
39
24
|
});
|
|
40
25
|
});
|
|
41
26
|
var StyledDrawer = (0, _styled.default)(_core.Drawer)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n"])));
|
|
42
|
-
|
|
43
27
|
var ProfileDrawer = function ProfileDrawer(_ref) {
|
|
44
28
|
var actions = _ref.actions,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
children = _ref.children,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
31
|
return /*#__PURE__*/_react.default.createElement(StyledDrawer, _extends({
|
|
49
32
|
placement: "right",
|
|
50
33
|
width: "15em"
|
|
@@ -54,7 +37,6 @@ var ProfileDrawer = function ProfileDrawer(_ref) {
|
|
|
54
37
|
actions: actions
|
|
55
38
|
}, children)));
|
|
56
39
|
};
|
|
57
|
-
|
|
58
40
|
var _default = ProfileDrawer;
|
|
59
41
|
exports.default = _default;
|
|
60
42
|
//# sourceMappingURL=ProfileDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawer.js","names":["LazyProfileDrawerContent","lazy","StyledDrawer","styled","Drawer","ProfileDrawer","actions","children","rest"],"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 </StyledDrawer>\n);\n\nexport default ProfileDrawer;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProfileDrawer.js","names":["LazyProfileDrawerContent","lazy","StyledDrawer","styled","Drawer","ProfileDrawer","actions","children","rest"],"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 </StyledDrawer>\n);\n\nexport default ProfileDrawer;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAEA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9C,IAAMA,wBAAwB,gBAAG,IAAAC,WAAI,EAAC;EAAA;IAAA,uCAAa,wBAAwB;EAAA;AAAA,CAAC,CAAC;AAI7E,IAAMC,YAAY,GAAG,IAAAC,eAAM,EAACC,YAAM,CAAC,yIAIlC;AAED,IAAMC,aAA2C,GAAG,SAA9CA,aAA2C;EAAA,IAC/CC,OAAO,QAAPA,OAAO;IACPC,QAAQ,QAARA,QAAQ;IACLC,IAAI;EAAA,oBAEP,6BAAC,YAAY;IAAC,SAAS,EAAC,OAAO;IAAC,KAAK,EAAC;EAAM,GAAKA,IAAI,gBACnD,6BAAC,eAAQ;IAAC,QAAQ,eAAE,6BAAC,mBAAU;EAAI,gBACjC,6BAAC,wBAAwB;IAAC,OAAO,EAAEF;EAAQ,GACxCC,QAAQ,CACgB,CAClB,CACE;AAAA,CAChB;AAAC,eAEaF,aAAa;AAAA"}
|
|
@@ -1,85 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _core = require("@os-design/core");
|
|
13
|
-
|
|
14
10
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
15
|
-
|
|
16
11
|
var _theming = require("@os-design/theming");
|
|
17
|
-
|
|
18
12
|
var _reactI18next = require("react-i18next");
|
|
19
|
-
|
|
20
13
|
var _hooks = require("react-relay/hooks");
|
|
21
|
-
|
|
22
14
|
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
23
|
-
|
|
24
15
|
var _ProfileContext = require("./ProfileContext");
|
|
25
|
-
|
|
26
16
|
var _ProfileButton = _interopRequireDefault(require("./ProfileButton"));
|
|
27
|
-
|
|
28
17
|
var _ProfileUpdateNameModal = _interopRequireDefault(require("./ProfileUpdateNameModal"));
|
|
29
|
-
|
|
30
18
|
var _ProfileUpdatePasswordModal = _interopRequireDefault(require("./ProfileUpdatePasswordModal"));
|
|
31
|
-
|
|
32
19
|
var _ProfileDrawerContentUpdateAvatarMutation, _ProfileDrawerContentSignOutMutation, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
33
|
-
|
|
34
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
-
|
|
36
21
|
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); }
|
|
37
|
-
|
|
38
22
|
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; }
|
|
39
|
-
|
|
40
23
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
|
-
|
|
42
24
|
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."); }
|
|
43
|
-
|
|
44
25
|
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); }
|
|
45
|
-
|
|
46
26
|
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; }
|
|
47
|
-
|
|
48
27
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
49
|
-
|
|
50
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
-
|
|
52
29
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
53
|
-
|
|
54
30
|
var AvatarContainer = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
55
|
-
|
|
56
31
|
var UserContent = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-top: 1em;\n"])));
|
|
57
|
-
|
|
58
32
|
var FullName = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: ", "em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n"])), function (p) {
|
|
59
33
|
return p.theme.sizes.large;
|
|
60
34
|
});
|
|
61
|
-
|
|
62
35
|
var Email = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n margin-top: 0.2em;\n text-align: center;\n"])), function (p) {
|
|
63
36
|
return (0, _theming.clr)(p.theme.inputColorPlaceholder);
|
|
64
37
|
});
|
|
65
|
-
|
|
66
38
|
var ActionsContainer = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 1.5em;\n"])));
|
|
67
|
-
|
|
68
39
|
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"])));
|
|
69
|
-
|
|
70
40
|
var HiddenInput = _styled.default.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: none;\n"])));
|
|
71
|
-
|
|
72
41
|
var profileDrawerContentUpdateAvatarMutation = _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);
|
|
73
|
-
|
|
74
42
|
var DeleteAvatarButton = function DeleteAvatarButton() {
|
|
75
|
-
var _useTranslation = (0, _reactI18next.useTranslation)('profile'),
|
|
76
|
-
|
|
77
|
-
|
|
43
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(['profile']),
|
|
44
|
+
t = _useTranslation.t;
|
|
78
45
|
var _useMutation = (0, _hooks.useMutation)(profileDrawerContentUpdateAvatarMutation),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
46
|
+
_useMutation2 = _slicedToArray(_useMutation, 2),
|
|
47
|
+
commit = _useMutation2[0],
|
|
48
|
+
loading = _useMutation2[1];
|
|
83
49
|
var handler = (0, _react.useCallback)(function () {
|
|
84
50
|
commit({
|
|
85
51
|
variables: {
|
|
@@ -89,7 +55,6 @@ var DeleteAvatarButton = function DeleteAvatarButton() {
|
|
|
89
55
|
},
|
|
90
56
|
onError: function onError(error) {
|
|
91
57
|
var _source, _source$errors, _source$errors$;
|
|
92
|
-
|
|
93
58
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
59
|
_core.message.error((_source = error.source) === null || _source === void 0 ? void 0 : (_source$errors = _source.errors) === null || _source$errors === void 0 ? void 0 : (_source$errors$ = _source$errors[0]) === null || _source$errors$ === void 0 ? void 0 : _source$errors$.message);
|
|
95
60
|
},
|
|
@@ -103,20 +68,15 @@ var DeleteAvatarButton = function DeleteAvatarButton() {
|
|
|
103
68
|
onClick: handler
|
|
104
69
|
}, t('profile:deleteAvatar'));
|
|
105
70
|
};
|
|
106
|
-
|
|
107
71
|
var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
108
72
|
var hasAvatar = _ref.hasAvatar;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
t = _useTranslation2.t;
|
|
112
|
-
|
|
73
|
+
var _useTranslation2 = (0, _reactI18next.useTranslation)(['profile']),
|
|
74
|
+
t = _useTranslation2.t;
|
|
113
75
|
var fileInputRef = (0, _react.useRef)(null);
|
|
114
|
-
|
|
115
76
|
var _useMutation3 = (0, _hooks.useMutation)(profileDrawerContentUpdateAvatarMutation),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
77
|
+
_useMutation4 = _slicedToArray(_useMutation3, 2),
|
|
78
|
+
commit = _useMutation4[0],
|
|
79
|
+
loading = _useMutation4[1];
|
|
120
80
|
var handler = (0, _react.useCallback)(function (e) {
|
|
121
81
|
var target = e.target;
|
|
122
82
|
if (!target) return;
|
|
@@ -132,7 +92,6 @@ var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
|
132
92
|
},
|
|
133
93
|
onError: function onError(error) {
|
|
134
94
|
var _source2, _source2$errors, _source2$errors$;
|
|
135
|
-
|
|
136
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
96
|
_core.message.error((_source2 = error.source) === null || _source2 === void 0 ? void 0 : (_source2$errors = _source2.errors) === null || _source2$errors === void 0 ? void 0 : (_source2$errors$ = _source2$errors[0]) === null || _source2$errors$ === void 0 ? void 0 : _source2$errors$.message);
|
|
138
97
|
},
|
|
@@ -155,18 +114,14 @@ var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
|
155
114
|
ref: fileInputRef
|
|
156
115
|
}));
|
|
157
116
|
};
|
|
158
|
-
|
|
159
117
|
var UpdateNameButton = function UpdateNameButton(_ref2) {
|
|
160
118
|
var hasName = _ref2.hasName;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
t = _useTranslation3.t;
|
|
164
|
-
|
|
119
|
+
var _useTranslation3 = (0, _reactI18next.useTranslation)(['profile']),
|
|
120
|
+
t = _useTranslation3.t;
|
|
165
121
|
var _useState = (0, _react.useState)(false),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
122
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
123
|
+
modalVisibility = _useState2[0],
|
|
124
|
+
setModalVisibility = _useState2[1];
|
|
170
125
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
171
126
|
onClick: function onClick() {
|
|
172
127
|
return setModalVisibility(true);
|
|
@@ -178,16 +133,13 @@ var UpdateNameButton = function UpdateNameButton(_ref2) {
|
|
|
178
133
|
}
|
|
179
134
|
}));
|
|
180
135
|
};
|
|
181
|
-
|
|
182
136
|
var ChangePasswordButton = function ChangePasswordButton() {
|
|
183
|
-
var _useTranslation4 = (0, _reactI18next.useTranslation)('profile'),
|
|
184
|
-
|
|
185
|
-
|
|
137
|
+
var _useTranslation4 = (0, _reactI18next.useTranslation)(['profile']),
|
|
138
|
+
t = _useTranslation4.t;
|
|
186
139
|
var _useState3 = (0, _react.useState)(false),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
140
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
141
|
+
modalVisibility = _useState4[0],
|
|
142
|
+
setModalVisibility = _useState4[1];
|
|
191
143
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
192
144
|
onClick: function onClick() {
|
|
193
145
|
return setModalVisibility(true);
|
|
@@ -199,22 +151,18 @@ var ChangePasswordButton = function ChangePasswordButton() {
|
|
|
199
151
|
}
|
|
200
152
|
}));
|
|
201
153
|
};
|
|
202
|
-
|
|
203
154
|
var SignOutButton = function SignOutButton() {
|
|
204
|
-
var _useTranslation5 = (0, _reactI18next.useTranslation)('profile'),
|
|
205
|
-
|
|
206
|
-
|
|
155
|
+
var _useTranslation5 = (0, _reactI18next.useTranslation)(['profile']),
|
|
156
|
+
t = _useTranslation5.t;
|
|
207
157
|
var _useMutation5 = (0, _hooks.useMutation)(_ProfileDrawerContentSignOutMutation !== void 0 ? _ProfileDrawerContentSignOutMutation : (_ProfileDrawerContentSignOutMutation = require("./__generated__/ProfileDrawerContentSignOutMutation.graphql"), _ProfileDrawerContentSignOutMutation.hash && _ProfileDrawerContentSignOutMutation.hash !== "c7ca96e9e713315606b0c22d196b6f7b" && console.error("The definition of 'ProfileDrawerContentSignOutMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProfileDrawerContentSignOutMutation)),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
158
|
+
_useMutation6 = _slicedToArray(_useMutation5, 2),
|
|
159
|
+
commit = _useMutation6[0],
|
|
160
|
+
loading = _useMutation6[1];
|
|
212
161
|
var handler = (0, _react.useCallback)(function () {
|
|
213
162
|
commit({
|
|
214
163
|
variables: {},
|
|
215
164
|
onError: function onError(error) {
|
|
216
165
|
var _source3, _source3$errors, _source3$errors$;
|
|
217
|
-
|
|
218
166
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
167
|
_core.message.error((_source3 = error.source) === null || _source3 === void 0 ? void 0 : (_source3$errors = _source3.errors) === null || _source3$errors === void 0 ? void 0 : (_source3$errors$ = _source3$errors[0]) === null || _source3$errors$ === void 0 ? void 0 : _source3$errors$.message);
|
|
220
168
|
},
|
|
@@ -229,17 +177,14 @@ var SignOutButton = function SignOutButton() {
|
|
|
229
177
|
onClick: handler
|
|
230
178
|
}, t('profile:signOut'));
|
|
231
179
|
};
|
|
232
|
-
|
|
233
180
|
var ProfileDrawerContent = function ProfileDrawerContent(_ref3) {
|
|
234
181
|
var actions = _ref3.actions,
|
|
235
|
-
|
|
236
|
-
|
|
182
|
+
children = _ref3.children;
|
|
237
183
|
var _useProfile = (0, _ProfileContext.useProfile)(),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
184
|
+
email = _useProfile.email,
|
|
185
|
+
firstName = _useProfile.firstName,
|
|
186
|
+
lastName = _useProfile.lastName,
|
|
187
|
+
avatar = _useProfile.avatar;
|
|
243
188
|
var fullName = (0, _react.useMemo)(function () {
|
|
244
189
|
return [firstName, lastName].filter(function (i) {
|
|
245
190
|
return i;
|
|
@@ -253,7 +198,6 @@ var ProfileDrawerContent = function ProfileDrawerContent(_ref3) {
|
|
|
253
198
|
hasName: !!fullName
|
|
254
199
|
}), /*#__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)));
|
|
255
200
|
};
|
|
256
|
-
|
|
257
201
|
var _default = ProfileDrawerContent;
|
|
258
202
|
exports.default = _default;
|
|
259
203
|
//# sourceMappingURL=ProfileDrawerContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContent.js","names":["AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","profileDrawerContentUpdateAvatarMutation","DeleteAvatarButton","useTranslation","t","useMutation","commit","loading","handler","useCallback","variables","avatar","onError","error","message","source","errors","onCompleted","success","UpdateAvatarButton","hasAvatar","fileInputRef","useRef","e","target","files","file","uploadables","current","value","click","UpdateNameButton","hasName","useState","modalVisibility","setModalVisibility","ChangePasswordButton","SignOutButton","window","location","href","ProfileDrawerContent","actions","children","useProfile","email","firstName","lastName","fullName","useMemo","filter","i","join"],"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';\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) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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] =\n useMutation<ProfileDrawerContentSignOutMutation>(graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `);\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,eAAe,GAAGC,eAAA,CAAOC,GAAV,wKAArB;;AAOA,IAAMC,WAAW,GAAGF,eAAA,CAAOC,GAAV,6FAAjB;;AAIA,IAAME,QAAQ,GAAGH,eAAA,CAAOC,GAAV,iKACC,UAACG,CAAD;EAAA,OAAOA,CAAC,CAACC,KAAF,CAAQC,KAAR,CAAcC,KAArB;AAAA,CADD,CAAd;;AAOA,IAAMC,KAAK,GAAG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EAAsBG,MAAtB,CAA6B,UAACC,CAAD;MAAA,OAAOA,CAAP;IAAA,CAA7B,EAAuCC,IAAvC,CAA4C,GAA5C,CAAN;EAAA,CADe,EAEf,CAACN,SAAD,EAAYC,QAAZ,CAFe,CAAjB;EAKA,oBACE,yEACE,6BAAC,eAAD,qBACE,6BAAC,mBAAD;IAAY,IAAI,EAAC;EAAjB,EADF,eAEE,6BAAC,WAAD,QACGC,QAAQ,iBAAI,6BAAC,QAAD,QAAWA,QAAX,CADf,eAEE,6BAAC,KAAD,QAAQH,KAAR,CAFF,CAFF,CADF,eASE,6BAAC,gBAAD,QACGlC,MAAM,iBAAI,6BAAC,kBAAD,OADb,eAGE,6BAAC,kBAAD;IAAoB,SAAS,EAAE,CAAC,CAACA;EAAjC,EAHF,eAIE,6BAAC,gBAAD;IAAkB,OAAO,EAAE,CAAC,CAACqC;EAA7B,EAJF,eAKE,6BAAC,oBAAD,OALF,EAOGN,OAPH,eASE,6BAAC,aAAD,OATF,EAWGC,QAXH,CATF,eAuBE,6BAAC,MAAD,qBACE,6BAAC,mBAAD,OADF,CAvBF,CADF;AA6BD,CAxCD;;eA0CeF,oB"}
|
|
1
|
+
{"version":3,"file":"ProfileDrawerContent.js","names":["AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","profileDrawerContentUpdateAvatarMutation","DeleteAvatarButton","useTranslation","t","useMutation","commit","loading","handler","useCallback","variables","avatar","onError","error","message","source","errors","onCompleted","success","UpdateAvatarButton","hasAvatar","fileInputRef","useRef","e","target","files","file","uploadables","current","value","click","UpdateNameButton","hasName","useState","modalVisibility","setModalVisibility","ChangePasswordButton","SignOutButton","window","location","href","ProfileDrawerContent","actions","children","useProfile","email","firstName","lastName","fullName","useMemo","filter","i","join"],"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';\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) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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] =\n useMutation<ProfileDrawerContentSignOutMutation>(graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `);\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\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":";;;;;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D,GAAG,SAA5DA,oBAAyD,QAGzD;EAAA,IAFJC,OAAO,SAAPA,OAAO;IACPC,QAAQ,SAARA,QAAQ;EAER,kBAA+C,IAAAC,0BAAU,GAAE;IAAnDC,KAAK,eAALA,KAAK;IAAEC,SAAS,eAATA,SAAS;IAAEC,QAAQ,eAARA,QAAQ;IAAEpC,MAAM,eAANA,MAAM;EAE1C,IAAMqC,QAAQ,GAAG,IAAAC,cAAO,EACtB;IAAA,OAAM,CAACH,SAAS,EAAEC,QAAQ,CAAC,CAACG,MAAM,CAAC,UAACC,CAAC;MAAA,OAAKA,CAAC;IAAA,EAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAAA,GACtD,CAACN,SAAS,EAAEC,QAAQ,CAAC,CACtB;EAED,oBACE,yEACE,6BAAC,eAAe,qBACd,6BAAC,mBAAU;IAAC,IAAI,EAAC;EAAM,EAAG,eAC1B,6BAAC,WAAW,QACTC,QAAQ,iBAAI,6BAAC,QAAQ,QAAEA,QAAQ,CAAY,eAC5C,6BAAC,KAAK,QAAEH,KAAK,CAAS,CACV,CACE,eAElB,6BAAC,gBAAgB,QACdlC,MAAM,iBAAI,6BAAC,kBAAkB,OAAG,eAEjC,6BAAC,kBAAkB;IAAC,SAAS,EAAE,CAAC,CAACA;EAAO,EAAG,eAC3C,6BAAC,gBAAgB;IAAC,OAAO,EAAE,CAAC,CAACqC;EAAS,EAAG,eACzC,6BAAC,oBAAoB,OAAG,EAEvBN,OAAO,eAER,6BAAC,aAAa,OAAG,EAEhBC,QAAQ,CACQ,eAEnB,6BAAC,MAAM,qBACL,6BAAC,mBAAa,OAAG,CACV,CACR;AAEP,CAAC;AAAC,eAEaF,oBAAoB;AAAA"}
|
|
@@ -4,35 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _media = require("@os-design/media");
|
|
11
|
-
|
|
12
9
|
var _core = require("@os-design/core");
|
|
13
|
-
|
|
14
10
|
var _reactI18next = require("react-i18next");
|
|
15
|
-
|
|
16
11
|
var _ProfileIcon = _interopRequireDefault(require("../shared/icons/ProfileIcon"));
|
|
17
|
-
|
|
18
12
|
var _excluded = ["onClick"];
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
17
|
var ProfileNavigationItem = function ProfileNavigationItem(_ref) {
|
|
29
18
|
var _ref$onClick = _ref.onClick,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
t = _useTranslation.t;
|
|
35
|
-
|
|
19
|
+
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(['profile']),
|
|
22
|
+
t = _useTranslation.t;
|
|
36
23
|
var isMinMd = (0, _media.useIsMinWidth)('md');
|
|
37
24
|
if (isMinMd) return null;
|
|
38
25
|
return /*#__PURE__*/_react.default.createElement(_core.NavigationItem, _extends({
|
|
@@ -45,7 +32,6 @@ var ProfileNavigationItem = function ProfileNavigationItem(_ref) {
|
|
|
45
32
|
}
|
|
46
33
|
}, rest), t('profile:menu'));
|
|
47
34
|
};
|
|
48
|
-
|
|
49
35
|
var _default = ProfileNavigationItem;
|
|
50
36
|
exports.default = _default;
|
|
51
37
|
//# sourceMappingURL=ProfileNavigationItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileNavigationItem.js","names":["ProfileNavigationItem","onClick","rest","useTranslation","t","isMinMd","useIsMinWidth","e","key"],"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":"
|
|
1
|
+
{"version":3,"file":"ProfileNavigationItem.js","names":["ProfileNavigationItem","onClick","rest","useTranslation","t","isMinMd","useIsMinWidth","e","key"],"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;AACA;AACA;AACA;AACA;AAAsD;AAAA;AAAA;AAAA;AAAA;AAOtD,IAAMA,qBAA2D,GAAG,SAA9DA,qBAA2D,OAG3D;EAAA,wBAFJC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IACfC,IAAI;EAEP,sBAAc,IAAAC,4BAAc,EAAC,CAAC,SAAS,CAAC,CAAC;IAAjCC,CAAC,mBAADA,CAAC;EACT,IAAMC,OAAO,GAAG,IAAAC,oBAAa,EAAC,IAAI,CAAC;EAEnC,IAAID,OAAO,EAAE,OAAO,IAAI;EAExB,oBACE,6BAAC,oBAAc;IACb,IAAI,EAAC,GAAG,CAAC;IAAA;IACT,IAAI,eAAE,6BAAC,oBAAW,OAAI;IACtB,OAAO,EAAEJ,OAAQ;IACjB,SAAS,EAAE,mBAACM,CAAC,EAAK;MAChB,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAEP,OAAO,EAAE;IAClC;EAAE,GACEC,IAAI,GAEPE,CAAC,CAAC,cAAc,CAAC,CACH;AAErB,CAAC;AAAC,eAEaJ,qBAAqB;AAAA"}
|