All files / widgets/ErrorPopUp/mobile/Components ConnectionUnavailable.tsx

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                10x   10x                                                
import { Text, View } from 'react-native';
import { paragraphClasses } from './utils';
import { NativeErrorContent } from '../../ErrorPopUp.types';
import { parseFormattedNativeContent } from '@sb/libs/utils.native';
import { useThemeColors } from '@sb/hooks/Utilities/useThemeColors';
import { InternetError } from '@sb/ui/components/atoms/Icons/mobile';
 
export function NativeConnectionUnavailable(onTryAgainClick: () => void): NativeErrorContent {
  const { themedColors } = useThemeColors();
 
  return {
    className: 'w-[95%] mx-auto',
    descriptionClassName: 'w-full items-center',
    title: (
      <View className="mt-2 flex-col items-center gap-2">
        <InternetError size={80} />
        <Text style={{ color: themedColors.colorPrimary }} className="font-Bold my-2 text-4xl uppercase">
          Hoppla!
        </Text>
      </View>
    ),
    description: (
      <Text className={paragraphClasses}>
        {parseFormattedNativeContent(
          '<semibold>Schlechte</semibold> oder <semibold>keine Internetverbindung</semibold>.\nBitte überprüfe deine Netzwerkverbindung.',
          'font-semibold',
          'semibold'
        )}
      </Text>
    ),
    footerButtonLabel: 'Erneut versuchen'.toUpperCase(),
    onFooterButtonClicked: onTryAgainClick,
  };
}