りさ姉ボタンの実装
This commit is contained in:
parent
eb6f1f0826
commit
1e32a46edd
@ -2,6 +2,7 @@ import { changeCompose } from '../actions/compose';
|
||||
|
||||
export const UTILBTNS_GOJI = 'UTILBTNS_GOJI';
|
||||
export const UTILBTNS_HARUKIN = 'UTILBTNS_HARUKIN';
|
||||
export const UTILBTNS_RISA = 'UTILBTNS_RISA';
|
||||
|
||||
export function submitGoji (textarea) {
|
||||
return function (dispatch, getState) {
|
||||
@ -65,3 +66,24 @@ export function submitHarukinRequest () {
|
||||
type: UTILBTNS_HARUKIN
|
||||
}
|
||||
}
|
||||
|
||||
export function submitRisa (textarea) {
|
||||
return function (dispatch, getState) {
|
||||
if (!textarea.value) {
|
||||
let text = [
|
||||
"@risa2"
|
||||
].join("\r\n");
|
||||
|
||||
dispatch(submitRisaRequest());
|
||||
dispatch(changeCompose(text));
|
||||
|
||||
textarea.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function submitRisaRequest () {
|
||||
return {
|
||||
type: UTILBTNS_RISA
|
||||
}
|
||||
}
|
@ -212,6 +212,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
handleOnGojiSubmit = () => this.props.onGojiSubmit(this.autosuggestTextarea.textarea);
|
||||
handleOnHarukinSubmit = () => this.props.onHarukinSubmit(this.autosuggestTextarea.textarea);
|
||||
handleOnRisaSubmit = () => this.props.onRisaSubmit(this.autosuggestTextarea.textarea);
|
||||
|
||||
render () {
|
||||
const { intl, onPaste, autoFocus } = this.props;
|
||||
@ -293,6 +294,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
<div className='compose-form__publish'>
|
||||
<div className='compose-form__publish-button-wrapper'>
|
||||
<Button className="compose-form__utilBtns-risa" text={intl.formatMessage(messages.utilBtns_risa)} onClick={this.handleOnRisaSubmit} block />
|
||||
<Button
|
||||
type='submit'
|
||||
text={publishText}
|
||||
|
@ -12,7 +12,8 @@ import {
|
||||
} from '../../../actions/compose';
|
||||
import {
|
||||
submitGoji,
|
||||
submitHarukin
|
||||
submitHarukin,
|
||||
submitRisa
|
||||
} from '../../../actions/UtilBtns';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
|
@ -150,6 +150,7 @@
|
||||
"compose_form.spoiler_placeholder": "ここに警告を書いてください",
|
||||
"compose_form.utilBtns_goji": "誤字盛!",
|
||||
"compose_form.utilBtns_harukin": "はるきん焼却",
|
||||
"compose_form.utilBtns_risa": "りさ姉",
|
||||
"confirmation_modal.cancel": "キャンセル",
|
||||
"confirmations.block.block_and_report": "ブロックし通報",
|
||||
"confirmations.block.confirm": "ブロック",
|
||||
|
Loading…
Reference in New Issue
Block a user