import {type StyleProp, View, type ViewStyle} from 'react-native' import {Trans, useLingui} from '@lingui/react/macro' import {useApplyPullRequestOTAUpdate} from '#/lib/hooks/useOTAUpdates' import {atoms as a, useTheme} from '#/alf' import * as Admonition from '#/components/Admonition' import {ButtonIcon, ButtonText} from '#/components/Button' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' /** * Warns that the running bundle came from a channel this build doesn't normally * receive updates from, e.g. a pull request deployment applied from the dev * settings. Renders nothing on a standard channel, and never on web. */ export function OTAChannelNotice({style}: {style?: StyleProp}) { const t = useTheme() const {t: l} = useLingui() const { currentChannel, defaultChannel, isCurrentlyRunningNonStandardChannel, restoreDefaultChannel, pending, } = useApplyPullRequestOTAUpdate() if (!isCurrentlyRunningNonStandardChannel) return null return ( Non-standard OTA channel This app is running a deployment of{' '} {currentChannel} . Restore the {defaultChannel} deployment to get back to a standard build. void restoreDefaultChannel()}> Restore default {pending && } ) }