You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

import React from 'react';
import { Animated, StyleSheet, TextInput } from 'react-native';
import { startAnimation, stopAnimation, animatedStyles } from '../assets/animations/answerAnimation'
interface kanjiAnswerFieldProps {
answer: string,
setAnswer: React.Dispatch<React.SetStateAction<string>>
}
const KanjiAnswerField = (props: kanjiAnswerFieldProps) => {
return (
<Animated.View style={[animatedStyles]}>
<TextInput
style={answerFieldStyle.input}
onChangeText={props.setAnswer}
value={props.answer}
onFocus={startAnimation}
onBlur={stopAnimation}
placeholder="Answer here"
/>
</Animated.View>
);
};
const answerFieldStyle = StyleSheet.create({
input: {
height: 40,
margin: 12,
borderWidth: 1,
padding: 10,
width: 200,
backgroundColor: "white",
borderRadius:20
},
})
export default KanjiAnswerField;