From be3cf4d7f8ac1ed8af02949a5be448002516d994 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Thu, 10 Oct 2024 11:00:00 +0200 Subject: [PATCH] fix: adjust feedback button display --- .../features/feedback-button/feedback-button.tsx | 11 +---------- src/app/features/settings/settings.tsx | 3 +-- src/app/pages/home/home.tsx | 3 ++- src/shared/utils/analytics.ts | 16 ++++++++++++++-- 4 files changed, 18 insertions(+), 15 deletions(-) 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/shared/utils/analytics.ts b/src/shared/utils/analytics.ts index 9b7c89ecf42..5433ddd1aeb 100644 --- a/src/shared/utils/analytics.ts +++ b/src/shared/utils/analytics.ts @@ -69,7 +69,7 @@ export async function identifyUser(publicKey: Uint8Array) { return analytics.identify(deriveAnalyticsIdentifier(publicKey)); } -export const sentryFeedback = feedbackIntegration({ +const sentryFeedback = feedbackIntegration({ colorScheme: 'system', isEmailRequired: false, buttonLabel: 'Give feedback', @@ -78,7 +78,8 @@ export const sentryFeedback = feedbackIntegration({ showEmail: false, showName: false, showBranding: false, - messageLabel: 'Feedback', + messageLabel: 'How can we improve Leather?', + enableScreenshot: false, submitButtonLabel: 'Send feedback', messagePlaceholder: 'This is not a support tool. To get help, follow the link in the main menu on the homepage.', @@ -139,4 +140,15 @@ export function initSentry() { return event; }, }); + + Sentry.setTag('app_version', VERSION); +} + +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; }