Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -6,7 +6,6 @@ import {useLingui} from '@lingui/react'
|
||||
import {MAX_ALT_TEXT} from '#/lib/constants'
|
||||
import {isOverMaxGraphemeCount} from '#/lib/strings/helpers'
|
||||
import {LANGUAGES} from '#/locale/languages'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useLanguagePrefs} from '#/state/preferences'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
@@ -17,6 +16,7 @@ import {PageText_Stroke2_Corner0_Rounded as PageTextIcon} from '#/components/ico
|
||||
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
|
||||
import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {SubtitleFilePicker} from './SubtitleFilePicker'
|
||||
|
||||
const MAX_NUM_CAPTIONS = 1
|
||||
@@ -37,9 +37,9 @@ export function SubtitleDialogBtn(props: Props) {
|
||||
return (
|
||||
<View style={[a.flex_row, a.my_xs]}>
|
||||
<Button
|
||||
label={isWeb ? _(msg`Captions & alt text`) : _(msg`Alt text`)}
|
||||
label={IS_WEB ? _(msg`Captions & alt text`) : _(msg`Alt text`)}
|
||||
accessibilityHint={
|
||||
isWeb
|
||||
IS_WEB
|
||||
? _(msg`Opens captions and alt text dialog`)
|
||||
: _(msg`Opens alt text dialog`)
|
||||
}
|
||||
@@ -52,7 +52,11 @@ export function SubtitleDialogBtn(props: Props) {
|
||||
}}>
|
||||
<ButtonIcon icon={CCIcon} />
|
||||
<ButtonText>
|
||||
{isWeb ? <Trans>Captions & alt text</Trans> : <Trans>Alt text</Trans>}
|
||||
{IS_WEB ? (
|
||||
<Trans>Captions & alt text</Trans>
|
||||
) : (
|
||||
<Trans>Alt text</Trans>
|
||||
)}
|
||||
</ButtonText>
|
||||
</Button>
|
||||
<Dialog.Outer control={control}>
|
||||
@@ -134,7 +138,7 @@ function SubtitleDialogInner({
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{isWeb && (
|
||||
{IS_WEB && (
|
||||
<>
|
||||
<View
|
||||
style={[
|
||||
@@ -182,7 +186,7 @@ function SubtitleDialogInner({
|
||||
<View style={web([a.flex_row, a.justify_end])}>
|
||||
<Button
|
||||
label={_(msg`Done`)}
|
||||
size={isWeb ? 'small' : 'large'}
|
||||
size={IS_WEB ? 'small' : 'large'}
|
||||
color="primary"
|
||||
variant="solid"
|
||||
onPress={() => {
|
||||
|
||||
@@ -4,8 +4,8 @@ import ProgressPie from 'react-native-progress/Pie'
|
||||
import {type ImagePickerAsset} from 'expo-image-picker'
|
||||
|
||||
import {clamp} from '#/lib/numbers'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {ExternalEmbedRemoveBtn} from '../ExternalEmbedRemoveBtn'
|
||||
import {VideoTranscodeBackdrop} from './VideoTranscodeBackdrop'
|
||||
|
||||
@@ -20,7 +20,7 @@ export function VideoTranscodeProgress({
|
||||
}) {
|
||||
const t = useTheme()
|
||||
|
||||
if (isWeb) return null
|
||||
if (IS_WEB) return null
|
||||
|
||||
let aspectRatio = asset.width / asset.height
|
||||
|
||||
|
||||
Reference in New Issue
Block a user