import {useEffect} from 'react' import {ScrollView, View} from 'react-native' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {logger} from '#/logger' import {isWeb} from '#/platform/detection' import {useDeviceGeolocationApi} from '#/state/geolocation' import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {DeviceLocationRequestDialog} from '#/components/dialogs/DeviceLocationRequestDialog' import {Divider} from '#/components/Divider' import {Full as Logo, Mark} from '#/components/icons/Logo' import {PinLocation_Stroke2_Corner0_Rounded as LocationIcon} from '#/components/icons/PinLocation' import {SimpleInlineLinkText as InlineLinkText} from '#/components/Link' import {Outlet as PortalOutlet} from '#/components/Portal' import * as Toast from '#/components/Toast' import {Text} from '#/components/Typography' import {BottomSheetOutlet} from '#/../modules/bottom-sheet' export function BlockedGeoOverlay() { const t = useTheme() const {_} = useLingui() const {gtPhone} = useBreakpoints() const insets = useSafeAreaInsets() const geoDialog = Dialog.useDialogControl() const {setDeviceGeolocation} = useDeviceGeolocationApi() useEffect(() => { // just counting overall hits here logger.metric(`blockedGeoOverlay:shown`, {}) }, []) const textStyles = [a.text_md, a.leading_normal] const links = { blog: { to: `https://bsky.social/about/blog/08-22-2025-mississippi-hb1126`, label: _(msg`Read our blog post`), overridePresentation: false, disableMismatchWarning: true, style: textStyles, }, } const blocks = [ _(msg`Unfortunately, Bluesky is unavailable in Mississippi right now.`), _( msg`A new Mississippi law requires us to implement age verification for all users before they can access Bluesky. We think this law creates challenges that go beyond its child safety goals, and creates significant barriers that limit free speech and disproportionately harm smaller platforms and emerging technologies.`, ), _( msg`As a small team, we cannot justify building the expensive infrastructure this requirement demands while legal challenges to this law are pending.`, ), _( msg`For now, we have made the difficult decision to block access to Bluesky in the state of Mississippi.`, ), <> To learn more, read our{' '} blog post. , ] return ( <> Announcement {blocks.map((block, index) => ( {block} ))} {!isWeb && ( <> Not in Mississippi? Confirm your location with GPS. Your location data is not tracked and does not leave your device. { if (props.geolocationStatus.isAgeBlockedGeo) { props.disableDialogAction() props.setDialogError( _( msg`We're sorry, but based on your device's location, you are currently located in a region where we cannot provide access at this time.`, ), ) } else { props.closeDialog(() => { // set this after close! setDeviceGeolocation({ countryCode: props.geolocationStatus.countryCode, regionCode: props.geolocationStatus.regionCode, }) Toast.show(_(msg`Thanks! You're all set.`), { type: 'success', }) }) } }} /> )} {/* * While this blocking overlay is up, other dialogs in the shell * are not mounted, so it _should_ be safe to use these here * without fear of other modals showing up. */} ) }