From 9f14f0ad9b8149c23c0260974311bcbaac5de46b Mon Sep 17 00:00:00 2001 From: freeplay Date: Mon, 26 Jun 2023 23:22:43 -0400 Subject: [PATCH] feat: horizontally scrolling reactions --- .../components/MkReactionsViewer.reaction.vue | 7 +++++++ .../src/components/MkReactionsViewer.vue | 20 +++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/MkReactionsViewer.reaction.vue b/packages/client/src/components/MkReactionsViewer.reaction.vue index 461628a94a..d82e134278 100644 --- a/packages/client/src/components/MkReactionsViewer.reaction.vue +++ b/packages/client/src/components/MkReactionsViewer.reaction.vue @@ -36,6 +36,10 @@ const props = defineProps<{ note: misskey.entities.Note; }>(); +const emit = defineEmits<{ + (ev: "reacted", v): void; +}>(); + const buttonRef = ref(); const canToggle = computed(() => !props.reaction.match(/@\w/) && $i); @@ -60,6 +64,7 @@ const toggleReaction = () => { noteId: props.note.id, reaction: props.reaction, }); + emit("reacted"); } }; @@ -101,6 +106,7 @@ useTooltip( padding: 0 6px; border-radius: 4px; pointer-events: all; + min-width: max-content; &.newlyAdded { animation: scaleInSmall 0.3s cubic-bezier(0, 0, 0, 1.2); :deep(.mk-emoji) { @@ -132,6 +138,7 @@ useTooltip( } &.reacted { + order: -1; background: var(--accent); &:hover { diff --git a/packages/client/src/components/MkReactionsViewer.vue b/packages/client/src/components/MkReactionsViewer.vue index fc108b4729..f5a9a6cb2e 100644 --- a/packages/client/src/components/MkReactionsViewer.vue +++ b/packages/client/src/components/MkReactionsViewer.vue @@ -1,5 +1,5 @@