Add AA const file to help with circular import
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
import {
|
||||||
|
ageAssuranceRuleIDs as ids,
|
||||||
|
type AppBskyAgeassuranceDefs,
|
||||||
|
} from '@atproto/api'
|
||||||
|
|
||||||
|
import {AgeAssuranceAccess} from '#/ageAssurance/types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimum age required to access the app at all.
|
||||||
|
*/
|
||||||
|
export const MIN_ACCESS_AGE = 13
|
||||||
|
|
||||||
|
export const FALLBACK_REGION_CONFIG: AppBskyAgeassuranceDefs.ConfigRegion = {
|
||||||
|
countryCode: '*',
|
||||||
|
regionCode: undefined,
|
||||||
|
minAccessAge: MIN_ACCESS_AGE,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
$type: ids.IfDeclaredOverAge,
|
||||||
|
age: MIN_ACCESS_AGE,
|
||||||
|
access: AgeAssuranceAccess.Full,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$type: ids.Default,
|
||||||
|
access: AgeAssuranceAccess.None,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -32,7 +32,6 @@ export {
|
|||||||
usePatchServerState as usePatchAgeAssuranceServerState,
|
usePatchServerState as usePatchAgeAssuranceServerState,
|
||||||
} from '#/ageAssurance/data'
|
} from '#/ageAssurance/data'
|
||||||
export {logger} from '#/ageAssurance/logger'
|
export {logger} from '#/ageAssurance/logger'
|
||||||
export {MIN_ACCESS_AGE} from '#/ageAssurance/util'
|
|
||||||
|
|
||||||
const AgeAssuranceStateContext = createContext<{
|
const AgeAssuranceStateContext = createContext<{
|
||||||
Access: typeof AgeAssuranceAccess
|
Access: typeof AgeAssuranceAccess
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {
|
import {
|
||||||
ageAssuranceRuleIDs as ids,
|
|
||||||
type AppBskyAgeassuranceDefs,
|
type AppBskyAgeassuranceDefs,
|
||||||
getAgeAssuranceRegionConfig,
|
getAgeAssuranceRegionConfig,
|
||||||
type ModerationPrefs,
|
type ModerationPrefs,
|
||||||
@@ -8,6 +7,7 @@ import {
|
|||||||
|
|
||||||
import {getAge} from '#/lib/strings/time'
|
import {getAge} from '#/lib/strings/time'
|
||||||
import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
|
import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
|
||||||
|
import {FALLBACK_REGION_CONFIG, MIN_ACCESS_AGE} from '#/ageAssurance/const'
|
||||||
import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data'
|
import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data'
|
||||||
import {
|
import {
|
||||||
AgeAssuranceAccess,
|
AgeAssuranceAccess,
|
||||||
@@ -17,24 +17,6 @@ import {
|
|||||||
} from '#/ageAssurance/types'
|
} from '#/ageAssurance/types'
|
||||||
import {type Geolocation, useGeolocation} from '#/geolocation'
|
import {type Geolocation, useGeolocation} from '#/geolocation'
|
||||||
|
|
||||||
export const MIN_ACCESS_AGE = 13
|
|
||||||
const FALLBACK_REGION_CONFIG: AppBskyAgeassuranceDefs.ConfigRegion = {
|
|
||||||
countryCode: '*',
|
|
||||||
regionCode: undefined,
|
|
||||||
minAccessAge: MIN_ACCESS_AGE,
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
$type: ids.IfDeclaredOverAge,
|
|
||||||
age: MIN_ACCESS_AGE,
|
|
||||||
access: AgeAssuranceAccess.Full,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$type: ids.Default,
|
|
||||||
access: AgeAssuranceAccess.None,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get age assurance region config based on geolocation, with fallback to
|
* Get age assurance region config based on geolocation, with fallback to
|
||||||
* app defaults if no region config is found.
|
* app defaults if no region config is found.
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ import {createStaticClick, SimpleInlineLinkText} from '#/components/Link'
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate'
|
import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate'
|
||||||
import * as Toast from '#/components/Toast'
|
import * as Toast from '#/components/Toast'
|
||||||
|
import {MIN_ACCESS_AGE} from '#/ageAssurance/const'
|
||||||
import {
|
import {
|
||||||
isUnderAge,
|
isUnderAge,
|
||||||
MIN_ACCESS_AGE,
|
|
||||||
useAgeAssuranceRegionConfigWithFallback,
|
useAgeAssuranceRegionConfigWithFallback,
|
||||||
} from '#/ageAssurance/util'
|
} from '#/ageAssurance/util'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
|
|||||||
Reference in New Issue
Block a user