From b14d18821864c9daace8d4870db29a7018fdc754 Mon Sep 17 00:00:00 2001 From: shi.gg Date: Sun, 18 Jan 2026 19:01:54 +0000 Subject: [PATCH] fix: no more age assurance on top of https://tangled.org/jollywhoppers.com/witchsky.app/pulls/39 --- src/components/BlockedGeoOverlay.tsx | 196 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/state/preferences/country-code.tsx | 47 ----------------------------------------------- src/view/shell/index.tsx | 13 +++---------- src/view/shell/index.web.tsx | 13 +++---------- 4 file(s) changed, 6 insertion(s)(+), 263 deletion(s)(-) diff --git a/src/components/BlockedGeoOverlay.tsx b/src/components/BlockedGeoOverlay.tsx deleted file mode 100644 --- a/src/components/BlockedGeoOverlay.tsx +++ /dev/null @@ -1,196 +0,0 @@ -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 {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' -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' -import {IS_WEB} from '#/env' -import {useDeviceGeolocationApi} from '#/geolocation' - -export function BlockedGeoOverlay() { - const t = useTheme() - const {_} = useLingui() - const {gtPhone} = useBreakpoints() - const insets = useSafeAreaInsets() - const geoDialog = Dialog.useDialogControl() - const {setDeviceGeolocation} = useDeviceGeolocationApi() - - const enableSquareButtons = useEnableSquareButtons() - - 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} - - ))} - - - {!IS_WEB && ( - <> - - - - - - - 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. - */} - - - - ) -} diff --git a/src/state/preferences/country-code.tsx b/src/state/preferences/country-code.tsx deleted file mode 100644 --- a/src/state/preferences/country-code.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react' - -import * as persisted from '#/state/persisted' - -type StateContext = persisted.Schema['countryCode'] -type SetContext = (v: persisted.Schema['countryCode']) => void - -const stateContext = React.createContext( - persisted.defaults.countryCode, -) -const setContext = React.createContext( - (_: persisted.Schema['countryCode']) => {}, -) - -export function Provider({children}: React.PropsWithChildren<{}>) { - const [state, setState] = React.useState(persisted.get('countryCode')) - - const setStateWrapped = React.useCallback( - (countryCode: persisted.Schema['countryCode']) => { - setState(countryCode) - persisted.write('countryCode', countryCode) - }, - [setState], - ) - - React.useEffect(() => { - return persisted.onUpdate('countryCode', nextCountryCode => { - setState(nextCountryCode) - }) - }, [setStateWrapped]) - - return ( - - - {children} - - - ) -} - -export function useCountryCode() { - return React.useContext(stateContext) -} - -export function useSetCountryCode() { - return React.useContext(setContext) -} diff --git a/src/view/shell/index.tsx b/src/view/shell/index.tsx --- a/src/view/shell/index.tsx +++ b/src/view/shell/index.tsx @@ -39,8 +39,6 @@ usePolicyUpdateContext, } from '#/components/PolicyUpdateOverlay' import {Outlet as PortalOutlet} from '#/components/Portal' -import {useAgeAssurance} from '#/ageAssurance' -import {NoAccessScreen} from '#/ageAssurance/components/NoAccessScreen' import {RedirectOverlay} from '#/ageAssurance/components/RedirectOverlay' import {IS_ANDROID, IS_IOS} from '#/env' import {RoutesContainer, TabsNavigator} from '#/Navigation' @@ -207,7 +205,6 @@ export function Shell() { const t = useTheme() - const aa = useAgeAssurance() const {currentAccount} = useSession() const fullyExpandedCount = useDialogFullyExpandedCountContext() @@ -234,13 +231,9 @@ ) : ( <> - {aa.state.access === aa.Access.None ? ( - - ) : ( - - - - )} + + + diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -31,8 +31,6 @@ } from '#/components/PolicyUpdateOverlay' import {Outlet as PortalOutlet} from '#/components/Portal' import {WelcomeModal} from '#/components/WelcomeModal' -import {useAgeAssurance} from '#/ageAssurance' -import {NoAccessScreen} from '#/ageAssurance/components/NoAccessScreen' import {RedirectOverlay} from '#/ageAssurance/components/RedirectOverlay' import {FlatNavigator, RoutesContainer} from '#/Navigation' import {Composer} from './Composer.web' @@ -160,7 +158,6 @@ export function Shell() { const t = useTheme() - const aa = useAgeAssurance() const {currentAccount} = useSession() return ( @@ -170,13 +167,9 @@ ) : ( <> - {aa.state.access === aa.Access.None ? ( - - ) : ( - - - - )} + + + -- tangled.sh