summaryrefslogtreecommitdiff
path: root/frontend/app/components/socialBar/index.js
blob: 5cf3fc2ae726380ef9c83979016e9615896f65ac (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
import React from 'react';
import { View } from 'react-native';
import {
  RkText,
  RkButton,
  RkComponent,
} from 'react-native-ui-kitten';
import { FontAwesome } from '../../assets/icons';

export class SocialBar extends RkComponent {
  componentName = 'SocialBar';
  typeMapping = {
    container: {},
    section: {},
    icon: {},
    label: {},
  };
  static data = {
    comments: '26',
    is_solved: "Doesn't solved",
  };

  constructor(props) {
    super(props);
    this.state = {
      comments: this.props.comments,
      is_solved: this.props.is_solved || SocialBar.data.is_solved,
    };
  }


  onCommentButtonPressed = () => {
  };


  render() {
    const {
      container, section, icon, label,
    } = this.defineStyles();

    const comments = this.state.comments + (this.props.showLabel ? ' Comments' : '');
    const is_solved = this.state.is_solved + (this.props.showLabel ? '' : '');

    return (
      <View style={container}>
        <View style={section}>
          <RkButton rkType='clear' onPress={this.onCommentButtonPressed}>
            <RkText rkType='awesome hintColor' style={icon}>{FontAwesome.comment}</RkText>
            <RkText rkType='primary4 hintColor' style={label}>{comments}</RkText>
          </RkButton>
        </View>
        <View style={section}>
          <RkButton rkType='clear' >
            <RkText rkType='awesome hintColor' style={icon}>{FontAwesome.slashEye}</RkText>
            <RkText rkType='primary4 hintColor' style={label}>{is_solved}</RkText>
          </RkButton>
        </View>
      </View>
    );
  }
}