diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-13 19:53:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 19:53:07 -0400 |
commit | 3cc0e2e342993ce01490a36a43d99f2ab61ccb4f (patch) | |
tree | b57b61c49571c9e4b6d34c67f2f99c9617ff9d93 /src/components/messages/ChatInputSubmit.tsx | |
parent | 93837e23a169e6b17432e4e0dd397bcaa140bb5e (diff) | |
parent | 3db3ba5fc35930cea99b2a51042446c0c470af47 (diff) |
Merge pull request #362 from IvanIFChen/tma784-message-input-camera
[TMA-784] Message input camera
Diffstat (limited to 'src/components/messages/ChatInputSubmit.tsx')
-rw-r--r-- | src/components/messages/ChatInputSubmit.tsx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/components/messages/ChatInputSubmit.tsx b/src/components/messages/ChatInputSubmit.tsx new file mode 100644 index 00000000..9e29ad4d --- /dev/null +++ b/src/components/messages/ChatInputSubmit.tsx @@ -0,0 +1,49 @@ +import React from 'react'; +import {StyleSheet, TouchableOpacity} from 'react-native'; +import UpArrowIcon from '../../assets/icons/up_arrow.svg'; +import {TAGG_LIGHT_BLUE} from '../../constants'; +import {normalize} from '../../utils'; + +interface ChatInputSubmitProps { + outlined: boolean; + onPress: () => void; +} + +const SIZE = normalize(25); + +const ChatInputSubmit: React.FC<ChatInputSubmitProps> = (props) => { + const {outlined, onPress} = props; + + return outlined ? ( + <TouchableOpacity + style={[styles.submitButton, styles.outline]} + onPress={onPress}> + <UpArrowIcon width={SIZE} height={SIZE} color={TAGG_LIGHT_BLUE} /> + </TouchableOpacity> + ) : ( + <TouchableOpacity + style={[styles.submitButton, styles.background]} + onPress={onPress}> + <UpArrowIcon width={SIZE} height={SIZE} color={'white'} /> + </TouchableOpacity> + ); +}; + +const styles = StyleSheet.create({ + submitButton: { + height: SIZE, + aspectRatio: 1, + borderRadius: 999, + justifyContent: 'center', + alignItems: 'center', + }, + background: { + backgroundColor: TAGG_LIGHT_BLUE, + }, + outline: { + borderWidth: 1, + borderColor: TAGG_LIGHT_BLUE, + }, +}); + +export default ChatInputSubmit; |