/* eslint react/prop-types: "off", react-native/no-inline-styles: "off" */ import Clipboard from '@react-native-clipboard/clipboard'; import React, { forwardRef } from 'react'; import { ActivityIndicator, Dimensions, I18nManager, InputAccessoryView, Keyboard, KeyboardAvoidingView, Platform, StyleSheet, TextInput, TouchableOpacity, View, } from 'react-native'; import { Icon, Text } from '@rneui/themed'; import { useTheme } from './components/themes'; import loc from './loc'; const { height, width } = Dimensions.get('window'); const aspectRatio = height / width; let isIpad; if (aspectRatio > 1.6) { isIpad = false; } else { isIpad = true; } /** * TODO: remove this comment once this file gets properly converted to typescript. * * @type {React.FC} */ export const BlueButtonLink = forwardRef((props, ref) => { const { colors } = useTheme(); return ( {props.title} ); }); export const BlueCard = props => { return ; }; export const BlueText = props => { const { colors } = useTheme(); const style = StyleSheet.compose({ color: colors.foregroundColor, writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr' }, props.style); return ; }; export const BlueTextCentered = props => { const { colors } = useTheme(); return ; }; export const BlueFormLabel = props => { const { colors } = useTheme(); return ( ); }; export const BlueFormMultiInput = props => { const { colors } = useTheme(); return ( ); }; export const BlueSpacing = props => { return ; }; export const BlueSpacing40 = props => { return ; }; export class is { static ipad() { return isIpad; } } export const BlueSpacing20 = props => { const { horizontal = false } = props; return ; }; export const BlueSpacing10 = props => { return ; }; export const BlueDismissKeyboardInputAccessory = () => { const { colors } = useTheme(); BlueDismissKeyboardInputAccessory.InputAccessoryViewID = 'BlueDismissKeyboardInputAccessory'; return Platform.OS !== 'ios' ? null : ( ); }; export const BlueDoneAndDismissKeyboardInputAccessory = props => { const { colors } = useTheme(); BlueDoneAndDismissKeyboardInputAccessory.InputAccessoryViewID = 'BlueDoneAndDismissKeyboardInputAccessory'; const onPasteTapped = async () => { const clipboard = await Clipboard.getString(); props.onPasteTapped(clipboard); }; const inputView = ( ); if (Platform.OS === 'ios') { return {inputView}; } else { return {inputView}; } }; export const BlueLoading = props => { return ( ); }; export function BlueBigCheckmark({ style = {} }) { const defaultStyles = { backgroundColor: '#ccddf9', width: 120, height: 120, borderRadius: 60, alignSelf: 'center', justifyContent: 'center', marginTop: 0, marginBottom: 0, }; const mergedStyles = { ...defaultStyles, ...style }; return ( ); }