From da648e151702628c28f4ffe3d84085daf18ced11 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Fri, 17 Feb 2023 00:06:49 -0500 Subject: [PATCH] Add buttons & link previews to subnotes, start of new thread design Should've made them separate commits but eeek I started working on them at the same time D: --- packages/client/src/components/MkNote.vue | 66 +------- .../client/src/components/MkNoteDetailed.vue | 2 +- .../client/src/components/MkNoteFooter.vue | 159 ++++++++++++++++++ packages/client/src/components/MkNoteSub.vue | 12 +- .../components/MkReactionsViewer.reaction.vue | 1 + .../src/components/MkReactionsViewer.vue | 6 +- 6 files changed, 177 insertions(+), 69 deletions(-) create mode 100644 packages/client/src/components/MkNoteFooter.vue diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index ee6c5770f..20225843a 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -71,26 +71,7 @@ {{ appearNote.channel.name }} - + @@ -113,15 +94,12 @@ import type * as misskey from 'calckey-js'; import MkNoteSub from '@/components/MkNoteSub.vue'; import XNoteHeader from '@/components/MkNoteHeader.vue'; import XNoteSimple from '@/components/MkNoteSimple.vue'; -import XReactionsViewer from '@/components/MkReactionsViewer.vue'; import XMediaList from '@/components/MkMediaList.vue'; import XCwButton from '@/components/MkCwButton.vue'; +import MkNoteFooter from '@/components/MkNoteFooter.vue'; import XPoll from '@/components/MkPoll.vue'; -import XStarButton from '@/components/MkStarButton.vue'; import XRenoteButton from '@/components/MkRenoteButton.vue'; -import XQuoteButton from '@/components/MkQuoteButton.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; -import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; import MkVisibility from '@/components/MkVisibility.vue'; import { pleaseLogin } from '@/scripts/please-login'; import { focusPrev, focusNext } from '@/scripts/focus'; @@ -170,7 +148,6 @@ const isRenote = ( const el = ref(); const menuButton = ref(); -const starButton = ref>(); const renoteButton = ref>(); const renoteTime = ref(); const reactButton = ref(); @@ -187,7 +164,6 @@ const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); const translation = ref(null); const translating = ref(false); const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null; -const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance); const keymap = { 'r': () => reply(true), @@ -229,14 +205,6 @@ function react(viaKeyboard = false): void { }); } -function undoReact(note): void { - const oldReaction = note.myReaction; - if (!oldReaction) return; - os.api('notes/reactions/delete', { - noteId: note.id, - }); -} - const currentClipPage = inject | null>('currentClipPage', null); function onContextmenu(ev: MouseEvent): void { @@ -594,36 +562,6 @@ function readPromo() { font-size: 80%; } } - - > .footer { - display: flex; - flex-wrap: wrap; - > .button { - margin: 0; - padding: 8px; - opacity: 0.7; - flex-grow: 1; - max-width: 3.5em; - width: max-content; - min-width: max-content; - &:first-of-type { - margin-left: -.5em; - } - &:hover { - color: var(--fgHighlighted); - } - - > .count { - display: inline; - margin: 0 0 0 8px; - opacity: 0.7; - } - - &.reacted { - color: var(--accent); - } - } - } } } diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index fab06f1ab..fa6b0bd89 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -53,7 +53,7 @@

-
+
diff --git a/packages/client/src/components/MkNoteFooter.vue b/packages/client/src/components/MkNoteFooter.vue new file mode 100644 index 000000000..ff5eb7702 --- /dev/null +++ b/packages/client/src/components/MkNoteFooter.vue @@ -0,0 +1,159 @@ + + + + + + diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index c0766ec5f..a0277d86e 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -16,10 +16,14 @@
+