diff options
Diffstat (limited to 'src/components/common')
-rw-r--r-- | src/components/common/TaggInput.tsx | 62 | ||||
-rw-r--r-- | src/components/common/index.ts | 1 |
2 files changed, 0 insertions, 63 deletions
diff --git a/src/components/common/TaggInput.tsx b/src/components/common/TaggInput.tsx deleted file mode 100644 index fe11d4f0..00000000 --- a/src/components/common/TaggInput.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import {View, TextInput, StyleSheet, TextInputProps} from 'react-native'; -import * as Animatable from 'react-native-animatable'; - -interface TaggInputProps extends TextInputProps { - valid?: boolean; - invalidWarning?: string; - attemptedSubmit?: boolean; - width?: number | string; -} -/** - * An input component that receives all props a normal TextInput component does. TaggInput components grow to 60% of their parent's width by default, but this can be set using the `width` prop. - */ -const TaggInput = React.forwardRef((props: TaggInputProps, ref: any) => { - return ( - <View style={styles.container}> - <TextInput - style={[{width: props.width}, styles.input]} - placeholderTextColor="#ddd" - clearButtonMode="while-editing" - ref={ref} - {...props} - /> - {props.attemptedSubmit && !props.valid && ( - <Animatable.Text - animation="shake" - duration={500} - style={styles.warning}> - {props.invalidWarning} - </Animatable.Text> - )} - </View> - ); -}); - -const styles = StyleSheet.create({ - container: { - width: '100%', - alignItems: 'center', - marginVertical: 11, - }, - input: { - minWidth: '60%', - height: 40, - fontSize: 16, - fontWeight: '600', - color: '#fff', - borderColor: '#fffdfd', - borderWidth: 2, - borderRadius: 20, - paddingLeft: 13, - }, - warning: { - fontSize: 14, - marginTop: 5, - color: '#f4ddff', - maxWidth: 350, - textAlign: 'center', - }, -}); - -export default TaggInput; diff --git a/src/components/common/index.ts b/src/components/common/index.ts index 826675ff..cb8b9b6a 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -1,7 +1,6 @@ export {default as CenteredView} from './CenteredView'; export {default as OverlayView} from './OverlayView'; export {default as RadioCheckbox} from './RadioCheckbox'; -export {default as TaggInput} from './TaggInput'; export {default as NavigationIcon} from './NavigationIcon'; export {default as GradientBackground} from './GradientBackground'; export {default as Post} from './post'; |