Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user