summaryrefslogtreecommitdiff
path: root/frontend/app/components/findFriends.js
blob: 0e540342aa63d15f55296c1748b08acf30a2f704 (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
import React from 'react';
import {
  StyleSheet,
  TouchableOpacity,
  View,
  ViewPropTypes,
} from 'react-native';
import {
  RkText,
  RkTheme,
} from 'react-native-ui-kitten';
import PropTypes from 'prop-types';
import { FontAwesome } from '../assets/icons';

export class FindFriends extends React.Component {
  static propTypes = {
    selected: PropTypes.bool,
    color: PropTypes.string,
    icon: PropTypes.node.isRequired,
    text: PropTypes.string.isRequired,
    onPress: PropTypes.func,
    style: ViewPropTypes.style,
  };
  static defaultProps = {
    selected: false,
    color: RkTheme.current.colors.text.base,
    onPress: (() => null),
    style: {},
  };

  render = () => {
    const color = this.props.selected ? this.props.color : RkTheme.current.colors.disabled;
    return (
      <TouchableOpacity style={[styles.wrapper, this.props.style]} onPress={this.props.onPress}>
        <View style={styles.container}>
          <View style={styles.text}>
            <RkText rkType='awesome' style={[styles.icon, { color }]}>{this.props.icon}</RkText>
            <RkText rkType='header6' style={{ color }}>{`Find Friends With ${this.props.text}`}</RkText>
          </View>
          <RkText rkType='awesome small' style={{ color }}>{FontAwesome.chevronRight}</RkText>
        </View>
      </TouchableOpacity>
    );
  };
}

let styles = StyleSheet.create({
  wrapper: {
    flex: 1,
  },
  container: {
    flex: 1,
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
    paddingVertical: 18,
  },
  text: {
    flexDirection: 'row',
  },
  icon: {
    width: 35,
  },
});