<commit_before>// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React, {PropTypes, PureComponent} from 'react';
import {
    StyleSheet,
    TouchableHighlight,
    View,
    Text
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ImagePicker from 'react-native-image-crop-picker';
import {RequestStatus} from 'mattermost-redux/constants';

import Autocomplete from 'app/components/autocomplete';
import FileUploadPreview from 'app/components/file_upload_preview';
import FormattedText from 'app/components/formatted_text';
import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';

const MAX_CONTENT_HEIGHT = 100;

export default class PostTextbox extends PureComponent {
    static propTypes = {
        currentUserId: PropTypes.string.isRequired,
        typing: PropTypes.array.isRequired,
        teamId: PropTypes.string.isRequired,
        channelId: PropTypes.string.isRequired,
        files: PropTypes.array,
        rootId: PropTypes.string,
        value: PropTypes.string.isRequired,
        onChangeText: PropTypes.func.isRequired,
        theme: PropTypes.object.isRequired,
        uploadFileRequestStatus: PropTypes.string.isRequired,
        actions: PropTypes.shape({
            closeModal: PropTypes.func.isRequired,
            createPost: PropTypes.func.isRequired,
            handleUploadFiles: PropTypes.func.isRequired,
            showOptionsModal: PropTypes.func.isRequired,
            userTyping: PropTypes.func.isRequired
        }).isRequired
    };

    static defaultProps = {
        rootId: '',
        onSelectionChange: () => true
    };

    constructor(props) {
        super(props);

        this.state = {
            contentHeight: 0
        };
    }

    blur = () => {
        this.refs.input.getWrappedInstance().blur();
    };

    handleContentSizeChange = (e) => {
        this.setState({
            contentHeight: e.nativeEvent.contentSize.height
        });
    };

    sendMessage = () => {
        if ((this.props.value.trim().length === 0 && this.props.files.length === 0) || this.props.uploadFileRequestStatus === RequestStatus.STARTED) {
            return;
        }
<commit_msg>fix post textbox default props (#378)<commit_after>// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React, {PropTypes, PureComponent} from 'react';
import {
    StyleSheet,
    TouchableHighlight,
    View,
    Text
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ImagePicker from 'react-native-image-crop-picker';
import {RequestStatus} from 'mattermost-redux/constants';

import Autocomplete from 'app/components/autocomplete';
import FileUploadPreview from 'app/components/file_upload_preview';
import FormattedText from 'app/components/formatted_text';
import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';

const MAX_CONTENT_HEIGHT = 100;

export default class PostTextbox extends PureComponent {
    static propTypes = {
        currentUserId: PropTypes.string.isRequired,
        typing: PropTypes.array.isRequired,
        teamId: PropTypes.string.isRequired,
        channelId: PropTypes.string.isRequired,
        files: PropTypes.array,
        rootId: PropTypes.string,
        value: PropTypes.string.isRequired,
        onChangeText: PropTypes.func.isRequired,
        theme: PropTypes.object.isRequired,
        uploadFileRequestStatus: PropTypes.string.isRequired,
        actions: PropTypes.shape({
            closeModal: PropTypes.func.isRequired,
            createPost: PropTypes.func.isRequired,
            handleUploadFiles: PropTypes.func.isRequired,
            showOptionsModal: PropTypes.func.isRequired,
            userTyping: PropTypes.func.isRequired
        }).isRequired
    };

    static defaultProps = {
        rootId: '',
        files: [],
        value: '',
        onSelectionChange: () => true
    };

    constructor(props) {
        super(props);

        this.state = {
            contentHeight: 0
        };
    }

    blur = () => {
        this.refs.input.getWrappedInstance().blur();
    };

    handleContentSizeChange = (e) => {
        this.setState({
            contentHeight: e.nativeEvent.contentSize.height
        });
    };

    sendMessage = () => {
        if ((this.props.value.trim().length === 0 && this.props.files.length === 0) || this.props.uploadFileRequestStatus === RequestStatus.STARTED) {
            return;
        }

{'fraction_non_alphanumeric': 0.10684298908480269, 'fraction_numerical': 0.004827875734676742, 'mean_word_length': 2.951077943615257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6191125', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1305, 'n_words': 267}