From 4a1b1f17f46de9f8dde2766d61edc02c2267b14b Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 9 Sep 2025 18:45:36 +0300 Subject: Clean up dialogs (#8934) --- src/components/StarterPack/ShareDialog.tsx | 54 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'src/components/StarterPack/ShareDialog.tsx') diff --git a/src/components/StarterPack/ShareDialog.tsx b/src/components/StarterPack/ShareDialog.tsx index c159b42dd..32932fe2d 100644 --- a/src/components/StarterPack/ShareDialog.tsx +++ b/src/components/StarterPack/ShareDialog.tsx @@ -4,16 +4,18 @@ import {type AppBskyGraphDefs} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {useSaveImageToMediaLibrary} from '#/lib/media/save-image' import {shareUrl} from '#/lib/sharing' -import {logEvent} from '#/lib/statsig/statsig' import {getStarterPackOgCard} from '#/lib/strings/starter-pack' +import {logger} from '#/logger' import {isNative, isWeb} from '#/platform/detection' -import {atoms as a, useTheme} from '#/alf' -import {Button, ButtonText} from '#/components/Button' +import {atoms as a, useBreakpoints, useTheme} from '#/alf' +import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {type DialogControlProps} from '#/components/Dialog' import * as Dialog from '#/components/Dialog' +import {ChainLink_Stroke2_Corner0_Rounded as ChainLinkIcon} from '#/components/icons/ChainLink' +import {Download_Stroke2_Corner0_Rounded as DownloadIcon} from '#/components/icons/Download' +import {QrCode_Stroke2_Corner0_Rounded as QrCodeIcon} from '#/components/icons/QrCode' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' @@ -27,7 +29,9 @@ interface Props { export function ShareDialog(props: Props) { return ( - + @@ -43,14 +47,14 @@ function ShareDialogInner({ }: Props) { const {_} = useLingui() const t = useTheme() - const {isTabletOrDesktop} = useWebMediaQueries() + const {gtMobile} = useBreakpoints() const imageUrl = getStarterPackOgCard(starterPack) const onShareLink = async () => { if (!link) return shareUrl(link) - logEvent('starterPack:share', { + logger.metric('starterPack:share', { starterPack: starterPack.uri, shareType: 'link', }) @@ -67,12 +71,12 @@ function ShareDialogInner({ <> {!imageLoaded || !link ? ( - + ) : ( - - + + Invite people to this starter pack! @@ -89,8 +93,8 @@ function ShareDialogInner({ a.rounded_sm, { aspectRatio: 1200 / 630, - transform: [{scale: isTabletOrDesktop ? 0.85 : 1}], - marginTop: isTabletOrDesktop ? -20 : 0, + transform: [{scale: gtMobile ? 0.85 : 1}], + marginTop: gtMobile ? -20 : 0, }, ]} accessibilityIgnoresInvertColors={true} @@ -98,30 +102,33 @@ function ShareDialogInner({