import React from 'react'; import { InputAccessoryView, Keyboard, Platform, StyleSheet, View } from 'react-native'; import { BlueButtonLink } from '../BlueComponents'; import loc from '../loc'; import { useTheme } from './themes'; import Clipboard from '@react-native-clipboard/clipboard'; interface DoneAndDismissKeyboardInputAccessoryProps { onPasteTapped: (clipboard: string) => void; onClearTapped: () => void; } export const DoneAndDismissKeyboardInputAccessoryViewID = 'DoneAndDismissKeyboardInputAccessory'; export const DoneAndDismissKeyboardInputAccessory: React.FC = props => { const { colors } = useTheme(); const styleHooks = StyleSheet.create({ container: { backgroundColor: colors.inputBackgroundColor, }, }); const onPasteTapped = async () => { const clipboard = await Clipboard.getString(); props.onPasteTapped(clipboard); }; const inputView = ( ); if (Platform.OS === 'ios') { return {inputView}; } else { return inputView; } }; const styles = StyleSheet.create({ container: { flexDirection: 'row', justifyContent: 'flex-end', alignItems: 'center', maxHeight: 44, }, });