feat: 🎨 add ripple to star react
This commit is contained in:
parent
515ccfecb1
commit
c1ee6140fc
@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<button class="skdfgljsdkf _button" @click="star()">
|
||||
<button class="skdfgljsdkf _button" @click="star($event)">
|
||||
<i class="fas fa-star"></i>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Note } from 'misskey-js/built/entities';
|
||||
import Ripple from '@/components/MkRipple.vue';
|
||||
import { pleaseLogin } from '@/scripts/please-login';
|
||||
import * as os from '@/os';
|
||||
|
||||
@ -13,12 +14,19 @@ const props = defineProps<{
|
||||
note: Note;
|
||||
}>();
|
||||
|
||||
function star(): void {
|
||||
function star(ev?: MouseEvent): void {
|
||||
pleaseLogin();
|
||||
os.api('notes/reactions/create', {
|
||||
noteId: props.note.id,
|
||||
reaction: '⭐',
|
||||
});
|
||||
const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined;
|
||||
if (el) {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const x = rect.left + (el.offsetWidth / 2);
|
||||
const y = rect.top + (el.offsetHeight / 2);
|
||||
os.popup(Ripple, { x, y }, {}, 'end');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -69,9 +69,9 @@ os.api('admin/abuse-user-reports', {
|
||||
});
|
||||
|
||||
os.api('latest-version').then(res => {
|
||||
const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ''), 10);
|
||||
const cleanVersion = parseInt(version.replace(/[^0-9]/g, ''), 10);
|
||||
if (cleanRes > cleanVersion) {
|
||||
const cleanRes = res?.tag_name.replace(/[^0-9]/g, '');
|
||||
const cleanVersion = version.replace(/[^0-9]/g, '');
|
||||
if (cleanRes !== cleanVersion) {
|
||||
updateAvailable = true;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user