From 5d8357b7e370a51a5f13b316582bcbcd595566d9 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Tue, 15 Jun 2021 01:17:40 +0900 Subject: Correct positioning --- src/components/comments/MentionInputControlled.tsx | 42 ++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'src/components/comments/MentionInputControlled.tsx') diff --git a/src/components/comments/MentionInputControlled.tsx b/src/components/comments/MentionInputControlled.tsx index a3229bb0..c37d2182 100644 --- a/src/components/comments/MentionInputControlled.tsx +++ b/src/components/comments/MentionInputControlled.tsx @@ -1,17 +1,27 @@ -import React, {FC, MutableRefObject, useMemo, useRef, useState} from 'react'; +import React, { + FC, + MutableRefObject, + Ref, + useMemo, + useRef, + useState, +} from 'react'; import { NativeSyntheticEvent, StyleSheet, + StyleProp, Text, TextInput, + TextInputProps, TextInputSelectionChangeEventData, TouchableOpacity, View, + ViewStyle, } from 'react-native'; import {useDispatch, useSelector} from 'react-redux'; import {TAGG_LIGHT_BLUE} from '../../constants'; import { - MentionInputProps, + PatternPartType, MentionPartType, Suggestion, } from 'react-native-controlled-mentions/dist/types'; @@ -29,7 +39,22 @@ import {normalize} from 'react-native-elements'; import UpArrowIcon from '../../assets/icons/up_arrow.svg'; import {SCREEN_WIDTH, SCREEN_HEIGHT} from '../../utils'; -const MentionInputControlled: FC = ({ +type PartType = MentionPartType | PatternPartType; + +type MentionInputControlledProps = Omit & { + value: string; + onChange: (value: string) => any; + + partTypes?: PartType[]; + + inputRef?: Ref; + + containerStyle?: StyleProp; + + addComment?: () => any; +}; + +const MentionInputControlled: FC = ({ value, onChange, @@ -225,14 +250,12 @@ const styles = StyleSheet.create({ marginRight: 10, marginLeft: '3%', marginVertical: '2%', - // alignSelf: 'flex-end', }, containerStyle: { flexDirection: 'row', alignSelf: 'center', alignItems: 'center', justifyContent: 'center', - // borderWidth: 1, height: normalize(40), }, submitButton: { @@ -247,15 +270,6 @@ const styles = StyleSheet.create({ alignSelf: 'flex-end', }, text: {flex: 1}, - overlay: { - width: SCREEN_WIDTH, - height: SCREEN_HEIGHT, - backgroundColor: 'blue', - position: 'absolute', - left: 0, - bottom: 0, - zIndex: -1, - }, }); export {MentionInputControlled}; -- cgit v1.2.3-70-g09d2