Skip to content

Commit c88478f

Browse files
mattyateau1-liquid
andauthored
fix(frontend): 一定の条件でノート送信ボタンが意図しない見た目になる問題を修正 (#884)
Co-authored-by: あわわわとーにゅ <[email protected]>
1 parent f280ce2 commit c88478f

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

packages/frontend/src/components/MkPostForm.vue

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ SPDX-License-Identifier: AGPL-3.0-only
4848
<div :class="$style.submitInner">
4949
<template v-if="posted"></template>
5050
<template v-else-if="posting"><MkEllipsis/></template>
51-
<template v-else>{{ submitText }}</template>
52-
<i style="margin-left: 6px;" :class="posted ? 'ti ti-check' : reply ? 'ti ti-arrow-back-up' : renote ? 'ti ti-quote' : 'ti ti-send'"></i>
51+
<template v-else>
52+
<span :class="$style.submitButtonText">
53+
{{ submitText }}
54+
</span>
55+
</template>
56+
<span>
57+
<i :class="posted ? 'ti ti-check' : reply ? 'ti ti-arrow-back-up' : renote ? 'ti ti-quote' : 'ti ti-send'"></i>
58+
</span>
5359
</div>
5460
</button>
5561
</div>
@@ -109,6 +115,7 @@ import * as mfm from 'mfm-js';
109115
import * as Misskey from 'misskey-js';
110116
import insertTextAtCursor from 'insert-text-at-cursor';
111117
import { toASCII } from 'punycode.js';
118+
import type { NoteDraftItem } from '@/types/note-draft-item.js';
112119
import MkNoteSimple from '@/components/MkNoteSimple.vue';
113120
import MkNotePreview from '@/components/MkNotePreview.vue';
114121
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue';
@@ -134,7 +141,6 @@ import { miLocalStorage } from '@/local-storage.js';
134141
import { claimAchievement } from '@/scripts/achievements.js';
135142
import { emojiPicker } from '@/scripts/emoji-picker.js';
136143
import { mfmFunctionPicker } from '@/scripts/mfm-function-picker.js';
137-
import type { NoteDraftItem } from '@/types/note-draft-item.js';
138144
139145
const $i = signinRequired();
140146
@@ -770,7 +776,7 @@ async function openDrafts() {
770776
}
771777
}
772778
773-
function loadDraft(exactMatch: boolean = false) {
779+
function loadDraft(exactMatch = false) {
774780
const drafts = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}') as Record<string, NoteDraftItem>;
775781
const scope = exactMatch ? draftKey.value : draftKey.value.replace(`note:${draftId.value}`, 'note:');
776782
const draft = Object.entries(drafts).filter(([k]) => k.startsWith(scope))
@@ -968,9 +974,9 @@ async function post(ev?: MouseEvent) {
968974
type: 'error',
969975
text: err.message + '\n' + (err as any).id,
970976
});
971-
emit("postError");
977+
emit('postError');
972978
});
973-
emit("posting");
979+
emit('posting');
974980
}
975981
976982
function cancel() {
@@ -987,7 +993,7 @@ async function insertEmoji(ev: MouseEvent) {
987993
os.openEmojiPicker(
988994
(ev.currentTarget ?? ev.target) as HTMLElement,
989995
{ asReactionPicker: false },
990-
textareaEl.value
996+
textareaEl.value,
991997
);
992998
}
993999
@@ -1194,6 +1200,10 @@ defineExpose({
11941200
box-sizing: border-box;
11951201
color: var(--fgOnAccent);
11961202
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
1203+
display: flex;
1204+
gap: 6px;
1205+
align-items: center;
1206+
justify-content: center;
11971207
}
11981208
11991209
.headerRightItem {
@@ -1448,5 +1458,13 @@ defineExpose({
14481458
gap: 0;
14491459
}
14501460
1461+
.submitInner {
1462+
min-width: 20px;
1463+
}
1464+
1465+
.submitButtonText {
1466+
display: none;
1467+
}
1468+
14511469
}
14521470
</style>

0 commit comments

Comments
 (0)