import React, { ReactElement, useLayoutEffect } from 'react';
import { View, Text, Linking } from 'react-native';
import { useTheme } from '../../theme';
import { CustomIcon } from '../CustomIcon';
import Button from '../Button';
import { styles } from './styles';
import { useSupportedVersionMessage } from './useSupportedVersionMessage';
import * as HeaderButton from '../HeaderButton';
import I18n from '../../i18n';
import { LEARN_MORE_URL } from './constants';
export const SupportedVersionsWarning = ({ navigation, route }: { navigation?: any; route?: any }): ReactElement | null => {
const { colors } = useTheme();
const message = useSupportedVersionMessage();
useLayoutEffect(() => {
navigation?.setOptions({
title: I18n.t('Supported_versions_warning_update_required')
});
if (route?.params?.showCloseButton) {
navigation?.setOptions({
headerLeft: () =>
});
}
}, [navigation, route]);
if (!message) {
return null;
}
return (
{message.title ? (
{message.title}
) : null}
{message.subtitle ? (
{message.subtitle}
) : null}
{message.description ? (
{message.description}
) : null}
);
};