import {View} from 'react-native' import {Image} from 'expo-image' import {type AppBskyGraphDefs} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useSaveImageToMediaLibrary} from '#/lib/media/save-image' import {shareUrl} from '#/lib/sharing' import {getStarterPackOgCard} from '#/lib/strings/starter-pack' import {logger} from '#/logger' import {isNative, isWeb} from '#/platform/detection' 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' interface Props { starterPack: AppBskyGraphDefs.StarterPackView link?: string imageLoaded?: boolean qrDialogControl: DialogControlProps control: DialogControlProps } export function ShareDialog(props: Props) { return ( ) } function ShareDialogInner({ starterPack, link, imageLoaded, qrDialogControl, control, }: Props) { const {_} = useLingui() const t = useTheme() const {gtMobile} = useBreakpoints() const imageUrl = getStarterPackOgCard(starterPack) const onShareLink = async () => { if (!link) return shareUrl(link) logger.metric('starterPack:share', { starterPack: starterPack.uri, shareType: 'link', }) control.close() } const saveImageToAlbum = useSaveImageToMediaLibrary() const onSave = async () => { await saveImageToAlbum(imageUrl) } return ( <> {!imageLoaded || !link ? ( ) : ( Invite people to this starter pack! Share this starter pack and help people join your community on Bluesky. {isNative && ( )} )} ) }