mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-03 03:15:58 +02:00
refactor(frontend): refactor tips
This commit is contained in:
@@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<div style="font-weight: bold;"><i class="ti ti-bulb"></i> {{ i18n.ts.tip }}:</div>
|
||||
<div><slot></slot></div>
|
||||
<div>
|
||||
<MkButton inline primary rounded small @click="closeTip()"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
|
||||
<MkButton inline primary rounded small @click="_closeTip()"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
|
||||
<button class="_button" style="padding: 8px; margin-left: 4px;" @click="showMenu"><i class="ti ti-dots"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -19,20 +19,17 @@ import { i18n } from '@/i18n.js';
|
||||
import { store } from '@/store.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { hideAllTips } from '@/store.js';
|
||||
import { TIPS, hideAllTips, closeTip } from '@/tips.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
k: keyof (typeof store['s']['tips']);
|
||||
k: typeof TIPS[number];
|
||||
warn?: boolean;
|
||||
}>(), {
|
||||
warn: false,
|
||||
});
|
||||
|
||||
function closeTip() {
|
||||
store.set('tips', {
|
||||
...store.r.tips.value,
|
||||
[props.k]: true,
|
||||
});
|
||||
function _closeTip() {
|
||||
closeTip(props.k);
|
||||
}
|
||||
|
||||
function showMenu(ev: MouseEvent) {
|
||||
|
||||
Reference in New Issue
Block a user