aboutsummaryrefslogtreecommitdiff
path: root/src/components/messages/ChatInputSubmit.tsx
blob: 6180ef20d6d798b8ad9884a46ae0ceef198b3bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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(30);

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',
    marginRight: '3%',
    marginVertical: '2%',
    alignSelf: 'flex-end',
  },
  background: {
    backgroundColor: TAGG_LIGHT_BLUE,
  },
  outline: {
    borderWidth: 1,
    borderColor: TAGG_LIGHT_BLUE,
  },
});

export default ChatInputSubmit;