All files / widgets/ErrorPopUp/mobile/Components PushNotification.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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81                      10x   10x                                                                                                                                      
import { Image, Text, View } from 'react-native';
import { IphoneNotifications } from '@sb/assets';
import { NativeErrorContent } from '../../ErrorPopUp.types';
import { Button } from '@sb/ui/components/atoms/Button/mobile';
import { parseFormattedNativeContent } from '@sb/libs/utils.native';
import { useThemeColors } from '@sb/hooks/Utilities/useThemeColors';
 
export function NativePushNotification(
  onUseNowClick: () => void,
  onUseLaterClick: () => void
): NativeErrorContent {
  const { themedColors } = useThemeColors();
 
  return {
    padding: 'none',
    footerButtonLabel: '',
    showCloseIcon: false,
    contentSpacing: false,
    title: (
      <View className="relative overflow-hidden">
        <View
          style={{ backgroundColor: themedColors.colorTertiary }}
          className="absolute -right-[9%] -top-[9%] z-10 flex size-20 rotate-45 flex-row items-end justify-center"
        >
          <Text
            style={{ color: themedColors.colorText_Main }}
            className="font-Bold text-sm uppercase tracking-wider"
          >
            Neu
          </Text>
        </View>
        <View className="gap-3 p-8 pb-0">
          <Text
            style={{ color: themedColors.colorPrimary }}
            className="font-Bold text-[18px] uppercase"
          >
            Push-Nachrichten
          </Text>
          <Text style={{ color: themedColors.colorPrimary }} className="font-normal">
            {parseFormattedNativeContent(
              'Bei uns kannst du dich für <semibold>Push-Nachrichten</semibold> (wie z.B. Cashout-und Toralarm) anmelden.',
              'font-semibold',
              'semibold'
            )}
          </Text>
          <Text style={{ color: themedColors.colorPrimary }} className="font-normal">
            {parseFormattedNativeContent(
              'Die Push-Nachrichten werden dir jetzt auch in der App angeziegt. Klick auf <semibold>„Jetzt nutzen“</semibold> um immer am Ball zu bleiben.',
              'font-semibold',
              'semibold'
            )}
          </Text>
        </View>
 
        {/* Iphone With Notifications */}
        <View className="items-center">
          <Image source={IphoneNotifications} />
        </View>
      </View>
    ),
    description: (
      <View style={{ backgroundColor: themedColors.colorTertiary }} className="w-full gap-4 p-4">
        <Button
          variant="primary"
          label="Jetzt nutzen"
          onPress={onUseNowClick}
          textStyle="uppercase text-primary"
          className="w-full rounded-sm py-4"
        />
        <Text
          onPress={onUseLaterClick}
          style={{ color: themedColors.colorText_Main }}
          className="w-full text-center font-normal uppercase underline underline-offset-2"
        >
          Später
        </Text>
      </View>
    ),
  };
}