りさ姉ボタンの実装

This commit is contained in:
YoheiZuho 2023-06-30 20:21:43 +09:00
parent eb6f1f0826
commit 1e32a46edd
4 changed files with 27 additions and 1 deletions

View File

@ -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) {
@ -64,4 +65,25 @@ export function submitHarukinRequest () {
return {
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
}
}

View File

@ -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}

View File

@ -12,7 +12,8 @@ import {
} from '../../../actions/compose';
import {
submitGoji,
submitHarukin
submitHarukin,
submitRisa
} from '../../../actions/UtilBtns';
const mapStateToProps = state => ({

View File

@ -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": "ブロック",