feat: Show instance default reactions on welcome page instead of hardcoded

This commit is contained in:
ThatOneCalculator 2023-09-20 20:46:48 -07:00
parent 7acb5ebde9
commit 3a671e42d1
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 31 additions and 31 deletions

View file

@ -7,17 +7,12 @@
<div class="shape2"></div>
<img src="/client-assets/misskey.svg" class="misskey" />
<div class="emojis">
<MkEmoji :normal="true" :no-style="true" emoji="⭐" />
<MkEmoji :normal="true" :no-style="true" emoji="❤️" />
<MkEmoji :normal="true" :no-style="true" emoji="😆" />
<MkEmoji :normal="true" :no-style="true" emoji="🤔" />
<MkEmoji :normal="true" :no-style="true" emoji="😮" />
<MkEmoji :normal="true" :no-style="true" emoji="🎉" />
<MkEmoji :normal="true" :no-style="true" emoji="💢" />
<MkEmoji :normal="true" :no-style="true" emoji="😥" />
<MkEmoji :normal="true" :no-style="true" emoji="😇" />
<MkEmoji :normal="true" :no-style="true" emoji="🥴" />
<MkEmoji :normal="true" :no-style="true" emoji="🍮" />
<MkEmoji
v-for="reaction in defaultReactions"
:normal="true"
:no-style="true"
:emoji="reaction"
/>
</div>
<div class="main">
<img
@ -112,6 +107,7 @@ import { instanceName } from "@/config";
import * as os from "@/os";
import { instance } from "@/instance";
import { i18n } from "@/i18n";
import { defaultReactions } from "@/store";
const meta = ref();
const stats = ref();
@ -184,13 +180,15 @@ function showMenu(ev) {
os.pageWindow("/about-firefish");
},
},
instance.tosUrl ? {
text: i18n.ts.tos,
icon: "ph-scroll ph-bold ph-lg",
action: () => {
window.open(instance.tosUrl, "_blank");
},
} : null,
instance.tosUrl
? {
text: i18n.ts.tos,
icon: "ph-scroll ph-bold ph-lg",
action: () => {
window.open(instance.tosUrl, "_blank");
},
}
: null,
],
ev.currentTarget ?? ev.target,
);

View file

@ -17,6 +17,20 @@ const menuOptions = [
"search",
];
export const defaultReactions = [
"⭐",
"❤️",
"😆",
"🤔",
"😮",
"🎉",
"💢",
"😥",
"😇",
"🥴",
"🍮",
];
// TODO: それぞれいちいちwhereとかdefaultというキーを付けなきゃいけないの冗長なのでなんとかする(ただ型定義が面倒になりそう)
// あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない
export const defaultStore = markRaw(
@ -83,19 +97,7 @@ export const defaultStore = markRaw(
},
reactions: {
where: "account",
default: [
"⭐",
"❤️",
"😆",
"🤔",
"😮",
"🎉",
"💢",
"😥",
"😇",
"🥴",
"🍮",
],
default: defaultReactions,
},
mutedWords: {
where: "account",