diff --git a/src/app/features/feedback-button/feedback-button.tsx b/src/app/features/feedback-button/feedback-button.tsx index 68f2b327a18..a2de0d206cb 100644 --- a/src/app/features/feedback-button/feedback-button.tsx +++ b/src/app/features/feedback-button/feedback-button.tsx @@ -2,19 +2,10 @@ import { Box, Flex } from 'leather-styles/jsx'; import { Button, MegaphoneIcon } from '@leather.io/ui'; -import { analytics, sentryFeedback } from '@shared/utils/analytics'; +import { openFeedbackSheet } from '@shared/utils/analytics'; import { useThemeSwitcher } from '@app/common/theme-provider'; -export async function openFeedbackSheet() { - void analytics.track('user_clicked_feedback_button'); - const form = await sentryFeedback.createForm(); - if (!form) return null; - form.appendToDom(); - form.open(); - return; -} - export function FeedbackButton() { const { theme } = useThemeSwitcher(); return ( diff --git a/src/app/features/settings/settings.tsx b/src/app/features/settings/settings.tsx index b7cf75072b3..93fded10d08 100644 --- a/src/app/features/settings/settings.tsx +++ b/src/app/features/settings/settings.tsx @@ -24,7 +24,7 @@ import { } from '@leather.io/ui'; import { RouteUrls } from '@shared/route-urls'; -import { analytics } from '@shared/utils/analytics'; +import { analytics, openFeedbackSheet } from '@shared/utils/analytics'; import { useHasKeys } from '@app/common/hooks/auth/use-has-keys'; import { useKeyActions } from '@app/common/hooks/use-key-actions'; @@ -42,7 +42,6 @@ import { useCurrentNetworkId } from '@app/store/networks/networks.selectors'; import { useTogglePrivateMode } from '@app/store/settings/settings.actions'; import { useIsPrivateMode } from '@app/store/settings/settings.selectors'; -import { openFeedbackSheet } from '../feedback-button/feedback-button'; import { extractDeviceNameFromKnownTargetIds } from '../ledger/utils/generic-ledger-utils'; import { AdvancedMenuItems } from './components/advanced-menu-items'; import { LedgerDeviceItemRow } from './components/ledger-item-row'; diff --git a/src/app/pages/home/home.tsx b/src/app/pages/home/home.tsx index 933e7880c91..fed559a85b9 100644 --- a/src/app/pages/home/home.tsx +++ b/src/app/pages/home/home.tsx @@ -10,6 +10,7 @@ import { useOnboardingState } from '@app/common/hooks/auth/use-onboarding-state' import { useTotalBalance } from '@app/common/hooks/balance/use-total-balance'; import { useOnMount } from '@app/common/hooks/use-on-mount'; import { useSwitchAccountSheet } from '@app/common/switch-account/use-switch-account-sheet-context'; +import { whenPageMode } from '@app/common/utils'; import { ActivityList } from '@app/features/activity-list/activity-list'; import { FeedbackButton } from '@app/features/feedback-button/feedback-button'; import { Assets } from '@app/pages/home/components/assets'; @@ -75,7 +76,7 @@ export function Home() { - + {whenPageMode({ full: , popup: null })} } /> diff --git a/src/app/pages/rpc-get-addresses/components/get-addresses.layout.tsx b/src/app/pages/rpc-get-addresses/components/get-addresses.layout.tsx index 55c328e1331..6a40b309560 100644 --- a/src/app/pages/rpc-get-addresses/components/get-addresses.layout.tsx +++ b/src/app/pages/rpc-get-addresses/components/get-addresses.layout.tsx @@ -21,7 +21,7 @@ import { FaviconDisplayer } from '@app/components/favicon-displayer/favicon-disp interface GetAddressesLayoutProps { requester: string; switchAccount: ReactNode; - onBeforeAnimation(): void; + onBeforeAnimation?(): void; onUserApprovesGetAddresses(): void; onClickRequestedByLink(): void; } @@ -45,7 +45,7 @@ export function GetAddressesLayout({ }); async function userApprovesGetAddresses() { - onBeforeAnimation(); + onBeforeAnimation?.(); const yPos = window.innerHeight / 2 - 100; const xPos = Math.min(window.innerWidth / 2, 320) - 84; await contentDisappears.start({ diff --git a/src/app/pages/rpc-get-addresses/rpc-get-addresses.tsx b/src/app/pages/rpc-get-addresses/rpc-get-addresses.tsx index 0f8c0329396..f3b899ca591 100644 --- a/src/app/pages/rpc-get-addresses/rpc-get-addresses.tsx +++ b/src/app/pages/rpc-get-addresses/rpc-get-addresses.tsx @@ -38,7 +38,6 @@ export function RpcGetAddresses() { return (