Skip to content

Commit

Permalink
Optional showHeartReactionButtonInNoteFooter
Browse files Browse the repository at this point in the history
  • Loading branch information
caipira113 committed Jan 17, 2024
1 parent 04bc5cc commit 5484d31
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ retryAllQueuesConfirmText: "This will temporarily increase the server load."
enableChartsForRemoteUser: "Generate remote user data charts"
enableChartsForFederatedInstances: "Generate remote instance data charts"
showClipButtonInNoteFooter: "Add \"Clip\" to note action menu"
showHeartReactionButtonInNoteFooter: "Add \"Heart\" to note action menu"
reactionsDisplaySize: "Reaction display size"
limitWidthOfReaction: "Limits the maximum width of reactions and display them in reduced size."
noteIdOrUrl: "Note ID or URL"
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大するこ
enableChartsForRemoteUser: "リモートユーザーのチャートを生成"
enableChartsForFederatedInstances: "リモートサーバーのチャートを生成"
showClipButtonInNoteFooter: "ノートのアクションにクリップを追加"
showHeartReactionButtonInNoteFooter: "ノートのアクションにハートリアクションを追加"
reactionsDisplaySize: "リアクションの表示サイズ"
limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する"
noteIdOrUrl: "ノートIDまたはURL"
Expand Down
1 change: 1 addition & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,7 @@ retryAllQueuesConfirmText: "일시적으로 서버의 부하가 증가할 수
enableChartsForRemoteUser: "리모트 사용자 차트 생성"
enableChartsForFederatedInstances: "리모트 서버 차트 생성"
showClipButtonInNoteFooter: "노트 동작에 클립 버튼 추가"
showHeartReactionButtonInNoteFooter: "노트 동작에 하트 리액션 버튼 추가"
reactionsDisplaySize: "리액션 표시 크기"
limitWidthOfReaction: "리액션의 최대 폭을 제한하고 작게 표시"
noteIdOrUrl: "노트 ID 및 URL"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-else :class="$style.footerButton" class="_button" disabled>
<i class="ti ti-ban"></i>
</button>
<button v-if="appearNote.myReaction == null" ref="heartReactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" v-tooltip="i18n.ts.like" :class="$style.footerButton" class="_button" @click.stop="heartReact()">
<button v-if="appearNote.myReaction === null && defaultStore.state.showHeartReactionButtonInNoteFooter || !defaultStore.state.showHeartReactionButtonInNoteFooter && appearNote.reactionAcceptance === 'likeOnly'" ref="heartReactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" v-tooltip="i18n.ts.like" :class="$style.footerButton" class="_button" @click.stop="heartReact()">
<i class="ti ti-heart"></i>
</button>
<button v-if="appearNote.reactionAcceptance !== 'likeOnly'" ref="reactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" :class="$style.footerButton" class="_button" @click.stop="react()">
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-else class="_button" :class="$style.noteFooterButton" disabled>
<i class="ti ti-ban"></i>
</button>
<button v-if="appearNote.myReaction == null" ref="heartReactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" v-tooltip="i18n.ts.like" :class="$style.noteFooterButton" class="_button" @click="heartReact()">
<button v-if="appearNote.myReaction === null && defaultStore.state.showHeartReactionButtonInNoteFooter || !defaultStore.state.showHeartReactionButtonInNoteFooter && appearNote.reactionAcceptance === 'likeOnly'" ref="heartReactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" v-tooltip="i18n.ts.like" :class="$style.noteFooterButton" class="_button" @click="heartReact()">
<i class="ti ti-heart"></i>
</button>
<button v-if="appearNote.reactionAcceptance !== 'likeOnly'" ref="reactButton" v-vibrate="defaultStore.state.vibrateSystem ? [30, 50, 50] : []" :class="$style.noteFooterButton" class="_button" @click="react()">
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
showHeartReactionButtonInNoteFooter: {
where: 'device',
default: false,
},
reactionsDisplaySize: {
where: 'device',
default: 'small' as 'small' | 'medium' | 'large',
Expand Down

0 comments on commit 5484d31

Please sign in to comment.