From 099bd318ab5ec9f35bc8cec3fa592deef31aedc4 Mon Sep 17 00:00:00 2001 From: Salman Date: Thu, 12 Dec 2024 16:37:01 +0500 Subject: [PATCH 1/7] community-icons --- .../component_kit/cw_community_avatar.tsx | 25 ++++++-- .../sidebar/sidebar_quick_switcher.scss | 24 +++++++ .../sidebar/sidebar_quick_switcher.tsx | 63 ++++++++++++++----- 3 files changed, 93 insertions(+), 19 deletions(-) diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx index cbbac6f19b6..0f9eddaffe5 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import React from 'react'; import { Skeleton } from '../Skeleton'; import './cw_community_avatar.scss'; @@ -8,12 +9,14 @@ import { ComponentType } from './types'; type CommunityAvatarProps = { community: { + id?: string; name: string; iconUrl: string; }; onClick?: () => void; size?: IconSize; showSkeleton?: boolean; + selectedCommunity?: string; }; const CWCommunityAvatarSkeleton = () => { @@ -26,7 +29,13 @@ const CWCommunityAvatarSkeleton = () => { // eslint-disable-next-line react/no-multi-comp export const CWCommunityAvatar = (props: CommunityAvatarProps) => { - const { community, onClick, size = 'large', showSkeleton } = props; + const { + community, + onClick, + size = 'large', + showSkeleton, + selectedCommunity, + } = props; if (showSkeleton) { return ; @@ -35,16 +44,24 @@ export const CWCommunityAvatar = (props: CommunityAvatarProps) => { const sizeIsAboveLarge = size !== 'small' && size !== 'medium' && size !== 'large'; + const isSelected = selectedCommunity === community.id; return (
( - { onClick: !!onClick, size }, + className={getClasses<{ + onClick: boolean; + size: IconSize; + isSelected: boolean; + }>( + { onClick: !!onClick, size, isSelected }, ComponentType.CommunityAvatar, )} onClick={onClick} > {community?.iconUrl ? ( - + ) : (
({ size }, 'no-image')}>
+ {user.communities.filter((x) => x.isStarred).length !== 0 && ( +
+ {user.communities + .filter((x) => x.isStarred) + .map((community) => ( + + navigateToCommunity({ + navigate, + path: '', + chain: community.id, + }) + } + /> + ))} +
+ )} + {user.communities.filter((x) => x.isStarred).length !== 0 && ( + + )}
- {user.communities - .filter((x) => x.isStarred) - .map((community) => ( - - navigateToCommunity({ navigate, path: '', chain: community.id }) - } - /> - ))} + {user.communities.map((community) => ( + + navigateToCommunity({ navigate, path: '', chain: community.id }) + } + /> + ))}
); From 8e24534c9f45a1380e42857a40a78e1ee218e8ea Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 20 Dec 2024 18:19:06 +0500 Subject: [PATCH 2/7] community-notfications --- packages/commonwealth/client/scripts/App.tsx | 34 +-- .../scripts/hooks/useFetchNotifications.ts | 24 ++ .../KnockNotifications/KnockFeedWrapper.tsx | 59 +++++ .../KnockNotifications/KnockNotifications.tsx | 42 +-- .../views/components/sidebar/helpers.ts | 9 + .../sidebar/sidebar_notification_icon.scss | 31 +++ .../sidebar/sidebar_notification_icon.tsx | 22 ++ .../sidebar/sidebar_quick_switcher.scss | 4 + .../sidebar/sidebar_quick_switcher.tsx | 75 +++--- packages/commonwealth/package.json | 6 +- pnpm-lock.yaml | 240 +++++++----------- 11 files changed, 306 insertions(+), 240 deletions(-) create mode 100644 packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts create mode 100644 packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx create mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss create mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx diff --git a/packages/commonwealth/client/scripts/App.tsx b/packages/commonwealth/client/scripts/App.tsx index cb767205b99..37eb22453ee 100644 --- a/packages/commonwealth/client/scripts/App.tsx +++ b/packages/commonwealth/client/scripts/App.tsx @@ -14,6 +14,7 @@ import { openFeatureProvider } from './helpers/feature-flags'; import useAppStatus from './hooks/useAppStatus'; import { trpc, trpcClient } from './utils/trpcClient'; import { AddToHomeScreenPrompt } from './views/components/AddToHomeScreenPrompt'; +import { KnockFeedWrapper } from './views/components/KnockNotifications/KnockFeedWrapper'; import { Mava } from './views/components/Mava'; OpenFeature.setProvider(openFeatureProvider); @@ -30,22 +31,23 @@ const App = () => { {/*@ts-expect-error StrictNullChecks*/} - {isLoading ? ( - - ) : ( - <> - - - {isAddedToHomeScreen || isMarketingPage ? null : ( - - )} - - )} - + + {isLoading ? ( + + ) : ( + <> + + + {isAddedToHomeScreen || isMarketingPage ? null : ( + + )} + + )} + {import.meta.env.DEV && } diff --git a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts new file mode 100644 index 00000000000..ae16244cdf6 --- /dev/null +++ b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts @@ -0,0 +1,24 @@ +import { + useKnockClient, + useNotifications, + useNotificationStore, +} from '@knocklabs/react'; +import { useEffect } from 'react'; + +const KNOCK_IN_APP_FEED_ID = + process.env.KNOCK_IN_APP_FEED_ID || 'fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb'; + +const useFetchNotifications = () => { + const knockClient = useKnockClient(); + const feedClient = useNotifications(knockClient, KNOCK_IN_APP_FEED_ID); + + const { items } = useNotificationStore(feedClient); + + useEffect(() => { + feedClient.fetch(); + }, [feedClient]); + + return { items }; +}; + +export default useFetchNotifications; diff --git a/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx new file mode 100644 index 00000000000..07f90ac0ebc --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx @@ -0,0 +1,59 @@ +import Knock from '@knocklabs/client'; +import { KnockFeedProvider, KnockProvider } from '@knocklabs/react'; +import React, { ReactNode, useEffect } from 'react'; +import useUserStore from 'state/ui/user'; + +const KNOCK_PUBLIC_API_KEY = + process.env.KNOCK_PUBLIC_API_KEY || + 'pk_test_Hd4ZpzlVcz9bqepJQoo9BvZHokgEqvj4T79fPdKqpYM'; + +const KNOCK_IN_APP_FEED_ID = + process.env.KNOCK_IN_APP_FEED_ID || 'fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb'; + +const knock = new Knock(KNOCK_PUBLIC_API_KEY); + +const getBrowserTimezone = (): string => { + return Intl.DateTimeFormat().resolvedOptions().timeZone; +}; + +interface KnockFeedWrapperProps { + children: ReactNode; +} + +export const KnockFeedWrapper = ({ children }: KnockFeedWrapperProps) => { + const user = useUserStore(); + + useEffect(() => { + if (!user.id || !user.isLoggedIn) return; + if (!user.knockJWT) { + console.warn('user knockJWT not set! Will not attempt to identify.'); + return; + } + + const timezone = getBrowserTimezone(); + async function doAsync() { + knock.authenticate(`${user.id}`, user.knockJWT); + await knock.user.identify({ + id: user.id, + email: user.email, + timezone, + }); + } + + doAsync().catch(console.error); + }, [user.email, user.id, user.isLoggedIn, user.knockJWT]); + + if (!user.id || !user.isLoggedIn || !user.knockJWT) return null; + + return ( + + + {children} + + + ); +}; diff --git a/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockNotifications.tsx b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockNotifications.tsx index 2735d5cfb3e..9534d6fd227 100644 --- a/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockNotifications.tsx +++ b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockNotifications.tsx @@ -1,4 +1,3 @@ -import Knock from '@knocklabs/client'; import { KnockFeedProvider, KnockProvider, @@ -6,7 +5,7 @@ import { NotificationIconButton, } from '@knocklabs/react'; import '@knocklabs/react-notification-feed/dist/index.css'; -import React, { memo, useEffect, useRef, useState } from 'react'; +import React, { memo, useRef, useState } from 'react'; import useUserStore from 'state/ui/user'; import CustomNotificationCell from './CustomNotificationCell'; import './KnockNotifications.scss'; @@ -17,50 +16,12 @@ const KNOCK_PUBLIC_API_KEY = const KNOCK_IN_APP_FEED_ID = process.env.KNOCK_IN_APP_FEED_ID || 'fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb'; -const knock = new Knock(KNOCK_PUBLIC_API_KEY); - -const getBrowserTimezone = (): string => { - return Intl.DateTimeFormat().resolvedOptions().timeZone; -}; - export const KnockNotifications = memo(function KnockNotifications() { const user = useUserStore(); const [isVisible, setIsVisible] = useState(false); const notifButtonRef = useRef(null); - useEffect(() => { - if (!user.id || !user.isLoggedIn) { - return; - } - - if (!user.knockJWT) { - console.warn('user knockJWT not set! Will not attempt to identify.'); - return; - } - - const timezone = getBrowserTimezone(); - async function doAsync() { - knock.authenticate(`${user.id}`, user.knockJWT); - - await knock.user.identify({ - id: user.id, - email: user.email, - timezone, - }); - } - - doAsync().catch(console.error); - }, [user.email, user.id, user.isLoggedIn, user.knockJWT]); - - if (!user.id || !user.isLoggedIn) { - return null; - } - - if (!user.knockJWT) { - return null; - } - return (
- {/* Optionally, use the KnockFeedProvider to connect an in-app feed */}
+ items.filter( + (item) => !item.read_at && item?.data?.community_name === communityName, + ).length; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss new file mode 100644 index 00000000000..ede2a52401c --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss @@ -0,0 +1,31 @@ +.notification-icon-container { + position: absolute; + top: 0; + right: 0; + display: inline-block; +} + +.notification-icon { + font-size: 24px; + color: #333; + position: relative; + cursor: pointer; +} + +.notification-badge { + position: absolute; + top: 22px; + right: -5px; + background-color: red; + color: white; + font-size: 12px; + font-weight: bold; + padding: 2px 6px; + border-radius: 12px; + line-height: 1; + border: 2px solid white; +} + +.hidden-feed { + display: none; +} diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx new file mode 100644 index 00000000000..abc2d5f08fc --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx @@ -0,0 +1,22 @@ +import '@knocklabs/react-notification-feed/dist/index.css'; +import React from 'react'; +import './sidebar_notification_icon.scss'; + +type SideBarNotificationIconProps = { + unreadCount: number; +}; + +export const SideBarNotificationIcon = ({ + unreadCount, +}: SideBarNotificationIconProps) => ( +
+
+ + {unreadCount > 0 && ( + + {unreadCount > 99 ? '99+' : unreadCount} + + )} +
+
+); diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss index 8f0b6e9ae01..682dca91ec7 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss @@ -60,5 +60,9 @@ &::-webkit-scrollbar { width: 4px; } + + .community-avatar-container { + position: relative; + } } } diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx index af5f1ebc57e..fe67e28d205 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx @@ -1,3 +1,4 @@ +import useFetchNotifications from 'client/scripts/hooks/useFetchNotifications'; import clsx from 'clsx'; import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; import React from 'react'; @@ -7,6 +8,8 @@ import useUserStore from 'state/ui/user'; import { CWCommunityAvatar } from '../component_kit/cw_community_avatar'; import { CWDivider } from '../component_kit/cw_divider'; import { CWIconButton } from '../component_kit/cw_icon_button'; +import { calculateUnreadCount } from './helpers'; +import { SideBarNotificationIcon } from './sidebar_notification_icon'; import './sidebar_quick_switcher.scss'; export const SidebarQuickSwitcher = ({ @@ -20,6 +23,8 @@ export const SidebarQuickSwitcher = ({ const { setMenu } = useSidebarStore(); const user = useUserStore(); + const { items } = useFetchNotifications(); + const location = useLocation(); const pathname = location.pathname; const communityId = pathname.split('/')[1]; @@ -52,23 +57,28 @@ export const SidebarQuickSwitcher = ({ {user.communities .filter((x) => x.isStarred) .map((community) => ( - - navigateToCommunity({ - navigate, - path: '', - chain: community.id, - }) - } - /> +
+ + navigateToCommunity({ + navigate, + path: '', + chain: community.id, + }) + } + /> + +
))}
)} @@ -77,19 +87,24 @@ export const SidebarQuickSwitcher = ({ )}
{user.communities.map((community) => ( - - navigateToCommunity({ navigate, path: '', chain: community.id }) - } - /> +
+ + navigateToCommunity({ navigate, path: '', chain: community.id }) + } + /> + +
))}
diff --git a/packages/commonwealth/package.json b/packages/commonwealth/package.json index e579e10fc4b..ce4d33d53f8 100644 --- a/packages/commonwealth/package.json +++ b/packages/commonwealth/package.json @@ -109,19 +109,19 @@ "@hicommonwealth/adapters": "workspace:*", "@hicommonwealth/chains": "workspace:*", "@hicommonwealth/core": "workspace:*", + "@hicommonwealth/evm-protocols": "workspace:*", "@hicommonwealth/evm-testing": "workspace:*", "@hicommonwealth/model": "workspace:*", "@hicommonwealth/schemas": "workspace:*", "@hicommonwealth/shared": "workspace:*", "@hicommonwealth/sitemaps": "workspace:*", - "@hicommonwealth/evm-protocols": "workspace:*", "@hookform/resolvers": "^3.3.1", "@ipld/dag-json": "^10.2.0", "@keplr-wallet/types": "^0.12.23", "@keplr-wallet/unit": "^0.12.23", - "@knocklabs/client": "^0.10.13", + "@knocklabs/client": "^0.10.16", "@knocklabs/node": "^0.6.13", - "@knocklabs/react": "^0.2.15", + "@knocklabs/react": "^0.2.32", "@knocklabs/react-notification-feed": "^0.8.15", "@lexical/rich-text": "^0.17.0", "@libp2p/crypto": "^5.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ba7ed69a68..22fa81b1f40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -909,14 +909,14 @@ importers: specifier: ^0.12.23 version: 0.12.86 '@knocklabs/client': - specifier: ^0.10.13 - version: 0.10.13(react@18.3.1) + specifier: ^0.10.16 + version: 0.10.16(react@18.3.1) '@knocklabs/node': specifier: ^0.6.13 version: 0.6.13 '@knocklabs/react': - specifier: ^0.2.15 - version: 0.2.17(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^0.2.32 + version: 0.2.32(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@knocklabs/react-notification-feed': specifier: ^0.8.15 version: 0.8.15(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -4209,8 +4209,8 @@ packages: '@keplr-wallet/unit@0.12.86': resolution: {integrity: sha512-0csxBbrxHbAJsjn5VQgyTMViVi0FF/wkIWAFvyhagagP+o/vkIM8oWRHXnHy2tJLyDboSsww83kiOPV5PiHbJw==} - '@knocklabs/client@0.10.13': - resolution: {integrity: sha512-h57WEYk/c0xUdFDWSVMbb/nJQ+ehstE8OtZcxb33autPbyzz4Fr6SIO/Zgw/nzw//EA/W33dYiHiChPWvIQH8A==} + '@knocklabs/client@0.10.16': + resolution: {integrity: sha512-cN7ksBmGbdX9pIuhg6t9D9JgXxjQ8lQLEpBXEtKFy3DTrCkVBrV+6hTqOpzGkRYCg5ESmuYej4RErJp1xlQPkg==} '@knocklabs/client@0.8.21': resolution: {integrity: sha512-uPaUAwbg9Bi0UIPIYOE4v4GiasKezZNQ/ge9KST2wlSHAfpKWrHf7s85H4mD7IGkVc0xkokF4RZ4lqr7cy48wg==} @@ -4219,8 +4219,8 @@ packages: resolution: {integrity: sha512-XA6HWxIvLiCpRt5GisTFYDZuTuyrRR34XnFwPFPXPNTO1cKQOHLkQvyy7FzAOTD6/PVj1DM2Ge9HHij+Z64Rtg==} engines: {node: '>=17.5.0'} - '@knocklabs/react-core@0.2.15': - resolution: {integrity: sha512-qDvsyT5J6hdFFEX4+VFdC3GT9xIIk8TNj3YAC4diqulqeArnVd8fEyrXOk+5HMbvZpHlgzW0LyBV40Yli9/vnA==} + '@knocklabs/react-core@0.2.28': + resolution: {integrity: sha512-8nBJxXyNGwEFvwzBt0c70MzGhjXqNAL/KLGuh3WMHj37I2HUgDyzyLrLbQ7wqfZs/ku2qs99S5QhBukJmlIq9g==} peerDependencies: react: ^16.11.0 || ^17.0.0 || ^18.0.0 @@ -4230,14 +4230,14 @@ packages: react: '>=16.8.0' react-dom: '>=16.8.0' - '@knocklabs/react@0.2.17': - resolution: {integrity: sha512-HqFWifzJBh8LpTy099zS8cIh4EaqGUNv/g6sWyEWiDk70bijd86ALQ51szOoWmhNRMSu2MUnGHgTGxa6A2te4g==} + '@knocklabs/react@0.2.32': + resolution: {integrity: sha512-piYBqzRgdeo8vzE9/ZsWGgMmKn8S6ppTtgoPUnGm/lVCXjqDFPpZ80sJk42ELmx5x74OHVvvdBOYO91VFZnxGA==} peerDependencies: react: ^16.11.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.11.0 || ^17.0.0 || ^18.0.0 - '@knocklabs/types@0.1.4': - resolution: {integrity: sha512-KdEESYtIYDaBy9CTNKco7MJ+PcX9wfWt3WVNBKHrrARX++Fa/gn1Zn8WQ5K39hckXm/c2AL6WhNjGv6ovkxwFw==} + '@knocklabs/types@0.1.5': + resolution: {integrity: sha512-Wu/0XsrTKBM2JO2eoazhz6MWpnmm6uCUsozPyg4aeJS7vndtqLPwniW6fzVn1gSrR7upWkWThrv5ZzokZ6BAHQ==} '@leichtgewicht/ip-codec@2.0.5': resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} @@ -6605,24 +6605,12 @@ packages: resolution: {integrity: sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - '@sinonjs/commons@2.0.0': - resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} - '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - '@sinonjs/fake-timers@11.2.2': - resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} - - '@sinonjs/samsam@8.0.0': - resolution: {integrity: sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==} - - '@sinonjs/text-encoding@0.7.2': - resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==} - '@smithy/abort-controller@3.0.0': resolution: {integrity: sha512-p6GlFGBt9K4MYLu72YuJ523NVR4A8oHlC5M2JO6OmQqN8kAc/uh1JqLE+FizTokrSJGg0CSvC+BrsmGzKtsZKA==} engines: {node: '>=16.0.0'} @@ -7458,8 +7446,8 @@ packages: '@types/pg@8.11.6': resolution: {integrity: sha512-/2WmmBXHLsfRqzfHW7BNZ8SbYzE8OSk7i3WjFYvfgRHj7S1xj+16Je5fUKv3lVdVzk/zn9TXOqf+avFCFIE0yQ==} - '@types/phoenix@1.6.4': - resolution: {integrity: sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==} + '@types/phoenix@1.6.6': + resolution: {integrity: sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==} '@types/prop-types@15.7.12': resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} @@ -7525,12 +7513,6 @@ packages: '@types/serve-static@1.15.7': resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} - '@types/sinon@17.0.3': - resolution: {integrity: sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==} - - '@types/sinonjs__fake-timers@8.1.5': - resolution: {integrity: sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==} - '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -8331,6 +8313,11 @@ packages: axios-retry@3.9.1: resolution: {integrity: sha512-8PJDLJv7qTTMMwdnbMvrLYuvB47M81wRtxQmEdV5w4rgbTXTt+vtPkXwajOfOdSyv/wZICJOC+/UhXH4aQ/R+w==} + axios-retry@4.5.0: + resolution: {integrity: sha512-aR99oXhpEDGo0UuAlYcn2iGRds30k366Zfa05XWScR9QaQD4JYiP3/1Qt1u7YlefUOK+cn0CcwoL1oefavQUlQ==} + peerDependencies: + axios: 0.x || 1.x + axios@0.21.4: resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} @@ -9301,9 +9288,6 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} - date-fns@3.6.0: - resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==} - date-fns@4.1.0: resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} @@ -10065,9 +10049,11 @@ packages: ethereumjs-abi@0.6.5: resolution: {integrity: sha512-rCjJZ/AE96c/AAZc6O3kaog4FhOsAViaysBxqJNy2+LHP0ttH0zkZ7nXdVHOAyt6lFwLO0nlCwWszysG/ao1+g==} + deprecated: This library has been deprecated and usage is discouraged. ethereumjs-abi@0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} + deprecated: This library has been deprecated and usage is discouraged. ethereumjs-util@4.5.1: resolution: {integrity: sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==} @@ -10088,6 +10074,7 @@ packages: ethereumjs-wallet@1.0.2: resolution: {integrity: sha512-CCWV4RESJgRdHIvFciVQFnCHfqyhXWchTPlkfp28Qc53ufs+doi5I/cV2+xeK9+qEo25XCWfP9MiL+WEPAZfdA==} + deprecated: 'New package name format for new versions: @ethereumjs/wallet. Please update.' ethers@5.7.2: resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} @@ -11846,9 +11833,6 @@ packages: resolution: {integrity: sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==} engines: {node: '>=12.20'} - just-extend@6.2.0: - resolution: {integrity: sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==} - jwa@1.4.1: resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} @@ -12811,9 +12795,6 @@ packages: nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - nise@5.1.9: - resolution: {integrity: sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==} - no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -13341,9 +13322,6 @@ packages: path-to-regexp@3.3.0: resolution: {integrity: sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==} - path-to-regexp@6.2.2: - resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} - path-to-regexp@6.3.0: resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} @@ -13444,6 +13422,9 @@ packages: phoenix@1.6.16: resolution: {integrity: sha512-3vOfu5olbFg6eBNkF4pnwMzNm7unl/4vy24MW+zxKklVgjq1zLnO2EWq9wz6i6r4PbQ0CGxHGtqKJH2VSsnhaA==} + phoenix@1.7.14: + resolution: {integrity: sha512-3tZ76PiH/2g+Kyzhz8+GIFYrnx3lRnwi/Qt3ZUH04xpMxXL7Guerd5aaxtpWal73X+H8iLAjo2c+AgRy2KYQcQ==} + picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -14824,10 +14805,6 @@ packages: simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} - sinon@17.0.2: - resolution: {integrity: sha512-uihLiaB9FhzesElPDFZA7hDcNABzsVHwr3YfmM9sBllVwab3l0ltGlRV1XhpNfIacNDLGD1QRZNLs5nU5+hTuA==} - deprecated: There - sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} @@ -15206,6 +15183,7 @@ packages: sudo-prompt@9.2.1: resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} @@ -16978,8 +16956,8 @@ snapshots: '@aws-crypto/sha1-browser': 3.0.0 '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) - '@aws-sdk/client-sts': 3.577.0 + '@aws-sdk/client-sso-oidc': 3.577.0 + '@aws-sdk/client-sts': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/core': 3.576.0 '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-bucket-endpoint': 3.577.0 @@ -17036,11 +17014,11 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)': + '@aws-sdk/client-sso-oidc@3.577.0': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sts': 3.577.0 + '@aws-sdk/client-sts': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/core': 3.576.0 '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -17079,7 +17057,6 @@ snapshots: '@smithy/util-utf8': 3.0.0 tslib: 2.7.0 transitivePeerDependencies: - - '@aws-sdk/client-sts' - aws-crt '@aws-sdk/client-sso@3.577.0': @@ -17125,11 +17102,11 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sts@3.577.0': + '@aws-sdk/client-sts@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/client-sso-oidc': 3.577.0 '@aws-sdk/core': 3.576.0 '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -17168,6 +17145,7 @@ snapshots: '@smithy/util-utf8': 3.0.0 tslib: 2.7.0 transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' - aws-crt '@aws-sdk/core@3.576.0': @@ -17201,7 +17179,7 @@ snapshots: '@aws-sdk/credential-provider-ini@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0)': dependencies: - '@aws-sdk/client-sts': 3.577.0 + '@aws-sdk/client-sts': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) @@ -17258,7 +17236,7 @@ snapshots: '@aws-sdk/credential-provider-web-identity@3.577.0(@aws-sdk/client-sts@3.577.0)': dependencies: - '@aws-sdk/client-sts': 3.577.0 + '@aws-sdk/client-sts': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/types': 3.0.0 @@ -17396,7 +17374,7 @@ snapshots: '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/client-sso-oidc': 3.577.0 '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 @@ -20470,7 +20448,7 @@ snapshots: '@emotion/babel-plugin@11.11.0': dependencies: '@babel/helper-module-imports': 7.24.3 - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@emotion/hash': 0.9.1 '@emotion/memoize': 0.8.1 '@emotion/serialize': 1.1.4 @@ -21678,16 +21656,16 @@ snapshots: big-integer: 1.6.52 utility-types: 3.11.0 - '@knocklabs/client@0.10.13(react@18.3.1)': + '@knocklabs/client@0.10.16(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@knocklabs/types': 0.1.4 - '@types/phoenix': 1.6.4 - axios: 1.7.5 - axios-retry: 3.9.1 + '@babel/runtime': 7.26.0 + '@knocklabs/types': 0.1.5 + '@types/phoenix': 1.6.6 + axios: 1.7.7 + axios-retry: 4.5.0(axios@1.7.7) eventemitter2: 6.4.9 jwt-decode: 4.0.0 - phoenix: 1.6.16 + phoenix: 1.7.14 zustand: 3.7.2(react@18.3.1) transitivePeerDependencies: - debug @@ -21710,10 +21688,10 @@ snapshots: dependencies: jose: 5.3.0 - '@knocklabs/react-core@0.2.15(react@18.3.1)': + '@knocklabs/react-core@0.2.28(react@18.3.1)': dependencies: - '@knocklabs/client': 0.10.13(react@18.3.1) - date-fns: 3.6.0 + '@knocklabs/client': 0.10.16(react@18.3.1) + date-fns: 4.1.0 react: 18.3.1 swr: 2.2.5(react@18.3.1) zustand: 3.7.2(react@18.3.1) @@ -21734,10 +21712,10 @@ snapshots: transitivePeerDependencies: - debug - '@knocklabs/react@0.2.17(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@knocklabs/react@0.2.32(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@knocklabs/client': 0.10.13(react@18.3.1) - '@knocklabs/react-core': 0.2.15(react@18.3.1) + '@knocklabs/client': 0.10.16(react@18.3.1) + '@knocklabs/react-core': 0.2.28(react@18.3.1) '@popperjs/core': 2.11.8 '@radix-ui/react-popover': 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -21751,7 +21729,7 @@ snapshots: - '@types/react-dom' - debug - '@knocklabs/types@0.1.4': {} + '@knocklabs/types@0.1.5': {} '@leichtgewicht/ip-codec@2.0.5': {} @@ -23967,13 +23945,13 @@ snapshots: '@radix-ui/primitive@1.0.1': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/primitive@1.1.0': {} '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -24004,7 +23982,7 @@ snapshots: '@radix-ui/react-compose-refs@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -24017,7 +23995,7 @@ snapshots: '@radix-ui/react-context@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -24058,7 +24036,7 @@ snapshots: '@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -24085,7 +24063,7 @@ snapshots: '@radix-ui/react-focus-guards@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -24098,7 +24076,7 @@ snapshots: '@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) @@ -24125,7 +24103,7 @@ snapshots: '@radix-ui/react-id@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -24140,7 +24118,7 @@ snapshots: '@radix-ui/react-popover@1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) @@ -24164,7 +24142,7 @@ snapshots: '@radix-ui/react-popper@1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@floating-ui/react-dom': 2.0.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) @@ -24201,7 +24179,7 @@ snapshots: '@radix-ui/react-portal@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -24221,7 +24199,7 @@ snapshots: '@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 @@ -24242,7 +24220,7 @@ snapshots: '@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -24316,7 +24294,7 @@ snapshots: '@radix-ui/react-slot@1.0.2(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -24392,7 +24370,7 @@ snapshots: '@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -24405,7 +24383,7 @@ snapshots: '@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -24420,7 +24398,7 @@ snapshots: '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -24435,7 +24413,7 @@ snapshots: '@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -24454,7 +24432,7 @@ snapshots: '@radix-ui/react-use-rect@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/rect': 1.0.1 react: 18.3.1 optionalDependencies: @@ -24469,7 +24447,7 @@ snapshots: '@radix-ui/react-use-size@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -24484,7 +24462,7 @@ snapshots: '@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -24503,7 +24481,7 @@ snapshots: '@radix-ui/rect@1.0.1': dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 '@radix-ui/rect@1.1.0': {} @@ -25422,10 +25400,6 @@ snapshots: '@sindresorhus/fnv1a@3.1.0': {} - '@sinonjs/commons@2.0.0': - dependencies: - type-detect: 4.0.8 - '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 @@ -25434,18 +25408,6 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 - '@sinonjs/fake-timers@11.2.2': - dependencies: - '@sinonjs/commons': 3.0.1 - - '@sinonjs/samsam@8.0.0': - dependencies: - '@sinonjs/commons': 2.0.0 - lodash.get: 4.4.2 - type-detect: 4.0.8 - - '@sinonjs/text-encoding@0.7.2': {} - '@smithy/abort-controller@3.0.0': dependencies: '@smithy/types': 3.0.0 @@ -26662,7 +26624,7 @@ snapshots: pg-protocol: 1.6.1 pg-types: 4.0.2 - '@types/phoenix@1.6.4': {} + '@types/phoenix@1.6.6': {} '@types/prop-types@15.7.12': {} @@ -26753,12 +26715,6 @@ snapshots: '@types/node': 20.12.10 '@types/send': 0.17.4 - '@types/sinon@17.0.3': - dependencies: - '@types/sinonjs__fake-timers': 8.1.5 - - '@types/sinonjs__fake-timers@8.1.5': {} - '@types/stack-utils@2.0.3': {} '@types/superagent@4.1.13': @@ -28505,7 +28461,7 @@ snapshots: ast-types@0.15.2: dependencies: - tslib: 2.7.0 + tslib: 2.8.1 astral-regex@1.0.0: {} @@ -28543,7 +28499,12 @@ snapshots: axios-retry@3.9.1: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 + is-retry-allowed: 2.2.0 + + axios-retry@4.5.0(axios@1.7.7): + dependencies: + axios: 1.7.7 is-retry-allowed: 2.2.0 axios@0.21.4: @@ -28589,7 +28550,7 @@ snapshots: babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 cosmiconfig: 7.1.0 resolve: 1.22.8 @@ -29822,8 +29783,6 @@ snapshots: dependencies: '@babel/runtime': 7.25.7 - date-fns@3.6.0: {} - date-fns@4.1.0: {} dateformat@4.6.3: {} @@ -30078,7 +30037,7 @@ snapshots: dom-helpers@5.2.1: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 csstype: 3.1.3 dom-serializer@0.1.1: @@ -32153,15 +32112,15 @@ snapshots: i18next-browser-languagedetector@7.1.0: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 i18next@22.5.1: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 i18next@23.11.5: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 iconv-lite@0.4.24: dependencies: @@ -33152,8 +33111,6 @@ snapshots: junk@4.0.1: {} - just-extend@6.2.0: {} - jwa@1.4.1: dependencies: buffer-equal-constant-time: 1.0.1 @@ -33867,7 +33824,7 @@ snapshots: metro-runtime@0.80.10: dependencies: - '@babel/runtime': 7.25.7 + '@babel/runtime': 7.26.0 flow-enums-runtime: 0.0.6 metro-runtime@0.80.12: @@ -34640,14 +34597,6 @@ snapshots: nice-try@1.0.5: {} - nise@5.1.9: - dependencies: - '@sinonjs/commons': 3.0.1 - '@sinonjs/fake-timers': 11.2.2 - '@sinonjs/text-encoding': 0.7.2 - just-extend: 6.2.0 - path-to-regexp: 6.2.2 - no-case@3.0.4: dependencies: lower-case: 2.0.2 @@ -35321,8 +35270,6 @@ snapshots: path-to-regexp@3.3.0: {} - path-to-regexp@6.2.2: {} - path-to-regexp@6.3.0: {} path-type@3.0.0: @@ -35420,6 +35367,8 @@ snapshots: phoenix@1.6.16: {} + phoenix@1.7.14: {} + picocolors@1.0.0: {} picocolors@1.1.1: {} @@ -36357,7 +36306,7 @@ snapshots: react: 18.3.1 react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@18.3.1) react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) - tslib: 2.7.0 + tslib: 2.8.1 use-callback-ref: 1.3.2(@types/react@18.3.3)(react@18.3.1) use-sidecar: 1.1.2(@types/react@18.3.3)(react@18.3.1) optionalDependencies: @@ -37157,15 +37106,6 @@ snapshots: dependencies: is-arrayish: 0.3.2 - sinon@17.0.2: - dependencies: - '@sinonjs/commons': 3.0.1 - '@sinonjs/fake-timers': 11.2.2 - '@sinonjs/samsam': 8.0.0 - diff: 5.2.0 - nise: 5.1.9 - supports-color: 7.2.0 - sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.25 From bd50c617384563bdd226e94b07dd3fe5cc305a07 Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 20 Dec 2024 19:05:11 +0500 Subject: [PATCH 3/7] user-login-bug-fix --- .../views/components/KnockNotifications/KnockFeedWrapper.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx index 07f90ac0ebc..72639342621 100644 --- a/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx +++ b/packages/commonwealth/client/scripts/views/components/KnockNotifications/KnockFeedWrapper.tsx @@ -43,8 +43,6 @@ export const KnockFeedWrapper = ({ children }: KnockFeedWrapperProps) => { doAsync().catch(console.error); }, [user.email, user.id, user.isLoggedIn, user.knockJWT]); - if (!user.id || !user.isLoggedIn || !user.knockJWT) return null; - return ( Date: Fri, 20 Dec 2024 19:43:43 +0500 Subject: [PATCH 4/7] es-lint --- .../client/scripts/hooks/useFetchNotifications.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts index ae16244cdf6..c63a68e283d 100644 --- a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts +++ b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts @@ -15,7 +15,15 @@ const useFetchNotifications = () => { const { items } = useNotificationStore(feedClient); useEffect(() => { - feedClient.fetch(); + const fetchNotifications = async () => { + try { + await feedClient.fetch(); + } catch (error) { + console.error('Failed to fetch notifications:', error); + } + }; + + fetchNotifications(); }, [feedClient]); return { items }; From d365fb9263ae28ee02dc753a951c36d370cbe0ef Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 20 Dec 2024 19:46:29 +0500 Subject: [PATCH 5/7] es-lint --- .../commonwealth/client/scripts/hooks/useFetchNotifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts index c63a68e283d..b88b1322e64 100644 --- a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts +++ b/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts @@ -23,7 +23,7 @@ const useFetchNotifications = () => { } }; - fetchNotifications(); + fetchNotifications(); // eslint-disable-line @typescript-eslint/no-floating-promises }, [feedClient]); return { items }; From 63dd52bb093a474d6fc5052fd0e9e1f3f6ee2361 Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 20 Dec 2024 20:25:11 +0500 Subject: [PATCH 6/7] pr-comments --- .../notifications}/useFetchNotifications.ts | 0 .../sidebar/SidebarNotificationIcon.scss | 35 +++++++++++++++++++ .../sidebar/SidebarNotificationIcon.tsx | 24 +++++++++++++ .../sidebar/sidebar_notification_icon.scss | 31 ---------------- .../sidebar/sidebar_notification_icon.tsx | 22 ------------ .../sidebar/sidebar_quick_switcher.tsx | 4 +-- 6 files changed, 61 insertions(+), 55 deletions(-) rename packages/commonwealth/client/scripts/{hooks => state/api/notifications}/useFetchNotifications.ts (100%) create mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss create mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx delete mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss delete mode 100644 packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx diff --git a/packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts b/packages/commonwealth/client/scripts/state/api/notifications/useFetchNotifications.ts similarity index 100% rename from packages/commonwealth/client/scripts/hooks/useFetchNotifications.ts rename to packages/commonwealth/client/scripts/state/api/notifications/useFetchNotifications.ts diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss new file mode 100644 index 00000000000..ad8ffacd73f --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss @@ -0,0 +1,35 @@ +@import '../../../styles/'; + +.sidebar-notification-icon { + .notification-icon-container { + position: absolute; + top: 0; + right: 0; + display: inline-block; + } + + .notification-icon { + font-size: 24px; + color: $neutral-800; + position: relative; + cursor: pointer; + } + + .notification-badge { + position: absolute; + top: 22px; + right: -5px; + background-color: $rorange-400; + color: white; + font-size: 12px; + font-weight: bold; + padding: 2px 6px; + border-radius: 12px; + line-height: 1; + border: 2px solid white; + } + + .hidden-feed { + display: none; + } +} diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx new file mode 100644 index 00000000000..a424487d8bb --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx @@ -0,0 +1,24 @@ +import '@knocklabs/react-notification-feed/dist/index.css'; +import React from 'react'; +import './SidebarNotificationIcon.scss'; + +type SideBarNotificationIconProps = { + unreadCount: number; +}; + +export const SideBarNotificationIcon = ({ + unreadCount, +}: SideBarNotificationIconProps) => ( +
+
+
+ + {unreadCount > 0 && ( + + {unreadCount > 99 ? '99+' : unreadCount} + + )} +
+
+
+); diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss deleted file mode 100644 index ede2a52401c..00000000000 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.scss +++ /dev/null @@ -1,31 +0,0 @@ -.notification-icon-container { - position: absolute; - top: 0; - right: 0; - display: inline-block; -} - -.notification-icon { - font-size: 24px; - color: #333; - position: relative; - cursor: pointer; -} - -.notification-badge { - position: absolute; - top: 22px; - right: -5px; - background-color: red; - color: white; - font-size: 12px; - font-weight: bold; - padding: 2px 6px; - border-radius: 12px; - line-height: 1; - border: 2px solid white; -} - -.hidden-feed { - display: none; -} diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx deleted file mode 100644 index abc2d5f08fc..00000000000 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_notification_icon.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import '@knocklabs/react-notification-feed/dist/index.css'; -import React from 'react'; -import './sidebar_notification_icon.scss'; - -type SideBarNotificationIconProps = { - unreadCount: number; -}; - -export const SideBarNotificationIcon = ({ - unreadCount, -}: SideBarNotificationIconProps) => ( -
-
- - {unreadCount > 0 && ( - - {unreadCount > 99 ? '99+' : unreadCount} - - )} -
-
-); diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx index 91a9b3c216e..9041e85ffc7 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx @@ -1,4 +1,4 @@ -import useFetchNotifications from 'client/scripts/hooks/useFetchNotifications'; +import useFetchNotifications from 'client/scripts/state/api/notifications/useFetchNotifications'; import clsx from 'clsx'; import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; import React from 'react'; @@ -10,8 +10,8 @@ import { CWDivider } from '../component_kit/cw_divider'; import { CWIconButton } from '../component_kit/cw_icon_button'; import { isWindowSmallInclusive } from '../component_kit/helpers'; import { CWTooltip } from '../component_kit/new_designs/CWTooltip'; +import { SideBarNotificationIcon } from './SidebarNotificationIcon'; import { calculateUnreadCount } from './helpers'; -import { SideBarNotificationIcon } from './sidebar_notification_icon'; import './sidebar_quick_switcher.scss'; export const SidebarQuickSwitcher = ({ From 875590508e2a6d185dd2f1038bc6404710d7ace9 Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 20 Dec 2024 20:43:31 +0500 Subject: [PATCH 7/7] class-name-update --- .../views/components/sidebar/SidebarNotificationIcon.scss | 2 +- .../views/components/sidebar/SidebarNotificationIcon.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss index ad8ffacd73f..2e7475f335c 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.scss @@ -1,6 +1,6 @@ @import '../../../styles/'; -.sidebar-notification-icon { +.SideBarNotificationIcon { .notification-icon-container { position: absolute; top: 0; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx index a424487d8bb..4d83b13ab69 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/SidebarNotificationIcon.tsx @@ -9,7 +9,7 @@ type SideBarNotificationIconProps = { export const SideBarNotificationIcon = ({ unreadCount, }: SideBarNotificationIconProps) => ( -
+