Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useBookmarkMutation} from '#/state/queries/bookmarks/useBookmarkMutation'
|
||||
import {useBookmarksQuery} from '#/state/queries/bookmarks/useBookmarksQuery'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
@@ -38,6 +37,7 @@ import {ListFooter} from '#/components/Lists'
|
||||
import * as Skele from '#/components/Skeleton'
|
||||
import * as toast from '#/components/Toast'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'Bookmarks'>
|
||||
|
||||
@@ -193,7 +193,7 @@ function BookmarksInner() {
|
||||
}
|
||||
initialNumToRender={initialNumToRender}
|
||||
windowSize={9}
|
||||
maxToRenderPerBatch={isIOS ? 5 : 1}
|
||||
maxToRenderPerBatch={IS_IOS ? 5 : 1}
|
||||
updateCellsBatchingPeriod={40}
|
||||
sideBorders={false}
|
||||
/>
|
||||
|
||||
@@ -7,7 +7,6 @@ import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {
|
||||
type SessionAccount,
|
||||
useAgent,
|
||||
@@ -24,6 +23,7 @@ import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/ico
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
const COL_WIDTH = 400
|
||||
|
||||
@@ -55,7 +55,7 @@ export function Deactivated() {
|
||||
}, [setShowLoggedOut])
|
||||
|
||||
const onPressLogout = React.useCallback(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// We're switching accounts, which remounts the entire app.
|
||||
// On mobile, this gets us Home, but on the web we also need reset the URL.
|
||||
// We can't change the URL via a navigate() call because the navigator
|
||||
@@ -101,8 +101,8 @@ export function Deactivated() {
|
||||
contentContainerStyle={[
|
||||
a.px_2xl,
|
||||
{
|
||||
paddingTop: isWeb ? 64 : insets.top + 16,
|
||||
paddingBottom: isWeb ? 64 : insets.bottom,
|
||||
paddingTop: IS_WEB ? 64 : insets.top + 16,
|
||||
paddingBottom: IS_WEB ? 64 : insets.bottom,
|
||||
},
|
||||
]}>
|
||||
<View
|
||||
|
||||
@@ -9,13 +9,13 @@ import {
|
||||
type AllNavigatorParams,
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
import {ErrorScreen} from '#/view/com/util/error/ErrorScreen'
|
||||
import {FindContactsFlow} from '#/components/contacts/FindContactsFlow'
|
||||
import {useFindContactsFlowState} from '#/components/contacts/state'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<AllNavigatorParams, 'FindContactsFlow'>
|
||||
export function FindContactsFlowScreen({navigation}: Props) {
|
||||
@@ -48,7 +48,7 @@ export function FindContactsFlowScreen({navigation}: Props) {
|
||||
|
||||
return (
|
||||
<Layout.Screen>
|
||||
{isNative ? (
|
||||
{IS_NATIVE ? (
|
||||
<LayoutAnimationConfig skipEntering skipExiting>
|
||||
<ScreenTransition key={state.step} direction={transitionDirection}>
|
||||
<FindContactsFlow
|
||||
|
||||
@@ -18,7 +18,6 @@ import {isNetworkError} from '#/lib/strings/errors'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {createFullHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useSetHasCheckedForStarterPack} from '#/state/preferences/used-starter-packs'
|
||||
import {useSessionApi} from '#/state/session'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
@@ -32,6 +31,7 @@ import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock'
|
||||
import {Ticket_Stroke2_Corner0_Rounded as Ticket} from '#/components/icons/Ticket'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {FormContainer} from './FormContainer'
|
||||
|
||||
type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
|
||||
@@ -201,7 +201,7 @@ export const LoginForm = ({
|
||||
inputRef={identifierRef}
|
||||
label={_(msg`Username or email address`)}
|
||||
autoCapitalize="none"
|
||||
autoFocus={!isIOS}
|
||||
autoFocus={!IS_IOS}
|
||||
autoCorrect={false}
|
||||
autoComplete="username"
|
||||
returnKeyType="next"
|
||||
|
||||
@@ -13,7 +13,6 @@ import {useRequireEmailVerification} from '#/lib/hooks/useRequireEmailVerificati
|
||||
import {type MessagesTabNavigatorParams} from '#/lib/routes/types'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {listenSoftReset} from '#/state/events'
|
||||
import {MESSAGE_SCREEN_POLL_INTERVAL} from '#/state/messages/convo/const'
|
||||
import {useMessagesEventBus} from '#/state/messages/events'
|
||||
@@ -38,6 +37,7 @@ import * as Layout from '#/components/Layout'
|
||||
import {Link} from '#/components/Link'
|
||||
import {ListFooter} from '#/components/Lists'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {ChatListItem} from './components/ChatListItem'
|
||||
import {InboxPreview} from './components/InboxPreview'
|
||||
|
||||
@@ -222,7 +222,7 @@ export function MessagesScreenInner({navigation, route}: Props) {
|
||||
|
||||
const onSoftReset = useCallback(async () => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: 0,
|
||||
})
|
||||
try {
|
||||
@@ -348,7 +348,7 @@ export function MessagesScreenInner({navigation, route}: Props) {
|
||||
hasNextPage={hasNextPage}
|
||||
/>
|
||||
}
|
||||
onEndReachedThreshold={isNative ? 1.5 : 0}
|
||||
onEndReachedThreshold={IS_NATIVE ? 1.5 : 0}
|
||||
initialNumToRender={initialNumToRender}
|
||||
windowSize={11}
|
||||
desktopFixedHeight
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
type CommonNavigatorParams,
|
||||
type NavigationProp,
|
||||
} from '#/lib/routes/types'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {type Shadow, useMaybeProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useEmail} from '#/state/email-verification'
|
||||
import {ConvoProvider, isConvoActive, useConvo} from '#/state/messages/convo'
|
||||
@@ -43,6 +42,7 @@ import {MessagesListHeader} from '#/components/dms/MessagesListHeader'
|
||||
import {Error} from '#/components/Error'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<
|
||||
CommonNavigatorParams,
|
||||
@@ -74,7 +74,7 @@ export function MessagesConversationScreenInner({route}: Props) {
|
||||
useCallback(() => {
|
||||
setCurrentConvoId(convoId)
|
||||
|
||||
if (isWeb && !gtMobile) {
|
||||
if (IS_WEB && !gtMobile) {
|
||||
setMinimalShellMode(true)
|
||||
} else {
|
||||
setMinimalShellMode(false)
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
} from '#/lib/routes/types'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {MESSAGE_SCREEN_POLL_INTERVAL} from '#/state/messages/convo/const'
|
||||
import {useMessagesEventBus} from '#/state/messages/events'
|
||||
import {useLeftConvos} from '#/state/queries/messages/leave-conversation'
|
||||
@@ -44,6 +43,7 @@ import {Message_Stroke2_Corner0_Rounded as MessageIcon} from '#/components/icons
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {ListFooter} from '#/components/Lists'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {RequestListItem} from './components/RequestListItem'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesInbox'>
|
||||
@@ -288,7 +288,7 @@ function RequestList({
|
||||
hasNextPage={hasNextPage}
|
||||
/>
|
||||
}
|
||||
onEndReachedThreshold={isNative ? 1.5 : 0}
|
||||
onEndReachedThreshold={IS_NATIVE ? 1.5 : 0}
|
||||
initialNumToRender={initialNumToRender}
|
||||
windowSize={11}
|
||||
desktopFixedHeight
|
||||
|
||||
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useUpdateActorDeclaration} from '#/state/queries/messages/actor-declaration'
|
||||
import {useProfileQuery} from '#/state/queries/profile'
|
||||
import {useSession} from '#/state/session'
|
||||
@@ -16,6 +15,7 @@ import {Divider} from '#/components/Divider'
|
||||
import * as Toggle from '#/components/forms/Toggle'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {useBackgroundNotificationPreferences} from '../../../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider'
|
||||
|
||||
type AllowIncoming = 'all' | 'none' | 'following'
|
||||
@@ -118,7 +118,7 @@ export function MessagesSettingsScreenInner({}: Props) {
|
||||
you choose.
|
||||
</Trans>
|
||||
</Admonition>
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<>
|
||||
<Divider style={a.my_md} />
|
||||
<Text style={[a.text_lg, a.font_semi_bold]}>
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
toBskyAppUrl,
|
||||
toShortUrl,
|
||||
} from '#/lib/strings/url-helpers'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {
|
||||
@@ -46,6 +45,7 @@ import {createPortalGroup} from '#/components/Portal'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useSimpleVerificationState} from '#/components/verification'
|
||||
import {VerificationCheck} from '#/components/verification/VerificationCheck'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
|
||||
export const ChatListItemPortal = createPortalGroup()
|
||||
@@ -366,7 +366,7 @@ function ChatListItemReady({
|
||||
)
|
||||
}
|
||||
accessibilityActions={
|
||||
isNative
|
||||
IS_NATIVE
|
||||
? [
|
||||
{
|
||||
name: 'magicTap',
|
||||
@@ -380,7 +380,7 @@ function ChatListItemReady({
|
||||
: undefined
|
||||
}
|
||||
onPress={onPress}
|
||||
onLongPress={isNative ? onLongPress : undefined}
|
||||
onLongPress={IS_NATIVE ? onLongPress : undefined}
|
||||
onAccessibilityAction={onLongPress}>
|
||||
{({hovered, pressed, focused}) => (
|
||||
<View
|
||||
@@ -519,7 +519,7 @@ function ChatListItemReady({
|
||||
control={menuControl}
|
||||
currentScreen="list"
|
||||
showMarkAsRead={convo.unreadCount > 0}
|
||||
hideTrigger={isNative}
|
||||
hideTrigger={IS_NATIVE}
|
||||
blockInfo={blockInfo}
|
||||
style={[
|
||||
a.absolute,
|
||||
|
||||
@@ -18,7 +18,6 @@ import {countGraphemes} from 'unicode-segmenter/grapheme'
|
||||
|
||||
import {HITSLOP_10, MAX_DM_GRAPHEME_LENGTH} from '#/lib/constants'
|
||||
import {useHaptics} from '#/lib/haptics'
|
||||
import {isIOS, isWeb} from '#/platform/detection'
|
||||
import {useEmail} from '#/state/email-verification'
|
||||
import {
|
||||
useMessageDraft,
|
||||
@@ -29,6 +28,7 @@ import * as Toast from '#/view/com/util/Toast'
|
||||
import {android, atoms as a, useTheme} from '#/alf'
|
||||
import {useSharedInputStyles} from '#/components/forms/TextField'
|
||||
import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane'
|
||||
import {IS_IOS, IS_WEB} from '#/env'
|
||||
import {useExtractEmbedFromFacets} from './MessageInputEmbed'
|
||||
|
||||
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput)
|
||||
@@ -84,10 +84,10 @@ export function MessageInput({
|
||||
playHaptic()
|
||||
setEmbed(undefined)
|
||||
setMessage('')
|
||||
if (isIOS) {
|
||||
if (IS_IOS) {
|
||||
setShouldEnforceClear(true)
|
||||
}
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// Pressing the send button causes the text input to lose focus, so we need to
|
||||
// re-focus it after sending
|
||||
setTimeout(() => {
|
||||
@@ -160,7 +160,7 @@ export function MessageInput({
|
||||
// next change and double make sure the input is cleared. It should *always* send an onChange event after
|
||||
// clearing via setMessage('') that happens in onSubmit()
|
||||
// -sfn
|
||||
if (isIOS && shouldEnforceClear) {
|
||||
if (IS_IOS && shouldEnforceClear) {
|
||||
setShouldEnforceClear(false)
|
||||
setMessage('')
|
||||
return
|
||||
@@ -175,7 +175,7 @@ export function MessageInput({
|
||||
a.px_sm,
|
||||
t.atoms.text,
|
||||
android({paddingTop: 0}),
|
||||
{paddingBottom: isIOS ? 5 : 0},
|
||||
{paddingBottom: IS_IOS ? 5 : 0},
|
||||
animatedStyle,
|
||||
]}
|
||||
keyboardAppearance={t.scheme}
|
||||
|
||||
@@ -24,8 +24,6 @@ import {
|
||||
isBskyPostUrl,
|
||||
} from '#/lib/strings/url-helpers'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {
|
||||
type ActiveConvoStates,
|
||||
isConvoActive,
|
||||
@@ -52,6 +50,8 @@ import {MessageItem} from '#/components/dms/MessageItem'
|
||||
import {NewMessagesPill} from '#/components/dms/NewMessagesPill'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {ChatStatusInfo} from './ChatStatusInfo'
|
||||
import {MessageInputEmbed, useMessageEmbed} from './MessageInputEmbed'
|
||||
|
||||
@@ -159,7 +159,7 @@ export function MessagesList({
|
||||
(_: number, height: number) => {
|
||||
// Because web does not have `maintainVisibleContentPosition` support, we will need to manually scroll to the
|
||||
// previous off whenever we add new content to the previous offset whenever we add new content to the list.
|
||||
if (isWeb && isAtTop.get() && hasScrolled) {
|
||||
if (IS_WEB && isAtTop.get() && hasScrolled) {
|
||||
flatListRef.current?.scrollToOffset({
|
||||
offset: height - prevContentHeight.current,
|
||||
animated: false,
|
||||
@@ -390,7 +390,7 @@ export function MessagesList({
|
||||
(e: LayoutChangeEvent) => {
|
||||
layoutHeight.set(e.nativeEvent.layout.height)
|
||||
|
||||
if (isWeb || !keyboardIsOpening.get()) {
|
||||
if (IS_WEB || !keyboardIsOpening.get()) {
|
||||
flatListRef.current?.scrollToEnd({
|
||||
animated: !layoutScrollWithoutAnimation.get(),
|
||||
})
|
||||
@@ -429,8 +429,8 @@ export function MessagesList({
|
||||
disableVirtualization={true}
|
||||
style={animatedListStyle}
|
||||
// The extra two items account for the header and the footer components
|
||||
initialNumToRender={isNative ? 32 : 62}
|
||||
maxToRenderPerBatch={isWeb ? 32 : 62}
|
||||
initialNumToRender={IS_NATIVE ? 32 : 62}
|
||||
maxToRenderPerBatch={IS_WEB ? 32 : 62}
|
||||
keyboardDismissMode="on-drag"
|
||||
keyboardShouldPersistTaps="handled"
|
||||
maintainVisibleContentPosition={{
|
||||
@@ -468,7 +468,7 @@ export function MessagesList({
|
||||
)}
|
||||
</Animated.View>
|
||||
|
||||
{isWeb && (
|
||||
{IS_WEB && (
|
||||
<EmojiPicker
|
||||
pinToTop
|
||||
state={emojiPickerState}
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useIsBirthdateUpdateAllowed} from '#/state/birthdate'
|
||||
import {
|
||||
useMyLabelersQuery,
|
||||
@@ -45,6 +44,7 @@ import {Loader} from '#/components/Loader'
|
||||
import {GlobalLabelPreference} from '#/components/moderation/LabelPreference'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useAgeAssurance} from '#/ageAssurance'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
function ErrorState({error}: {error: string}) {
|
||||
const t = useTheme()
|
||||
@@ -182,7 +182,7 @@ export function ModerationScreenInner({
|
||||
(optimisticAdultContent && optimisticAdultContent.enabled) ||
|
||||
(!optimisticAdultContent && preferences.moderationPrefs.adultContentEnabled)
|
||||
)
|
||||
const adultContentUIDisabledOnIOS = isIOS && !adultContentEnabled
|
||||
const adultContentUIDisabledOnIOS = IS_IOS && !adultContentEnabled
|
||||
let adultContentUIDisabled = adultContentUIDisabledOnIOS
|
||||
|
||||
if (aa.flags.adultContentDisabled) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isAndroid, isWeb} from '#/platform/detection'
|
||||
import {useOnboardingDispatch} from '#/state/shell'
|
||||
import {useOnboardingInternalState} from '#/screens/Onboarding/state'
|
||||
import {
|
||||
@@ -21,6 +20,7 @@ import {ArrowLeft_Stroke2_Corner0_Rounded as ArrowLeft} from '#/components/icons
|
||||
import {HEADER_SLOT_SIZE} from '#/components/Layout'
|
||||
import {createPortalGroup} from '#/components/Portal'
|
||||
import {P, Text} from '#/components/Typography'
|
||||
import {IS_ANDROID, IS_WEB} from '#/env'
|
||||
import {IS_INTERNAL} from '#/env'
|
||||
|
||||
const ONBOARDING_COL_WIDTH = 420
|
||||
@@ -58,7 +58,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
|
||||
aria-label={dialogLabel}
|
||||
accessibilityLabel={dialogLabel}
|
||||
accessibilityHint={_(msg`Customizes your Bluesky experience`)}
|
||||
style={[isWeb ? a.fixed : a.absolute, a.inset_0, a.flex_1, t.atoms.bg]}>
|
||||
style={[IS_WEB ? a.fixed : a.absolute, a.inset_0, a.flex_1, t.atoms.bg]}>
|
||||
{!gtMobile ? (
|
||||
<View
|
||||
style={[
|
||||
@@ -151,7 +151,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
|
||||
paddingTop: gtMobile ? 40 : headerHeight,
|
||||
paddingBottom: footerHeight,
|
||||
}}
|
||||
showsVerticalScrollIndicator={!isAndroid}
|
||||
showsVerticalScrollIndicator={!IS_ANDROID}
|
||||
scrollIndicatorInsets={{bottom: footerHeight - insets.bottom}}
|
||||
// @ts-expect-error web only --prf
|
||||
dataSet={{'stable-gutters': 1}}
|
||||
@@ -167,14 +167,14 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
|
||||
<View
|
||||
onLayout={evt => setFooterHeight(evt.nativeEvent.layout.height)}
|
||||
style={[
|
||||
isWeb ? a.fixed : a.absolute,
|
||||
IS_WEB ? a.fixed : a.absolute,
|
||||
{bottom: 0, left: 0, right: 0},
|
||||
t.atoms.bg,
|
||||
t.atoms.border_contrast_low,
|
||||
a.border_t,
|
||||
a.align_center,
|
||||
gtMobile ? a.px_5xl : a.px_xl,
|
||||
isWeb
|
||||
IS_WEB
|
||||
? a.py_2xl
|
||||
: {
|
||||
paddingTop: tokens.space.md,
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
||||
import {logEvent, useGate} from '#/lib/statsig/statsig'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useSetHasCheckedForStarterPack} from '#/state/preferences/used-starter-packs'
|
||||
import {getAllListMembers} from '#/state/queries/list-members'
|
||||
import {preferencesQueryKey} from '#/state/queries/preferences'
|
||||
@@ -47,6 +46,7 @@ import {atoms as a, useBreakpoints} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {ArrowRight_Stroke2_Corner0_Rounded as ArrowRight} from '#/components/icons/Arrow'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {IS_WEB} from '#/env'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {ValuePropositionPager} from './ValuePropositionPager'
|
||||
|
||||
@@ -305,7 +305,7 @@ function ValueProposition({
|
||||
|
||||
<OnboardingControls.Portal>
|
||||
<View style={gtMobile && [a.gap_md, a.flex_row]}>
|
||||
{gtMobile && (isWeb ? subStep !== 2 : true) && (
|
||||
{gtMobile && (IS_WEB ? subStep !== 2 : true) && (
|
||||
<Button
|
||||
disabled={saving}
|
||||
color="secondary"
|
||||
|
||||
@@ -17,7 +17,6 @@ import {useRequestNotificationsPermission} from '#/lib/notifications/notificatio
|
||||
import {logEvent, useGate} from '#/lib/statsig/statsig'
|
||||
import {isCancelledError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative, isWeb} from '#/platform/detection'
|
||||
import {
|
||||
OnboardingControls,
|
||||
OnboardingDescriptionText,
|
||||
@@ -38,6 +37,7 @@ import * as Dialog from '#/components/Dialog'
|
||||
import {useSheetWrapper} from '#/components/Dialog/sheet-wrapper'
|
||||
import {CircleInfo_Stroke2_Corner0_Rounded} from '#/components/icons/CircleInfo'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE, IS_WEB} from '#/env'
|
||||
import {type AvatarColor, avatarColors, type Emoji, emojiItems} from './types'
|
||||
|
||||
export interface Avatar {
|
||||
@@ -183,7 +183,7 @@ export function StepProfile() {
|
||||
let image = items[0]
|
||||
if (!image) return
|
||||
|
||||
if (!isWeb) {
|
||||
if (!IS_WEB) {
|
||||
try {
|
||||
image = await openCropper({
|
||||
imageUri: image.path,
|
||||
@@ -200,7 +200,7 @@ export function StepProfile() {
|
||||
|
||||
// If we are on mobile, prefetching the image will load the image into memory before we try and display it,
|
||||
// stopping any brief flickers.
|
||||
if (isNative) {
|
||||
if (IS_NATIVE) {
|
||||
await ExpoImage.prefetch(image.path)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import {wait} from '#/lib/async/wait'
|
||||
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
||||
import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {updateProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useLanguagePrefs} from '#/state/preferences'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
@@ -31,6 +30,7 @@ import {boostInterests, InterestTabs} from '#/components/InterestTabs'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import * as ProfileCard from '#/components/ProfileCard'
|
||||
import * as toast from '#/components/Toast'
|
||||
import {IS_WEB} from '#/env'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
import {bulkWriteFollows} from '../util'
|
||||
|
||||
@@ -161,7 +161,7 @@ export function StepSuggestedAccounts() {
|
||||
style={[
|
||||
a.overflow_hidden,
|
||||
a.mt_sm,
|
||||
isWeb
|
||||
IS_WEB
|
||||
? [a.max_w_full, web({minHeight: '100vh'})]
|
||||
: {marginHorizontal: tokens.space.xl * -1},
|
||||
a.flex_1,
|
||||
@@ -213,7 +213,7 @@ export function StepSuggestedAccounts() {
|
||||
a.mt_md,
|
||||
a.border_y,
|
||||
t.atoms.border_contrast_low,
|
||||
isWeb && [a.border_x, a.rounded_sm, a.overflow_hidden],
|
||||
IS_WEB && [a.border_x, a.rounded_sm, a.overflow_hidden],
|
||||
]}>
|
||||
{suggestedUsers?.actors.map((user, index) => (
|
||||
<SuggestedProfileCard
|
||||
@@ -324,7 +324,7 @@ function TabBar({
|
||||
...interestsDisplayNames,
|
||||
}
|
||||
}
|
||||
gutterWidth={isWeb ? 0 : tokens.space.xl}
|
||||
gutterWidth={IS_WEB ? 0 : tokens.space.xl}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -350,7 +350,7 @@ function SuggestedProfileCard({
|
||||
const node = cardRef.current
|
||||
if (!node || hasTrackedRef.current) return
|
||||
|
||||
if (isWeb && typeof IntersectionObserver !== 'undefined') {
|
||||
if (IS_WEB && typeof IntersectionObserver !== 'undefined') {
|
||||
const observer = new IntersectionObserver(
|
||||
entries => {
|
||||
if (entries[0]?.isIntersecting && !hasTrackedRef.current) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as bcp47Match from 'bcp-47-match'
|
||||
|
||||
import {useEnableKeyboardControllerScreen} from '#/lib/hooks/useEnableKeyboardController'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useLanguagePrefs} from '#/state/preferences'
|
||||
import {
|
||||
Layout,
|
||||
@@ -24,6 +23,7 @@ import {useIsFindContactsFeatureEnabledBasedOnGeolocation} from '#/components/co
|
||||
import {useFindContactsFlowState} from '#/components/contacts/state'
|
||||
import {Portal} from '#/components/Portal'
|
||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {ENV} from '#/env'
|
||||
import {StepFindContacts} from './StepFindContacts'
|
||||
import {StepFindContactsIntro} from './StepFindContactsIntro'
|
||||
@@ -50,7 +50,7 @@ export function Onboarding() {
|
||||
useIsFindContactsFeatureEnabledBasedOnGeolocation()
|
||||
const showFindContacts =
|
||||
ENV !== 'e2e' &&
|
||||
isNative &&
|
||||
IS_NATIVE &&
|
||||
findContactsEnabled &&
|
||||
!gate('disable_onboarding_find_contacts')
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ import {View} from 'react-native'
|
||||
import {PrivacySensitive} from 'expo-privacy-sensitive'
|
||||
|
||||
import {useAppState} from '#/lib/hooks/useAppState'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {sizes as iconSizes} from '#/components/icons/common'
|
||||
import {Mark as Logo} from '#/components/icons/Logo'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
const ICON_SIZE = 'xl' as const
|
||||
|
||||
@@ -25,7 +25,7 @@ export function GrowthHack({
|
||||
|
||||
const appState = useAppState()
|
||||
|
||||
if (!isIOS || appState !== 'active') return children
|
||||
if (!IS_IOS || appState !== 'active') return children
|
||||
|
||||
return (
|
||||
<View
|
||||
|
||||
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {
|
||||
useProfileFollowMutationQueue,
|
||||
@@ -17,10 +16,11 @@ import {atoms as a, useBreakpoints} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {Check_Stroke2_Corner0_Rounded as CheckIcon} from '#/components/icons/Check'
|
||||
import {PlusLarge_Stroke2_Corner0_Rounded as PlusIcon} from '#/components/icons/Plus'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {GrowthHack} from './GrowthHack'
|
||||
|
||||
export function ThreadItemAnchorFollowButton({did}: {did: string}) {
|
||||
if (isIOS) {
|
||||
if (IS_IOS) {
|
||||
return (
|
||||
<GrowthHack>
|
||||
<ThreadItemAnchorFollowButtonInner did={did} />
|
||||
|
||||
@@ -7,8 +7,8 @@ import Animated, {
|
||||
} from 'react-native-reanimated'
|
||||
import type React from 'react'
|
||||
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {usePagerHeaderContext} from '#/view/com/pager/PagerHeaderContext'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
export function GrowableAvatar({
|
||||
children,
|
||||
@@ -20,7 +20,7 @@ export function GrowableAvatar({
|
||||
const pagerContext = usePagerHeaderContext()
|
||||
|
||||
// pagerContext should only be present on iOS, but better safe than sorry
|
||||
if (!pagerContext || !isIOS) {
|
||||
if (!pagerContext || !IS_IOS) {
|
||||
return <View style={style}>{children}</View>
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ import {BlurView} from 'expo-blur'
|
||||
import {useIsFetching} from '@tanstack/react-query'
|
||||
import type React from 'react'
|
||||
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {RQKEY_ROOT as STARTERPACK_RQKEY_ROOT} from '#/state/queries/actor-starter-packs'
|
||||
import {RQKEY_ROOT as FEED_RQKEY_ROOT} from '#/state/queries/post-feed'
|
||||
import {RQKEY_ROOT as FEEDGEN_RQKEY_ROOT} from '#/state/queries/profile-feedgens'
|
||||
import {RQKEY_ROOT as LIST_RQKEY_ROOT} from '#/state/queries/profile-lists'
|
||||
import {usePagerHeaderContext} from '#/view/com/pager/PagerHeaderContext'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
const AnimatedBlurView = Animated.createAnimatedComponent(BlurView)
|
||||
|
||||
@@ -39,7 +39,7 @@ export function GrowableBanner({
|
||||
const pagerContext = usePagerHeaderContext()
|
||||
|
||||
// plain non-growable mode for Android/Web
|
||||
if (!pagerContext || !isIOS) {
|
||||
if (!pagerContext || !IS_IOS) {
|
||||
return (
|
||||
<Pressable
|
||||
onPress={onPress}
|
||||
@@ -164,7 +164,7 @@ function GrowableBannerInner({
|
||||
style={[
|
||||
a.absolute,
|
||||
a.inset_0,
|
||||
{top: topInset - (isIOS ? 15 : 0)},
|
||||
{top: topInset - (IS_IOS ? 15 : 0)},
|
||||
a.justify_center,
|
||||
a.align_center,
|
||||
]}>
|
||||
|
||||
@@ -4,11 +4,11 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {isIOS, isNative} from '#/platform/detection'
|
||||
import {type Shadow} from '#/state/cache/types'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {NewskieDialog} from '#/components/NewskieDialog'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS, IS_NATIVE} from '#/env'
|
||||
|
||||
export function ProfileHeaderHandle({
|
||||
profile,
|
||||
@@ -24,7 +24,7 @@ export function ProfileHeaderHandle({
|
||||
return (
|
||||
<View
|
||||
style={[a.flex_row, a.gap_sm, a.align_center, {maxWidth: '100%'}]}
|
||||
pointerEvents={disableTaps ? 'none' : isIOS ? 'auto' : 'box-none'}>
|
||||
pointerEvents={disableTaps ? 'none' : IS_IOS ? 'auto' : 'box-none'}>
|
||||
<NewskieDialog profile={profile} disabled={disableTaps} />
|
||||
{profile.viewer?.followedBy && !blockHide ? (
|
||||
<View style={[t.atoms.bg_contrast_50, a.rounded_xs, a.px_sm, a.py_xs]}>
|
||||
@@ -59,7 +59,7 @@ export function ProfileHeaderHandle({
|
||||
profile.handle,
|
||||
'@',
|
||||
// forceLTR handled by CSS above on web
|
||||
isNative,
|
||||
IS_NATIVE,
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -15,7 +15,6 @@ import {MAX_LABELERS} from '#/lib/constants'
|
||||
import {useHaptics} from '#/lib/haptics'
|
||||
import {isAppLabeler} from '#/lib/moderation'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {type Shadow} from '#/state/cache/types'
|
||||
import {useLabelerSubscriptionMutation} from '#/state/queries/labeler'
|
||||
@@ -35,6 +34,7 @@ import * as Prompt from '#/components/Prompt'
|
||||
import {RichText} from '#/components/RichText'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {ProfileHeaderDisplayName} from './DisplayName'
|
||||
import {EditProfileDialog} from './EditProfileDialog'
|
||||
import {ProfileHeaderHandle} from './Handle'
|
||||
@@ -111,10 +111,10 @@ let ProfileHeaderLabeler = ({
|
||||
isPlaceholderProfile={isPlaceholderProfile}>
|
||||
<View
|
||||
style={[a.px_lg, a.pt_md, a.pb_sm]}
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}>
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}>
|
||||
<View
|
||||
style={[a.flex_row, a.justify_end, a.align_center, a.gap_xs, a.pb_lg]}
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}>
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}>
|
||||
<HeaderLabelerButtons profile={profile} />
|
||||
</View>
|
||||
<View style={[a.flex_col, a.gap_2xs, a.pt_2xs, a.pb_md]}>
|
||||
|
||||
@@ -15,7 +15,6 @@ import {useHaptics} from '#/lib/haptics'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {type Shadow, useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {
|
||||
useProfileBlockMutationQueue,
|
||||
@@ -39,6 +38,7 @@ import {RichText} from '#/components/RichText'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {VerificationCheckButton} from '#/components/verification/VerificationCheckButton'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {EditProfileDialog} from './EditProfileDialog'
|
||||
import {ProfileHeaderHandle} from './Handle'
|
||||
import {ProfileHeaderMetrics} from './Metrics'
|
||||
@@ -103,7 +103,7 @@ let ProfileHeaderStandard = ({
|
||||
isPlaceholderProfile={isPlaceholderProfile}>
|
||||
<View
|
||||
style={[a.px_lg, a.pt_md, a.pb_sm, a.overflow_hidden]}
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}>
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}>
|
||||
<View
|
||||
style={[
|
||||
{paddingLeft: 90},
|
||||
@@ -114,7 +114,7 @@ let ProfileHeaderStandard = ({
|
||||
a.pb_sm,
|
||||
a.flex_wrap,
|
||||
]}
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}>
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}>
|
||||
<HeaderStandardButtons
|
||||
profile={profile}
|
||||
moderation={moderation}
|
||||
|
||||
@@ -19,7 +19,6 @@ import {BACK_HITSLOP} from '#/lib/constants'
|
||||
import {useHaptics} from '#/lib/haptics'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {type Shadow} from '#/state/cache/types'
|
||||
import {useLightboxControls} from '#/state/lightbox'
|
||||
import {useSession} from '#/state/session'
|
||||
@@ -35,6 +34,7 @@ import {LiveIndicator} from '#/components/live/LiveIndicator'
|
||||
import {LiveStatusDialog} from '#/components/live/LiveStatusDialog'
|
||||
import {LabelsOnMe} from '#/components/moderation/LabelsOnMe'
|
||||
import {ProfileHeaderAlerts} from '#/components/moderation/ProfileHeaderAlerts'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {GrowableAvatar} from './GrowableAvatar'
|
||||
import {GrowableBanner} from './GrowableBanner'
|
||||
import {StatusBarShadow} from './StatusBarShadow'
|
||||
@@ -167,9 +167,9 @@ let ProfileHeaderShell = ({
|
||||
}, [profile.banner, moderation, _openLightbox, bannerRef])
|
||||
|
||||
return (
|
||||
<View style={t.atoms.bg} pointerEvents={isIOS ? 'auto' : 'box-none'}>
|
||||
<View style={t.atoms.bg} pointerEvents={IS_IOS ? 'auto' : 'box-none'}>
|
||||
<View
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}
|
||||
style={[a.relative, {height: 150}]}>
|
||||
<StatusBarShadow />
|
||||
<GrowableBanner
|
||||
@@ -244,7 +244,7 @@ let ProfileHeaderShell = ({
|
||||
a.px_lg,
|
||||
a.pt_xs,
|
||||
a.pb_sm,
|
||||
isIOS ? a.pointer_events_auto : {pointerEvents: 'box-none'},
|
||||
IS_IOS ? a.pointer_events_auto : {pointerEvents: 'box-none'},
|
||||
]}
|
||||
/>
|
||||
) : (
|
||||
@@ -254,7 +254,7 @@ let ProfileHeaderShell = ({
|
||||
a.px_lg,
|
||||
a.pt_xs,
|
||||
a.pb_sm,
|
||||
isIOS ? a.pointer_events_auto : {pointerEvents: 'box-none'},
|
||||
IS_IOS ? a.pointer_events_auto : {pointerEvents: 'box-none'},
|
||||
]}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -5,9 +5,9 @@ import Animated, {
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import {LinearGradient} from 'expo-linear-gradient'
|
||||
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {usePagerHeaderContext} from '#/view/com/pager/PagerHeaderContext'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
const AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient)
|
||||
|
||||
@@ -15,7 +15,7 @@ export function StatusBarShadow() {
|
||||
const {top: topInset} = useSafeAreaInsets()
|
||||
const pagerContext = usePagerHeaderContext()
|
||||
|
||||
if (isIOS && pagerContext) {
|
||||
if (IS_IOS && pagerContext) {
|
||||
const {scrollY} = pagerContext
|
||||
return <StatusBarShadowInnner scrollY={scrollY} />
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from 'react'
|
||||
import {type AppBskyActorDefs} from '@atproto/api'
|
||||
|
||||
import {AccordionAnimation} from '#/lib/custom-animations/AccordionAnimation'
|
||||
import {isAndroid} from '#/platform/detection'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {
|
||||
useSuggestedFollowsByActorQuery,
|
||||
@@ -10,6 +9,7 @@ import {
|
||||
} from '#/state/queries/suggested-follows'
|
||||
import {useBreakpoints} from '#/alf'
|
||||
import {ProfileGrid} from '#/components/FeedInterstitials'
|
||||
import {IS_ANDROID} from '#/env'
|
||||
|
||||
const DISMISS_ANIMATION_DURATION = 200
|
||||
|
||||
@@ -210,7 +210,7 @@ export function AnimatedProfileHeaderSuggestedFollows({
|
||||
* This issue stems from Android not allowing dragging on clickable elements in the profile header.
|
||||
* Blocking the ability to scroll on Android is too much of a trade-off for now.
|
||||
**/
|
||||
if (isAndroid) return null
|
||||
if (IS_ANDROID) return null
|
||||
|
||||
return (
|
||||
<AccordionAnimation isExpanded={isExpanded}>
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
import {useIsFocused} from '@react-navigation/native'
|
||||
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useSetLightStatusBar} from '#/state/shell/light-status-bar'
|
||||
@@ -26,6 +25,7 @@ import {LoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Header} from '#/components/Layout'
|
||||
import * as ProfileCard from '#/components/ProfileCard'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {
|
||||
HeaderLabelerButtons,
|
||||
ProfileHeaderLabeler,
|
||||
@@ -83,7 +83,7 @@ let ProfileHeader = ({setMinimumHeight, ...props}: Props): React.ReactNode => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<MinimalHeader
|
||||
onLayout={evt => setMinimumHeight(evt.nativeEvent.layout.height)}
|
||||
profile={props.profile}
|
||||
|
||||
@@ -17,7 +17,6 @@ import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {makeRecordUri} from '#/lib/strings/url-helpers'
|
||||
import {s} from '#/lib/styles'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {listenSoftReset} from '#/state/events'
|
||||
import {FeedFeedbackProvider, useFeedFeedback} from '#/state/feed-feedback'
|
||||
import {
|
||||
@@ -47,6 +46,7 @@ import {
|
||||
} from '#/screens/Profile/components/ProfileFeedHeader'
|
||||
import {HashtagWide_Stroke1_Corner0_Rounded as HashtagWideIcon} from '#/components/icons/Hashtag'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileFeed'>
|
||||
export function ProfileFeedScreen(props: Props) {
|
||||
@@ -175,7 +175,7 @@ export function ProfileFeedScreenInner({
|
||||
|
||||
const onScrollToTop = useCallback(() => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: 0, // -headerHeight,
|
||||
})
|
||||
truncateAndInvalidate(queryClient, FEED_RQKEY(feed))
|
||||
@@ -204,7 +204,7 @@ export function ProfileFeedScreenInner({
|
||||
const feedIsVideoMode =
|
||||
feedInfo.contentMode === AppBskyFeedDefs.CONTENTMODEVIDEO
|
||||
const _isVideoFeed = isBskyVideoFeed || feedIsVideoMode
|
||||
return isNative && _isVideoFeed
|
||||
return IS_NATIVE && _isVideoFeed
|
||||
}, [feedInfo])
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||
import {isIOS, isNative} from '#/platform/detection'
|
||||
import {
|
||||
type FeedDescriptor,
|
||||
RQKEY as FEED_RQKEY,
|
||||
@@ -21,6 +20,7 @@ import {LoadLatestBtn} from '#/view/com/util/load-latest/LoadLatestBtn'
|
||||
import {atoms as a, ios, useTheme} from '#/alf'
|
||||
import {EditBig_Stroke1_Corner0_Rounded as EditIcon} from '#/components/icons/EditBig'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS, IS_NATIVE} from '#/env'
|
||||
import {type SectionRef} from './types'
|
||||
|
||||
interface FeedSectionProps {
|
||||
@@ -53,13 +53,13 @@ export function ProfileFeedSection({
|
||||
const [hasNew, setHasNew] = useState(false)
|
||||
const [isScrolledDown, setIsScrolledDown] = useState(false)
|
||||
const shouldUseAdjustedNumToRender = feed.endsWith('posts_and_author_threads')
|
||||
const isVideoFeed = isNative && feed.endsWith('posts_with_video')
|
||||
const isVideoFeed = IS_NATIVE && feed.endsWith('posts_with_video')
|
||||
const adjustedInitialNumToRender = useInitialNumToRender({
|
||||
screenHeightOffset: headerHeight,
|
||||
})
|
||||
const onScrollToTop = useCallback(() => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: -headerHeight,
|
||||
})
|
||||
truncateAndInvalidate(queryClient, FEED_RQKEY(feed))
|
||||
@@ -85,7 +85,7 @@ export function ProfileFeedSection({
|
||||
}, [_, emptyStateButton, emptyStateIcon, emptyStateMessage])
|
||||
|
||||
useEffect(() => {
|
||||
if (isIOS && isFocused && scrollElRef.current) {
|
||||
if (IS_IOS && isFocused && scrollElRef.current) {
|
||||
const nativeTag = findNodeHandle(scrollElRef.current)
|
||||
setScrollViewTag(nativeTag)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isLabelerSubscribed, lookupLabelValueDefinition} from '#/lib/moderation'
|
||||
import {isIOS, isNative} from '#/platform/detection'
|
||||
import {List, type ListRef} from '#/view/com/util/List'
|
||||
import {atoms as a, ios, tokens, useTheme} from '#/alf'
|
||||
import {Divider} from '#/components/Divider'
|
||||
@@ -19,6 +18,7 @@ import {ListFooter} from '#/components/Lists'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {LabelerLabelPreference} from '#/components/moderation/LabelPreference'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_IOS, IS_NATIVE} from '#/env'
|
||||
import {ErrorState} from '../ErrorState'
|
||||
import {type SectionRef} from './types'
|
||||
|
||||
@@ -49,7 +49,7 @@ export function ProfileLabelsSection({
|
||||
|
||||
const onScrollToTop = useCallback(() => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: -headerHeight,
|
||||
})
|
||||
}, [scrollElRef, headerHeight])
|
||||
@@ -59,7 +59,7 @@ export function ProfileLabelsSection({
|
||||
}))
|
||||
|
||||
useEffect(() => {
|
||||
if (isIOS && isFocused && scrollElRef.current) {
|
||||
if (IS_IOS && isFocused && scrollElRef.current) {
|
||||
const nativeTag = findNodeHandle(scrollElRef.current)
|
||||
setScrollViewTag(nativeTag)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import {shareUrl} from '#/lib/sharing'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {type FeedSourceFeedInfo} from '#/state/queries/feed'
|
||||
import {useLikeMutation, useUnlikeMutation} from '#/state/queries/like'
|
||||
import {
|
||||
@@ -52,6 +51,7 @@ import {
|
||||
} from '#/components/moderation/ReportDialog'
|
||||
import {RichText} from '#/components/RichText'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
export function ProfileFeedHeaderSkeleton() {
|
||||
const t = useTheme()
|
||||
@@ -192,7 +192,7 @@ export function ProfileFeedHeader({info}: {info: FeedSourceFeedInfo}) {
|
||||
style={[
|
||||
a.justify_start,
|
||||
{
|
||||
paddingVertical: isWeb ? 2 : 4,
|
||||
paddingVertical: IS_WEB ? 2 : 4,
|
||||
paddingRight: 8,
|
||||
},
|
||||
]}
|
||||
@@ -211,7 +211,7 @@ export function ProfileFeedHeader({info}: {info: FeedSourceFeedInfo}) {
|
||||
t.atoms.bg_contrast_25,
|
||||
{
|
||||
opacity: 0,
|
||||
left: isWeb ? -2 : -4,
|
||||
left: IS_WEB ? -2 : -4,
|
||||
right: 0,
|
||||
},
|
||||
pressed && {
|
||||
|
||||
@@ -4,7 +4,6 @@ import {type AppBskyGraphDefs} from '@atproto/api'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useSession} from '#/state/session'
|
||||
import {ListMembers} from '#/view/com/lists/ListMembers'
|
||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||
@@ -14,6 +13,7 @@ import {atoms as a, useBreakpoints} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {BulletList_Stroke1_Corner0_Rounded as ListIcon} from '#/components/icons/BulletList'
|
||||
import {PersonPlus_Stroke2_Corner0_Rounded as PersonPlusIcon} from '#/components/icons/Person'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
interface SectionRef {
|
||||
scrollToTop: () => void
|
||||
@@ -42,7 +42,7 @@ export function AboutSection({
|
||||
|
||||
const onScrollToTop = useCallback(() => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: -headerHeight,
|
||||
})
|
||||
}, [scrollElRef, headerHeight])
|
||||
|
||||
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {useIsFocused} from '@react-navigation/native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {listenSoftReset} from '#/state/events'
|
||||
import {
|
||||
type FeedDescriptor,
|
||||
@@ -19,6 +18,7 @@ import {atoms as a} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {HashtagWide_Stroke1_Corner0_Rounded as HashtagWideIcon} from '#/components/icons/Hashtag'
|
||||
import {PersonPlus_Stroke2_Corner0_Rounded as PersonPlusIcon} from '#/components/icons/Person'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
interface SectionRef {
|
||||
scrollToTop: () => void
|
||||
@@ -51,7 +51,7 @@ export function FeedSection({
|
||||
|
||||
const onScrollToTop = useCallback(() => {
|
||||
scrollElRef.current?.scrollToOffset({
|
||||
animated: isNative,
|
||||
animated: IS_NATIVE,
|
||||
offset: -headerHeight,
|
||||
})
|
||||
queryClient.resetQueries({queryKey: FEED_RQKEY(feed)})
|
||||
|
||||
@@ -7,7 +7,6 @@ import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {shareUrl} from '#/lib/sharing'
|
||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {
|
||||
useListBlockMutation,
|
||||
useListDeleteMutation,
|
||||
@@ -34,6 +33,7 @@ import {
|
||||
} from '#/components/moderation/ReportDialog'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
export function MoreOptionsMenu({
|
||||
list,
|
||||
@@ -162,10 +162,10 @@ export function MoreOptionsMenu({
|
||||
<Menu.Outer>
|
||||
<Menu.Group>
|
||||
<Menu.Item
|
||||
label={isWeb ? _(msg`Copy link to list`) : _(msg`Share via...`)}
|
||||
label={IS_WEB ? _(msg`Copy link to list`) : _(msg`Share via...`)}
|
||||
onPress={onPressShare}>
|
||||
<Menu.ItemText>
|
||||
{isWeb ? (
|
||||
{IS_WEB ? (
|
||||
<Trans>Copy link to list</Trans>
|
||||
) : (
|
||||
<Trans>Share via...</Trans>
|
||||
@@ -173,7 +173,7 @@ export function MoreOptionsMenu({
|
||||
</Menu.ItemText>
|
||||
<Menu.ItemIcon
|
||||
position="right"
|
||||
icon={isWeb ? ChainLink : ShareIcon}
|
||||
icon={IS_WEB ? ChainLink : ShareIcon}
|
||||
/>
|
||||
</Menu.Item>
|
||||
{savedFeedConfig && (
|
||||
|
||||
@@ -22,7 +22,6 @@ import {HITSLOP_10} from '#/lib/constants'
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {MagnifyingGlassIcon} from '#/lib/icons'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {listenSoftReset} from '#/state/events'
|
||||
import {useActorAutocompleteQuery} from '#/state/queries/actor-autocomplete'
|
||||
import {
|
||||
@@ -41,6 +40,7 @@ import {Button, ButtonText} from '#/components/Button'
|
||||
import {SearchInput} from '#/components/forms/SearchInput'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {account, useStorage} from '#/storage'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
import {AutocompleteResults} from './components/AutocompleteResults'
|
||||
@@ -141,7 +141,7 @@ export function SearchScreenShell({
|
||||
const [headerHeight, setHeaderHeight] = useState(0)
|
||||
const headerRef = useRef(null)
|
||||
useLayoutEffect(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
if (!headerRef.current) return
|
||||
const measurement = (headerRef.current as Element).getBoundingClientRect()
|
||||
setHeaderHeight(measurement.height)
|
||||
@@ -150,7 +150,7 @@ export function SearchScreenShell({
|
||||
|
||||
useFocusEffect(
|
||||
useNonReactiveCallback(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
setSearchText(queryParam)
|
||||
}
|
||||
}),
|
||||
@@ -173,7 +173,7 @@ export function SearchScreenShell({
|
||||
setShowAutocomplete(false)
|
||||
updateSearchHistory(item)
|
||||
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// @ts-expect-error route is not typesafe
|
||||
navigation.push(route.name, {...route.params, q: item})
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ export function SearchScreenShell({
|
||||
scrollToTopWeb()
|
||||
textInput.current?.blur()
|
||||
setShowAutocomplete(false)
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// Empty params resets the URL to be /search rather than /search?q=
|
||||
// Also clear the tab parameter
|
||||
const {
|
||||
@@ -211,7 +211,7 @@ export function SearchScreenShell({
|
||||
}, [navigateToItem, searchText])
|
||||
|
||||
const onAutocompleteResultPress = useCallback(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
setShowAutocomplete(false)
|
||||
} else {
|
||||
textInput.current?.blur()
|
||||
@@ -238,7 +238,7 @@ export function SearchScreenShell({
|
||||
)
|
||||
|
||||
const onSoftReset = useCallback(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// Empty params resets the URL to be /search rather than /search?q=
|
||||
// Also clear the tab parameter when soft resetting
|
||||
const {
|
||||
@@ -265,7 +265,7 @@ export function SearchScreenShell({
|
||||
)
|
||||
|
||||
const onSearchInputFocus = useCallback(() => {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
// Prevent a jump on iPad by ensuring that
|
||||
// the initial focused render has no result list.
|
||||
requestAnimationFrame(() => {
|
||||
@@ -282,7 +282,7 @@ export function SearchScreenShell({
|
||||
|
||||
// If a tab is specified, set the tab parameter
|
||||
if (tab) {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
navigation.setParams({...route.params, tab})
|
||||
} else {
|
||||
navigation.setParams({tab})
|
||||
@@ -299,7 +299,7 @@ export function SearchScreenShell({
|
||||
<View
|
||||
ref={headerRef}
|
||||
onLayout={evt => {
|
||||
if (isWeb) setHeaderHeight(evt.nativeEvent.layout.height)
|
||||
if (IS_WEB) setHeaderHeight(evt.nativeEvent.layout.height)
|
||||
}}
|
||||
style={[
|
||||
a.relative,
|
||||
@@ -581,7 +581,7 @@ function useQueryManager({
|
||||
}
|
||||
|
||||
function scrollToTopWeb() {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
window.scrollTo(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ import {type AppBskyActorDefs} from '@atproto/api'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {SearchLinkCard} from '#/view/shell/desktop/Search'
|
||||
import {SearchProfileCard} from '#/screens/Search/components/SearchProfileCard'
|
||||
import {atoms as a, native} from '#/alf'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
let AutocompleteResults = ({
|
||||
isAutocompleteFetching,
|
||||
@@ -45,7 +45,7 @@ let AutocompleteResults = ({
|
||||
label={_(msg`Search for "${searchText}"`)}
|
||||
onPress={native(onSubmit)}
|
||||
to={
|
||||
isNative
|
||||
IS_NATIVE
|
||||
? undefined
|
||||
: `/search?q=${encodeURIComponent(searchText)}`
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import {type AppBskyUnspeccedDefs} from '@atproto/api'
|
||||
import {Trans} from '@lingui/macro'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {
|
||||
DEFAULT_LIMIT as RECOMMENDATIONS_COUNT,
|
||||
useTrendingTopics,
|
||||
@@ -17,6 +16,7 @@ import {
|
||||
TrendingTopicSkeleton,
|
||||
} from '#/components/TrendingTopics'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
// Note: This module is not currently used and may be removed in the future.
|
||||
|
||||
@@ -37,7 +37,7 @@ function Inner() {
|
||||
<View
|
||||
style={[
|
||||
a.flex_row,
|
||||
isWeb
|
||||
IS_WEB
|
||||
? [a.px_lg, a.py_lg, a.pt_2xl, a.gap_md]
|
||||
: [a.p_lg, a.pt_2xl, a.gap_md],
|
||||
a.border_b,
|
||||
|
||||
@@ -11,7 +11,6 @@ import {Statsig} from 'statsig-react-native-expo'
|
||||
|
||||
import {STATUS_PAGE_URL} from '#/lib/constants'
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {isAndroid, isIOS, isNative} from '#/platform/detection'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as SettingsList from '#/screens/Settings/components/SettingsList'
|
||||
import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom'
|
||||
@@ -22,6 +21,7 @@ import {Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon} from '#/components/i
|
||||
import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {IS_ANDROID, IS_IOS, IS_NATIVE} from '#/env'
|
||||
import * as env from '#/env'
|
||||
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||
import {useDevMode} from '#/storage/hooks/dev-mode'
|
||||
@@ -44,7 +44,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
return spaceDiff * -1
|
||||
},
|
||||
onSuccess: sizeDiffBytes => {
|
||||
if (isAndroid) {
|
||||
if (IS_ANDROID) {
|
||||
Toast.show(
|
||||
_(
|
||||
msg({
|
||||
@@ -110,7 +110,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
<Trans>System log</Trans>
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.LinkItem>
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<SettingsList.PressableItem
|
||||
onPress={() => onClearImageCache()}
|
||||
label={_(msg`Clear image cache`)}
|
||||
@@ -159,7 +159,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
{devModeEnabled && (
|
||||
<>
|
||||
<OTAInfo />
|
||||
{isIOS && (
|
||||
{IS_IOS && (
|
||||
<SettingsList.PressableItem
|
||||
onPress={() => {
|
||||
const newDemoModeEnabled = !demoModeEnabled
|
||||
|
||||
@@ -3,7 +3,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {
|
||||
useHapticsDisabled,
|
||||
useRequireAltTextEnabled,
|
||||
@@ -20,6 +19,7 @@ import * as Toggle from '#/components/forms/Toggle'
|
||||
import {Accessibility_Stroke2_Corner2_Rounded as AccessibilityIcon} from '#/components/icons/Accessibility'
|
||||
import {Haptic_Stroke2_Corner2_Rounded as HapticIcon} from '#/components/icons/Haptic'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<
|
||||
CommonNavigatorParams,
|
||||
@@ -76,7 +76,7 @@ export function AccessibilitySettingsScreen({}: Props) {
|
||||
<Toggle.Platform />
|
||||
</Toggle.Item>
|
||||
</SettingsList.Group>
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<>
|
||||
<SettingsList.Divider />
|
||||
<SettingsList.Group contentContainerStyle={[a.gap_sm]}>
|
||||
|
||||
@@ -8,7 +8,6 @@ import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {isAndroid} from '#/platform/detection'
|
||||
import {AppIconImage} from '#/screens/Settings/AppIconSettings/AppIconImage'
|
||||
import {type AppIconSet} from '#/screens/Settings/AppIconSettings/types'
|
||||
import {useAppIconSets} from '#/screens/Settings/AppIconSettings/useAppIconSets'
|
||||
@@ -16,6 +15,7 @@ import {atoms as a, useTheme} from '#/alf'
|
||||
import * as Toggle from '#/components/forms/Toggle'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_ANDROID} from '#/env'
|
||||
import {IS_INTERNAL} from '#/env'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppIconSettings'>
|
||||
@@ -29,7 +29,7 @@ export function AppIconSettingsScreen({}: Props) {
|
||||
)
|
||||
|
||||
const onSetAppIcon = (icon: DynamicAppIcon.IconName) => {
|
||||
if (isAndroid) {
|
||||
if (IS_ANDROID) {
|
||||
const next =
|
||||
sets.defaults.find(i => i.id === icon) ??
|
||||
sets.core.find(i => i.id === icon)
|
||||
@@ -221,7 +221,7 @@ function AppIcon({icon, size = 50}: {icon: AppIconSet; size: number}) {
|
||||
accessibilityHint={_(msg`Changes app icon`)}
|
||||
targetScale={0.95}
|
||||
onPress={() => {
|
||||
if (isAndroid) {
|
||||
if (IS_ANDROID) {
|
||||
Alert.alert(
|
||||
_(msg`Change app icon to "${icon.name}"`),
|
||||
_(msg`The app will be restarted`),
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
type CommonNavigatorParams,
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useSetThemePrefs, useThemePrefs} from '#/state/shell'
|
||||
import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem'
|
||||
import {type Alf, atoms as a, native, useAlf, useTheme} from '#/alf'
|
||||
@@ -24,6 +23,7 @@ import {TextSize_Stroke2_Corner0_Rounded as TextSize} from '#/components/icons/T
|
||||
import {TitleCase_Stroke2_Corner0_Rounded as Aa} from '#/components/icons/TitleCase'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {IS_INTERNAL} from '#/env'
|
||||
import * as SettingsList from './components/SettingsList'
|
||||
|
||||
@@ -165,7 +165,7 @@ export function AppearanceSettingsScreen({}: Props) {
|
||||
onChange={onChangeFontScale}
|
||||
/>
|
||||
|
||||
{isNative && IS_INTERNAL && (
|
||||
{IS_NATIVE && IS_INTERNAL && (
|
||||
<>
|
||||
<SettingsList.Divider />
|
||||
<AppIconSettingsListItem />
|
||||
|
||||
@@ -4,7 +4,6 @@ import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useAutoplayDisabled, useSetAutoplayDisabled} from '#/state/preferences'
|
||||
import {
|
||||
useInAppBrowser,
|
||||
@@ -26,6 +25,7 @@ import {Play_Stroke2_Corner2_Rounded as PlayIcon} from '#/components/icons/Play'
|
||||
import {Trending2_Stroke2_Corner2_Rounded as Graph} from '#/components/icons/Trending'
|
||||
import {Window_Stroke2_Corner2_Rounded as WindowIcon} from '#/components/icons/Window'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {LiveEventFeedsSettingsToggle} from '#/features/liveEvents/components/LiveEventFeedsSettingsToggle'
|
||||
|
||||
type Props = NativeStackScreenProps<
|
||||
@@ -97,7 +97,7 @@ export function ContentAndMediaSettingsScreen({}: Props) {
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.LinkItem>
|
||||
<SettingsList.Divider />
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<Toggle.Item
|
||||
name="use_in_app_browser"
|
||||
label={_(msg`Use in-app browser to open links`)}
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
} from '#/lib/routes/types'
|
||||
import {cleanError, isNetworkError} from '#/lib/strings/errors'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {
|
||||
updateProfileShadow,
|
||||
useProfileShadow,
|
||||
@@ -48,6 +47,7 @@ import {Loader} from '#/components/Loader'
|
||||
import * as ProfileCard from '#/components/ProfileCard'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
import {bulkWriteFollows} from '../Onboarding/util'
|
||||
|
||||
@@ -78,7 +78,7 @@ export function FindContactsSettingsScreen({}: Props) {
|
||||
</Layout.Header.Content>
|
||||
<Layout.Header.Slot />
|
||||
</Layout.Header.Outer>
|
||||
{isNative ? (
|
||||
{IS_NATIVE ? (
|
||||
data ? (
|
||||
!data.syncStatus ? (
|
||||
<Intro />
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
type AllNavigatorParams,
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {isAndroid, isIOS, isWeb} from '#/platform/detection'
|
||||
import {useNotificationSettingsQuery} from '#/state/queries/notifications/settings'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {Admonition} from '#/components/Admonition'
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
} from '#/components/icons/Repost'
|
||||
import {Shapes_Stroke2_Corner0_Rounded as ShapesIcon} from '#/components/icons/Shapes'
|
||||
import * as Layout from '#/components/Layout'
|
||||
import {IS_ANDROID, IS_IOS, IS_WEB} from '#/env'
|
||||
import * as SettingsList from '../components/SettingsList'
|
||||
import {ItemTextWithSubtitle} from './components/ItemTextWithSubtitle'
|
||||
|
||||
@@ -45,7 +45,7 @@ export function NotificationSettingsScreen({}: Props) {
|
||||
const {data: permissions, refetch} = useQuery({
|
||||
queryKey: RQKEY,
|
||||
queryFn: async () => {
|
||||
if (isWeb) return null
|
||||
if (IS_WEB) return null
|
||||
return await Notification.getPermissionsAsync()
|
||||
},
|
||||
})
|
||||
@@ -58,12 +58,12 @@ export function NotificationSettingsScreen({}: Props) {
|
||||
}, [appState, refetch])
|
||||
|
||||
const onRequestPermissions = async () => {
|
||||
if (isWeb) return
|
||||
if (IS_WEB) return
|
||||
if (permissions?.canAskAgain) {
|
||||
const response = await Notification.requestPermissionsAsync()
|
||||
queryClient.setQueryData(RQKEY, response)
|
||||
} else {
|
||||
if (isAndroid) {
|
||||
if (IS_ANDROID) {
|
||||
try {
|
||||
await Linking.sendIntent(
|
||||
'android.settings.APP_NOTIFICATION_SETTINGS',
|
||||
@@ -77,7 +77,7 @@ export function NotificationSettingsScreen({}: Props) {
|
||||
} catch {
|
||||
Linking.openSettings()
|
||||
}
|
||||
} else if (isIOS) {
|
||||
} else if (IS_IOS) {
|
||||
Linking.openSettings()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {isIOS, isNative} from '#/platform/detection'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import * as persisted from '#/state/persisted'
|
||||
import {clearStorage} from '#/state/persisted'
|
||||
@@ -71,6 +70,7 @@ import {
|
||||
shouldShowVerificationCheckButton,
|
||||
VerificationCheckButton,
|
||||
} from '#/components/verification/VerificationCheckButton'
|
||||
import {IS_IOS, IS_NATIVE} from '#/env'
|
||||
import {IS_INTERNAL} from '#/env'
|
||||
import {device, useStorage} from '#/storage'
|
||||
import {useActivitySubscriptionsNudged} from '#/storage/hooks/activity-subscriptions-nudged'
|
||||
@@ -213,7 +213,7 @@ export function SettingsScreen({}: Props) {
|
||||
<Trans>Content and media</Trans>
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.LinkItem>
|
||||
{isNative &&
|
||||
{IS_NATIVE &&
|
||||
findContactsEnabled &&
|
||||
!gate('disable_settings_find_contacts') && (
|
||||
<SettingsList.LinkItem
|
||||
@@ -510,7 +510,7 @@ function DevOptions() {
|
||||
<Trans>Clear all storage data (restart after this)</Trans>
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.PressableItem>
|
||||
{isIOS ? (
|
||||
{IS_IOS ? (
|
||||
<SettingsList.PressableItem
|
||||
onPress={onPressApplyOta}
|
||||
label={_(msg`Apply Pull Request`)}>
|
||||
@@ -519,7 +519,7 @@ function DevOptions() {
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.PressableItem>
|
||||
) : null}
|
||||
{isNative && isCurrentlyRunningPullRequestDeployment ? (
|
||||
{IS_NATIVE && isCurrentlyRunningPullRequestDeployment ? (
|
||||
<SettingsList.PressableItem
|
||||
onPress={revertToEmbedded}
|
||||
label={_(msg`Unapply Pull Request`)}>
|
||||
|
||||
@@ -13,7 +13,6 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useAppPasswordCreateMutation} from '#/state/queries/app-passwords'
|
||||
import {atoms as a, native, useTheme} from '#/alf'
|
||||
import {Admonition} from '#/components/Admonition'
|
||||
@@ -24,6 +23,7 @@ import * as Toggle from '#/components/forms/Toggle'
|
||||
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron'
|
||||
import {SquareBehindSquare4_Stroke2_Corner0_Rounded as CopyIcon} from '#/components/icons/SquareBehindSquare4'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {CopyButton} from './CopyButton'
|
||||
|
||||
export function AddAppPasswordDialog({
|
||||
@@ -181,7 +181,7 @@ function CreateDialogInner({passwords}: {passwords: string[]}) {
|
||||
) : (
|
||||
<Animated.View
|
||||
style={[a.gap_lg]}
|
||||
entering={isWeb ? FadeIn.delay(200) : SlideInRight}
|
||||
entering={IS_WEB ? FadeIn.delay(200) : SlideInRight}
|
||||
key={1}>
|
||||
<Text style={[a.text_2xl, a.font_semi_bold]}>
|
||||
<Trans>Here is your app password!</Trans>
|
||||
|
||||
@@ -7,7 +7,6 @@ import * as EmailValidator from 'email-validator'
|
||||
import {cleanError, isNetworkError} from '#/lib/strings/errors'
|
||||
import {checkAndFormatResetCode} from '#/lib/strings/password'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useAgent, useSession} from '#/state/session'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
import {android, atoms as a, web} from '#/alf'
|
||||
@@ -16,6 +15,7 @@ import * as Dialog from '#/components/Dialog'
|
||||
import * as TextField from '#/components/forms/TextField'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
enum Stages {
|
||||
RequestCode = 'RequestCode',
|
||||
@@ -242,7 +242,7 @@ function Inner() {
|
||||
<Trans>Already have a code?</Trans>
|
||||
</ButtonText>
|
||||
</Button>
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<Button
|
||||
label={_(msg`Cancel`)}
|
||||
color="secondary"
|
||||
|
||||
@@ -4,7 +4,6 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useAgent, useSession} from '#/state/session'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
@@ -15,6 +14,7 @@ import * as TextField from '#/components/forms/TextField'
|
||||
import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {P, Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
enum Stages {
|
||||
Email,
|
||||
@@ -193,7 +193,7 @@ export function DisableEmail2FADialog({
|
||||
</View>
|
||||
) : undefined}
|
||||
|
||||
{!gtMobile && isNative && <View style={{height: 40}} />}
|
||||
{!gtMobile && IS_NATIVE && <View style={{height: 40}} />}
|
||||
</View>
|
||||
</Dialog.ScrollableInner>
|
||||
</Dialog.Outer>
|
||||
|
||||
@@ -7,19 +7,21 @@ import {nanoid} from 'nanoid/non-secure'
|
||||
|
||||
import {createFullHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
import {isAndroid, isIOS, isNative, isWeb} from '#/platform/detection'
|
||||
import {useSignupContext} from '#/screens/Signup/state'
|
||||
import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {FormError} from '#/components/forms/FormError'
|
||||
import {IS_ANDROID, IS_IOS, IS_NATIVE, IS_WEB} from '#/env'
|
||||
import {GCP_PROJECT_ID} from '#/env'
|
||||
import {BackNextButtons} from '../BackNextButtons'
|
||||
|
||||
const CAPTCHA_PATH =
|
||||
isWeb || GCP_PROJECT_ID === 0 ? '/gate/signup' : '/gate/signup/attempt-attest'
|
||||
IS_WEB || GCP_PROJECT_ID === 0
|
||||
? '/gate/signup'
|
||||
: '/gate/signup/attempt-attest'
|
||||
|
||||
export function StepCaptcha() {
|
||||
if (isWeb) {
|
||||
if (IS_WEB) {
|
||||
return <StepCaptchaInner />
|
||||
} else {
|
||||
return <StepCaptchaNative />
|
||||
@@ -35,7 +37,7 @@ export function StepCaptchaNative() {
|
||||
;(async () => {
|
||||
logger.debug('trying to generate attestation token...')
|
||||
try {
|
||||
if (isIOS) {
|
||||
if (IS_IOS) {
|
||||
logger.debug('starting to generate devicecheck token...')
|
||||
const token = await ReactNativeDeviceAttest.getDeviceCheckToken()
|
||||
setToken(token)
|
||||
@@ -85,10 +87,10 @@ function StepCaptchaInner({
|
||||
newUrl.searchParams.set('state', stateParam)
|
||||
newUrl.searchParams.set('colorScheme', theme.name)
|
||||
|
||||
if (isNative && token) {
|
||||
if (IS_NATIVE && token) {
|
||||
newUrl.searchParams.set('platform', Platform.OS)
|
||||
newUrl.searchParams.set('token', token)
|
||||
if (isAndroid && payload) {
|
||||
if (IS_ANDROID && payload) {
|
||||
newUrl.searchParams.set('payload', payload)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import type tldts from 'tldts'
|
||||
|
||||
import {isEmailMaybeInvalid} from '#/lib/strings/email'
|
||||
import {logger} from '#/logger'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useSignupContext} from '#/screens/Signup/state'
|
||||
import {Policies} from '#/screens/Signup/StepInfo/Policies'
|
||||
import {atoms as a, native} from '#/alf'
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
MIN_ACCESS_AGE,
|
||||
useAgeAssuranceRegionConfigWithFallback,
|
||||
} from '#/ageAssurance/util'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {
|
||||
useDeviceGeolocationApi,
|
||||
useIsDeviceGeolocationGranted,
|
||||
@@ -325,7 +325,7 @@ export function StepInfo({
|
||||
</Trans>
|
||||
)}
|
||||
</Admonition.Text>
|
||||
{isNative &&
|
||||
{IS_NATIVE &&
|
||||
!isDeviceGeolocationGranted &&
|
||||
isOverAppMinAccessAge && (
|
||||
<Admonition.Text>
|
||||
@@ -357,7 +357,7 @@ export function StepInfo({
|
||||
) : undefined}
|
||||
</View>
|
||||
|
||||
{isNative && (
|
||||
{IS_NATIVE && (
|
||||
<DeviceLocationRequestDialog
|
||||
control={locationControl}
|
||||
onLocationAcquired={props => {
|
||||
|
||||
@@ -8,7 +8,6 @@ import {useLingui} from '@lingui/react'
|
||||
|
||||
import {FEEDBACK_FORM_URL} from '#/lib/constants'
|
||||
import {logger} from '#/logger'
|
||||
import {isAndroid} from '#/platform/detection'
|
||||
import {useServiceQuery} from '#/state/queries/service'
|
||||
import {useStarterPackQuery} from '#/state/queries/starter-packs'
|
||||
import {useActiveStarterPack} from '#/state/shell/starter-pack'
|
||||
@@ -30,6 +29,7 @@ import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
||||
import {InlineLinkText} from '#/components/Link'
|
||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_ANDROID} from '#/env'
|
||||
import {GCP_PROJECT_ID} from '#/env'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
@@ -108,7 +108,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||
|
||||
// On Android, warmup the Play Integrity API on the signup screen so it is ready by the time we get to the gate screen.
|
||||
useEffect(() => {
|
||||
if (!isAndroid) {
|
||||
if (!IS_ANDROID) {
|
||||
return
|
||||
}
|
||||
ReactNativeDeviceAttest.warmupIntegrity(GCP_PROJECT_ID).catch(err =>
|
||||
|
||||
@@ -6,7 +6,6 @@ import {msg, plural, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {isIOS, isWeb} from '#/platform/detection'
|
||||
import {isSignupQueued, useAgent, useSessionApi} from '#/state/session'
|
||||
import {useOnboardingDispatch} from '#/state/shell'
|
||||
import {Logo} from '#/view/icons/Logo'
|
||||
@@ -14,6 +13,7 @@ import {atoms as a, native, useBreakpoints, useTheme, web} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {P, Text} from '#/components/Typography'
|
||||
import {IS_IOS, IS_WEB} from '#/env'
|
||||
|
||||
const COL_WIDTH = 400
|
||||
|
||||
@@ -98,7 +98,7 @@ export function SignupQueued() {
|
||||
</Button>
|
||||
)
|
||||
|
||||
const webLayout = isWeb && gtMobile
|
||||
const webLayout = IS_WEB && gtMobile
|
||||
|
||||
return (
|
||||
<Modal
|
||||
@@ -106,7 +106,7 @@ export function SignupQueued() {
|
||||
animationType={native('slide')}
|
||||
presentationStyle="formSheet"
|
||||
style={[web(a.util_screen_outer)]}>
|
||||
{isIOS && <SystemBars style={{statusBar: 'light'}} />}
|
||||
{IS_IOS && <SystemBars style={{statusBar: 'light'}} />}
|
||||
<ScrollView
|
||||
style={[a.flex_1, t.atoms.bg]}
|
||||
contentContainerStyle={{borderWidth: 0}}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
} from '#/lib/constants'
|
||||
import {useEnableKeyboardController} from '#/lib/hooks/useEnableKeyboardController'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
||||
import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
|
||||
import {Logo} from '#/view/icons/Logo'
|
||||
@@ -24,6 +23,7 @@ import * as TextField from '#/components/forms/TextField'
|
||||
import {SimpleInlineLinkText} from '#/components/Link'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {P, Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
|
||||
const COL_WIDTH = 400
|
||||
|
||||
@@ -119,7 +119,7 @@ export function Takendown() {
|
||||
</Button>
|
||||
)
|
||||
|
||||
const webLayout = isWeb && gtMobile
|
||||
const webLayout = IS_WEB && gtMobile
|
||||
|
||||
useEnableKeyboardController(true)
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
import {isAndroid} from '#/platform/detection'
|
||||
import {useA11y} from '#/state/a11y'
|
||||
import {
|
||||
POST_TOMBSTONE,
|
||||
@@ -101,6 +100,7 @@ import * as Hider from '#/components/moderation/Hider'
|
||||
import {PostControls} from '#/components/PostControls'
|
||||
import {RichText} from '#/components/RichText'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_ANDROID} from '#/env'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {Scrubber, VIDEO_PLAYER_BOTTOM_INSET} from './components/Scrubber'
|
||||
|
||||
@@ -590,10 +590,10 @@ function VideoItemInner({
|
||||
embed: AppBskyEmbedVideo.View
|
||||
}) {
|
||||
const {bottom} = useSafeAreaInsets()
|
||||
const [isReady, setIsReady] = useState(!isAndroid)
|
||||
const [isReady, setIsReady] = useState(!IS_ANDROID)
|
||||
|
||||
useEventListener(player, 'timeUpdate', evt => {
|
||||
if (isAndroid && !isReady && evt.currentTime >= 0.05) {
|
||||
if (IS_ANDROID && !isReady && evt.currentTime >= 0.05) {
|
||||
setIsReady(true)
|
||||
}
|
||||
})
|
||||
@@ -920,7 +920,7 @@ function Overlay({
|
||||
</LinearGradient>
|
||||
</View>
|
||||
{/*
|
||||
{isAndroid && status === 'loading' && (
|
||||
{IS_ANDROID && status === 'loading' && (
|
||||
<View
|
||||
style={[
|
||||
a.absolute,
|
||||
|
||||
Reference in New Issue
Block a user