@dynamic-labs/sdk-react-core 4.19.3 → 4.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -1
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +6 -0
- package/src/lib/locale/en/translation.cjs +10 -2
- package/src/lib/locale/en/translation.d.ts +9 -1
- package/src/lib/locale/en/translation.js +10 -2
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.cjs +1 -0
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.d.ts +1 -0
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.js +1 -0
- package/src/lib/store/utils/settingsUtils/settingsUtils.d.ts +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +34 -0
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.d.ts +11 -0
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +26 -0
- package/src/lib/utils/functions/getSessionInformation/index.d.ts +1 -0
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.cjs +7 -12
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.js +7 -12
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.cjs +4 -2
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.d.ts +4 -1
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.js +4 -2
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.js +12 -8
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionListItem/SessionListItem.cjs +97 -6
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionListItem/SessionListItem.js +97 -6
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.js +6 -2
- package/src/lib/utils/functions/getSessionInformationName/getSessionInformationName.cjs +0 -10
- package/src/lib/utils/functions/getSessionInformationName/getSessionInformationName.d.ts +0 -2
- package/src/lib/utils/functions/getSessionInformationName/getSessionInformationName.js +0 -6
- package/src/lib/utils/functions/getSessionInformationName/index.d.ts +0 -1
|
@@ -24,8 +24,12 @@ const SessionManagementView = ({ bannerMessage, }) => {
|
|
|
24
24
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
25
25
|
const { listSessions } = useSessionKeys.useSessionKeys();
|
|
26
26
|
const [sessions, setSessions] = React.useState([]);
|
|
27
|
+
const [loading, setLoading] = React.useState(false);
|
|
27
28
|
React.useEffect(() => {
|
|
28
|
-
|
|
29
|
+
setLoading(true);
|
|
30
|
+
listSessions()
|
|
31
|
+
.then(setSessions)
|
|
32
|
+
.finally(() => setLoading(false));
|
|
29
33
|
}, [listSessions]);
|
|
30
34
|
const handleBackButtonClick = React.useCallback(() => {
|
|
31
35
|
setDynamicWidgetView('account-and-security-settings');
|
|
@@ -40,7 +44,7 @@ const SessionManagementView = ({ bannerMessage, }) => {
|
|
|
40
44
|
}, [setDynamicWidgetView]);
|
|
41
45
|
const renderBackButton = () => (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleBackButtonClick, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
42
46
|
const renderInfoButton = () => (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleInfoButtonClick, "aria-label": t('dyn_session_management.aria.info_button_label'), children: jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }));
|
|
43
|
-
return (jsxRuntime.jsxs("div", { className: 'session-management-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsxRuntime.jsx("div", { className: 'session-management-view__banner', children: bannerMessage && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: bannerMessage.type, withIcon: false, children: bannerMessage.message })) }), jsxRuntime.jsx("div", { className: 'session-management-view__body', children: sessions.length === 0 ? (jsxRuntime.jsx(EmptySessionsView.EmptySessionsView, {})) : (jsxRuntime.jsx("div", { className: 'session-management-view__sessions-container', children: sessions.map((session) => (jsxRuntime.jsx(SessionListItem.SessionListItem, { session: session, onRevokeAccessClick: handleRevokeAccessClick }, session.sessionId))) })) })] }));
|
|
47
|
+
return (jsxRuntime.jsxs("div", { className: 'session-management-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsxRuntime.jsx("div", { className: 'session-management-view__banner', children: bannerMessage && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: bannerMessage.type, withIcon: false, children: bannerMessage.message })) }), jsxRuntime.jsx("div", { className: 'session-management-view__body', children: sessions.length === 0 ? (jsxRuntime.jsx(EmptySessionsView.EmptySessionsView, { loading: loading })) : (jsxRuntime.jsx("div", { className: 'session-management-view__sessions-container', children: sessions.map((session) => (jsxRuntime.jsx(SessionListItem.SessionListItem, { session: session, onRevokeAccessClick: handleRevokeAccessClick }, session.sessionId))) })) })] }));
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
exports.SessionManagementView = SessionManagementView;
|
|
@@ -20,8 +20,12 @@ const SessionManagementView = ({ bannerMessage, }) => {
|
|
|
20
20
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
21
21
|
const { listSessions } = useSessionKeys();
|
|
22
22
|
const [sessions, setSessions] = useState([]);
|
|
23
|
+
const [loading, setLoading] = useState(false);
|
|
23
24
|
useEffect(() => {
|
|
24
|
-
|
|
25
|
+
setLoading(true);
|
|
26
|
+
listSessions()
|
|
27
|
+
.then(setSessions)
|
|
28
|
+
.finally(() => setLoading(false));
|
|
25
29
|
}, [listSessions]);
|
|
26
30
|
const handleBackButtonClick = useCallback(() => {
|
|
27
31
|
setDynamicWidgetView('account-and-security-settings');
|
|
@@ -36,7 +40,7 @@ const SessionManagementView = ({ bannerMessage, }) => {
|
|
|
36
40
|
}, [setDynamicWidgetView]);
|
|
37
41
|
const renderBackButton = () => (jsx(IconButton, { onClick: handleBackButtonClick, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsx(SvgChevronLeft, {}) }));
|
|
38
42
|
const renderInfoButton = () => (jsx(IconButton, { onClick: handleInfoButtonClick, "aria-label": t('dyn_session_management.aria.info_button_label'), children: jsx(SvgFooterInfoIcon, {}) }));
|
|
39
|
-
return (jsxs("div", { className: 'session-management-view', children: [jsx(ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsx("div", { className: 'session-management-view__banner', children: bannerMessage && (jsx(ErrorContainer, { variant: bannerMessage.type, withIcon: false, children: bannerMessage.message })) }), jsx("div", { className: 'session-management-view__body', children: sessions.length === 0 ? (jsx(EmptySessionsView, {})) : (jsx("div", { className: 'session-management-view__sessions-container', children: sessions.map((session) => (jsx(SessionListItem, { session: session, onRevokeAccessClick: handleRevokeAccessClick }, session.sessionId))) })) })] }));
|
|
43
|
+
return (jsxs("div", { className: 'session-management-view', children: [jsx(ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsx("div", { className: 'session-management-view__banner', children: bannerMessage && (jsx(ErrorContainer, { variant: bannerMessage.type, withIcon: false, children: bannerMessage.message })) }), jsx("div", { className: 'session-management-view__body', children: sessions.length === 0 ? (jsx(EmptySessionsView, { loading: loading })) : (jsx("div", { className: 'session-management-view__sessions-container', children: sessions.map((session) => (jsx(SessionListItem, { session: session, onRevokeAccessClick: handleRevokeAccessClick }, session.sessionId))) })) })] }));
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
export { SessionManagementView };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var shortenWalletAddress = require('../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
7
|
-
|
|
8
|
-
const getSessionInformationName = (session) => { var _a; return (_a = session.origin) !== null && _a !== void 0 ? _a : shortenWalletAddress.shortenWalletAddress(session.sessionId); };
|
|
9
|
-
|
|
10
|
-
exports.getSessionInformationName = getSessionInformationName;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { shortenWalletAddress } from '../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
3
|
-
|
|
4
|
-
const getSessionInformationName = (session) => { var _a; return (_a = session.origin) !== null && _a !== void 0 ? _a : shortenWalletAddress(session.sessionId); };
|
|
5
|
-
|
|
6
|
-
export { getSessionInformationName };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './getSessionInformationName';
|