-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.jsx
34 lines (29 loc) · 909 Bytes
/
index.jsx
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
import React from 'react'
import Radios from 'patchkit-radios'
import t from 'patchwork-translations'
export default class FlagMsgForm extends React.Component {
constructor(props) {
super(props)
this.state = { reason: 'spam' }
}
componentDidMount() {
this.props.setIsValid(true)
}
onChange(reason) {
this.setState({ reason: reason })
}
submit(cb) {
this.props.onSubmit(this.state.reason, cb)
}
render() {
return <div>
<form className="inline" onSubmit={e=>e.preventDefault()}>
<fieldset>
<h1><i className="fa fa-flag" /> {t('flag.FlagThisMsg')}</h1>
<div>{t('flag.FlagMsgInfo')}</div>
<Radios group="reason" options={[{ label: t('flag.Spam'), value: 'spam', defaultChecked: true }, { label: t('flag.Abusive'), value: 'abuse' }]} onChange={this.onChange.bind(this)} />
</fieldset>
</form>
</div>
}
}