Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -11,12 +11,11 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isAndroidWeb} from '#/lib/browser'
|
||||
import {IS_ANDROIDWeb} from '#/lib/browser'
|
||||
import {JOINED_THIS_WEEK} from '#/lib/constants'
|
||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
import {createStarterPackGooglePlayUri} from '#/lib/strings/starter-pack'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useStarterPackQuery} from '#/state/queries/starter-packs'
|
||||
import {
|
||||
@@ -38,6 +37,7 @@ import {Default as ProfileCard} from '#/components/ProfileCard'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import {RichText} from '#/components/RichText'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
||||
@@ -142,7 +142,7 @@ function LandingScreenLoaded({
|
||||
postAppClipMessage({
|
||||
action: 'present',
|
||||
})
|
||||
} else if (isAndroidWeb) {
|
||||
} else if (IS_ANDROIDWeb) {
|
||||
androidDialogControl.open()
|
||||
} else {
|
||||
onContinue()
|
||||
@@ -359,7 +359,7 @@ function LandingScreenLoaded({
|
||||
/>
|
||||
</Prompt.Actions>
|
||||
</Prompt.Outer>
|
||||
{isWeb && (
|
||||
{IS_WEB && (
|
||||
<meta
|
||||
name="apple-itunes-app"
|
||||
content="app-id=xyz.blueskyweb.app, app-clip-bundle-id=xyz.blueskyweb.app.AppClip, app-clip-display=card"
|
||||
|
||||
@@ -27,7 +27,6 @@ import {logEvent} from '#/lib/statsig/statsig'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {getStarterPackOgCard} from '#/lib/strings/starter-pack'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {updateProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {getAllListMembers} from '#/state/queries/list-members'
|
||||
@@ -72,6 +71,7 @@ import {ProfilesList} from '#/components/StarterPack/Main/ProfilesList'
|
||||
import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog'
|
||||
import {ShareDialog} from '#/components/StarterPack/ShareDialog'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
type StarterPackScreeProps = NativeStackScreenProps<
|
||||
@@ -608,21 +608,21 @@ function OverflowMenu({
|
||||
<Menu.Group>
|
||||
<Menu.Item
|
||||
label={
|
||||
isWeb
|
||||
IS_WEB
|
||||
? _(msg`Copy link to starter pack`)
|
||||
: _(msg`Share via...`)
|
||||
}
|
||||
testID="shareStarterPackLinkBtn"
|
||||
onPress={onOpenShareDialog}>
|
||||
<Menu.ItemText>
|
||||
{isWeb ? (
|
||||
{IS_WEB ? (
|
||||
<Trans>Copy link</Trans>
|
||||
) : (
|
||||
<Trans>Share via...</Trans>
|
||||
)}
|
||||
</Menu.ItemText>
|
||||
<Menu.ItemIcon
|
||||
icon={isWeb ? ChainLinkIcon : ArrowOutOfBoxIcon}
|
||||
icon={IS_WEB ? ChainLinkIcon : ArrowOutOfBoxIcon}
|
||||
position="right"
|
||||
/>
|
||||
</Menu.Item>
|
||||
|
||||
@@ -4,7 +4,6 @@ import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||
import {type AppBskyActorDefs, type ModerationOpts} from '@atproto/api'
|
||||
import {Trans} from '@lingui/macro'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useA11y} from '#/state/a11y'
|
||||
import {useActorAutocompleteQuery} from '#/state/queries/actor-autocomplete'
|
||||
import {useActorSearch} from '#/state/queries/actor-search'
|
||||
@@ -16,6 +15,7 @@ import {Loader} from '#/components/Loader'
|
||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
|
||||
function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
|
||||
@@ -89,7 +89,7 @@ export function StepProfiles({
|
||||
onEndReached={
|
||||
!query && !screenReaderEnabled ? () => fetchNextPage() : undefined
|
||||
}
|
||||
onEndReachedThreshold={isNative ? 2 : 0.25}
|
||||
onEndReachedThreshold={IS_NATIVE ? 2 : 0.25}
|
||||
keyboardDismissMode="on-drag"
|
||||
ListEmptyComponent={
|
||||
<View style={[a.flex_1, a.align_center, a.mt_lg, a.px_lg]}>
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
parseStarterPackUri,
|
||||
} from '#/lib/strings/starter-pack'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useAllListMembersQuery} from '#/state/queries/list-members'
|
||||
import {useProfileQuery} from '#/state/queries/profile'
|
||||
@@ -59,6 +58,7 @@ import {ListMaybePlaceholder} from '#/components/Lists'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
import {Provider} from './State'
|
||||
|
||||
@@ -435,7 +435,7 @@ function Footer({
|
||||
{
|
||||
paddingBottom: a.pb_lg.paddingBottom + bottomInset,
|
||||
},
|
||||
isNative && [
|
||||
IS_NATIVE && [
|
||||
a.border_l,
|
||||
a.border_r,
|
||||
t.atoms.shadow_md,
|
||||
@@ -601,7 +601,7 @@ function Footer({
|
||||
a.w_full,
|
||||
a.align_center,
|
||||
a.gap_2xl,
|
||||
isNative ? a.mt_sm : a.mt_md,
|
||||
IS_NATIVE ? a.mt_sm : a.mt_md,
|
||||
]}>
|
||||
{state.currentStep === 'Profiles' && items.length < 8 && (
|
||||
<Text
|
||||
|
||||
Reference in New Issue
Block a user