aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/AcceptDeclineButtons.tsx
blob: 167148f0fb785d81ca64aac1d42fa6c874f99fa2 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React from 'react';
import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native';
import {TAGG_LIGHT_BLUE} from '../../constants';
import {ProfilePreviewType} from '../../types';
import {SCREEN_WIDTH} from '../../utils';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {normalize} from '../../utils';

interface AcceptDeclineButtonsProps {
  requester: ProfilePreviewType;
  onAccept: () => void;
  onReject: () => void;
  externalStyles?: Record<string, StyleProp<ViewStyle>>;
}
const AcceptDeclineButtons: React.FC<AcceptDeclineButtonsProps> = ({
  requester,
  onAccept,
  onReject,
  externalStyles,
}) => {
  return (
    <View style={[styles.container, externalStyles?.container]}>
      <TouchableOpacity
        style={[styles.genericButtonStyle, styles.acceptButton]}
        onPress={onAccept}>
        <Text style={[styles.buttonTitle, styles.acceptButtonTitleColor]}>
          Accept
        </Text>
      </TouchableOpacity>

      <TouchableOpacity
        style={[styles.genericButtonStyle, styles.rejectButton]}
        onPress={onReject}>
        <Text style={[styles.buttonTitle, styles.rejectButtonTitleColor]}>
          Reject
        </Text>
      </TouchableOpacity>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    height: '100%',
    flexDirection: 'column',
    justifyContent: 'space-around',
  },
  genericButtonStyle: {
    justifyContent: 'center',
    alignItems: 'center',
    width: SCREEN_WIDTH * 0.16,
    height: SCREEN_WIDTH * 0.0525,
    borderRadius: 3,
    padding: 0,
  },
  acceptButton: {
    padding: 0,
    backgroundColor: TAGG_LIGHT_BLUE,
  },
  rejectButton: {
    borderWidth: 1,
    backgroundColor: 'white',
    borderColor: TAGG_LIGHT_BLUE,
  },
  acceptButtonTitleColor: {
    color: 'white',
  },
  rejectButtonTitleColor: {
    color: TAGG_LIGHT_BLUE,
  },
  buttonTitle: {
    padding: 0,
    fontWeight: '700',
    fontSize: normalize(11),
    lineHeight: normalize(13),
    letterSpacing: normalize(0.1),
  },
});

export default AcceptDeclineButtons;