<commit_before>import React, { Component, PropTypes } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as commonActions from '../../actions/common/common'
import cs from 'classnames'

import '../../styles/common.scss'
class Notification extends Component {
    constructor(props) {
        super(props)
        this.state = {

        }
    }

    componentWillReceiveProps(nextProps) {
        const {commonActions} = this.props
        if (nextProps.noticeIsActive) {
            setTimeout(() => {
                commonActions.hideNotice()
            }, 3000)
        }
    }

    render() {
        const {notificationType, noticeIsActive, noticeContent} = this.props
        console.log (notificationType, noticeIsActive, noticeContent)
        let type = 'alert alert-' + notificationType
        return (
            <div className={cs(type,{'alert-animation': noticeIsActive})} role="role" ref="notification">{noticeContent}</div>
        )
    }
}

Notification.propTypes = {
    noticeIsActive: PropTypes.bool.isRequired,
    notificationType: PropTypes.string.isRequired,
    noticeContent:  PropTypes.string.isRequired
}

const mapStateToProps = (state) => ({
    noticeIsActive: state.common.common.noticeIsActive,
    notificationType: state.common.common.notificationType,
    noticeContent: state.common.common.noticeContent
})

const mapDispatchToProps = (dispatch) => ({
    commonActions: bindActionCreators(commonActions, dispatch)
})

export default connect(mapStateToProps, mapDispatchToProps)(Notification)
<commit_msg>fix(frontend): fix the bug about nitification position<commit_after>import React, { Component, PropTypes } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as commonActions from '../../actions/common/common'
import cs from 'classnames'

import '../../styles/common.scss'
class Notification extends Component {
    constructor(props) {
        super(props)
        this.state = {

        }
    }

    componentWillReceiveProps(nextProps) {
        const {commonActions} = this.props
        if (nextProps.noticeIsActive) {
            setTimeout(() => {
                commonActions.hideNotice()
            }, 3000)
        }
    }

    render() {
        const {notificationType, noticeIsActive, noticeContent} = this.props
        console.log (notificationType, noticeIsActive, noticeContent)
        let type = 'alert alert-' + notificationType
        return (
            <div className={cs(type,{'alert-animation': noticeIsActive},{'hidden': !noticeIsActive})} role="role" ref="notification">{noticeContent}</div>
        )
    }
}

Notification.propTypes = {
    noticeIsActive: PropTypes.bool.isRequired,
    notificationType: PropTypes.string.isRequired,
    noticeContent:  PropTypes.string.isRequired
}

const mapStateToProps = (state) => ({
    noticeIsActive: state.common.common.noticeIsActive,
    notificationType: state.common.common.notificationType,
    noticeContent: state.common.common.noticeContent
})

const mapDispatchToProps = (dispatch) => ({
    commonActions: bindActionCreators(commonActions, dispatch)
})

export default connect(mapStateToProps, mapDispatchToProps)(Notification)

{'fraction_non_alphanumeric': 0.11393568147013783, 'fraction_numerical': 0.002450229709035222, 'mean_word_length': 3.3546666666666667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '5890423', 'n_tokens_mistral': 882, 'n_tokens_neox': 871, 'n_words': 183}