<commit_before>import React, {Component} from 'react';

import RadioGroup from 'dist/RadioGroup';
import TextField from 'dist/TextField';
import RaisedButton from 'dist/RaisedButton';
import Toaster from 'dist/Toaster';

import 'sass/containers/app/modules/message/ToasterExamples.scss';

export default class ToasterExamples extends Component {

    constructor(props) {

        super(props);

        this.state = {
            type: '',
            title: 'Title',
            message: 'Message'
        };

        this.updateField = this::this.updateField;
        this.addToast = this::this.addToast;

    }

    updateField(key, value) {
        let state = {};
        state[key] = value;
        this.setState(state);
    }

    addToast() {

        const {type, title, message} = this.state;

        this.refs.toaster.addToast({
            type,
            title,
            message
        });

    }

    render() {

        const {type, title, message} = this.state;

        return (
            <div className="example toaster-examples">

                <div className="examples">
                    <div className="examples-title">Toaster</div>
                    <div className="examples-wrapper">

                        <div className="field-group">
                            <label className="text-field-label">Type</label>
                            <RadioGroup data={[{
                                label: 'Default',
                                value: ''
                            }, {
                                label: 'Success',
                                value: 'success'
                            }, {
                                label: 'Warning',
                                value: 'warning'
                            }, {
                                label: 'Error',
                                value: 'error'
                            }]}
                                        value={type}
                                        onChange={(value) => {
                                            this.updateField('type', value);
                                        }}/>
                        </div>

                        <div className="field-group">
                            <label className="text-field-label">Title</label>
                            <TextField value={title}
                                       onChange={(value) => {
                                           this.updateField('title', value);
                                       }}/>
                        </div>

                        <div className="field-group">
                            <label className="text-field-label">Message</label>
                            <TextField value={message}
                                       onChange={(value) => {
                                           this.updateField('message', value);
                                       }}/>
                        </div>

                        <RaisedButton className="show-toast-button"
                                      value="Show Toaster"
                                      buttonStyle={RaisedButton.buttonStyle.PRIMARY}
                                      onTouchTap={this.addToast}/>

                        <Toaster ref="toaster"/>

                    </div>
                </div>

            </div>
        );
    }
};<commit_msg>bug fixed<commit_after>import React, {Component} from 'react';

import RadioGroup from 'dist/RadioGroup';
import TextField from 'dist/TextField';
import RaisedButton from 'dist/RaisedButton';
import Toaster from 'dist/Toaster';
import Theme from 'dist/Theme';

import 'sass/containers/app/modules/message/ToasterExamples.scss';

export default class ToasterExamples extends Component {

    constructor(props) {

        super(props);

        this.state = {
            type: '',
            title: 'Title',
            message: 'Message'
        };

        this.updateField = this::this.updateField;
        this.addToast = this::this.addToast;

    }

    updateField(key, value) {
        let state = {};
        state[key] = value;
        this.setState(state);
    }

    addToast() {

        const {type, title, message} = this.state;

        this.refs.toaster.addToast({
            type,
            title,
            message
        });

    }

    render() {

        const {type, title, message} = this.state;

        return (
            <div className="example toaster-examples">

                <div className="examples">
                    <div className="examples-title">Toaster</div>
                    <div className="examples-wrapper">

                        <div className="field-group">
                            <label className="text-field-label">Type</label>
                            <RadioGroup data={[{
                                label: 'Default',
                                value: ''
                            }, {
                                label: 'Success',
                                value: 'success'
                            }, {
                                label: 'Warning',
                                value: 'warning'
                            }, {
                                label: 'Error',
                                value: 'error'
                            }]}
                                        value={type}
                                        onChange={(value) => {
                                            this.updateField('type', value);
                                        }}/>
                        </div>

                        <div className="field-group">
                            <label className="text-field-label">Title</label>
                            <TextField value={title}
                                       onChange={(value) => {
                                           this.updateField('title', value);
                                       }}/>
                        </div>

                        <div className="field-group">
                            <label className="text-field-label">Message</label>
                            <TextField value={message}
                                       onChange={(value) => {
                                           this.updateField('message', value);
                                       }}/>
                        </div>

                        <RaisedButton className="show-toast-button"
                                      value="Show Toaster"
                                      buttonStyle={Theme.PRIMARY}
                                      onTouchTap={this.addToast}/>

                        <Toaster ref="toaster"/>

                    </div>
                </div>

            </div>
        );
    }
};
{'fraction_non_alphanumeric': 0.10298616168973052, 'fraction_numerical': 0.0, 'mean_word_length': 0.8718647764449291, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4667398', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1411, 'n_words': 267}