refactor: 🔥 Remove old files

This commit is contained in:
Jesse Wierzbinski 2024-12-02 22:29:08 +01:00
parent 348b1ba2b0
commit 42e0b38fd8
No known key found for this signature in database
6 changed files with 22 additions and 252 deletions

View file

@ -27,9 +27,9 @@
</span>
</div>
<div class="flex flex-col gap-1 justify-center items-end" v-if="!smallLayout">
<span class="text-xs text-muted-foreground" :title="visibilities[visibility].text">
<NuxtLink :href="noteUrlAsPath" class="text-xs text-muted-foreground" :title="visibilities[visibility].text">
<component :is="visibilities[visibility].icon" class="size-5" />
</span>
</NuxtLink>
</div>
</div>
</template>
@ -44,7 +44,7 @@ import type {
import { AtSign, Globe, Lock, LockOpen } from "lucide-vue-next";
import CopyableText from "./copyable-text.vue";
const { acct, createdAt, url } = defineProps<{
const { acct, createdAt, url, noteUrl } = defineProps<{
avatar: string;
cornerAvatar?: string;
acct: string;
@ -52,6 +52,7 @@ const { acct, createdAt, url } = defineProps<{
emojis: Emoji[];
visibility: StatusVisibility;
url: string;
noteUrl: string;
createdAt: Date;
smallLayout?: boolean;
}>();
@ -59,6 +60,7 @@ const { acct, createdAt, url } = defineProps<{
const [username, instance] = acct.split("@");
const digitRegex = /\d/;
const urlAsPath = new URL(url).pathname;
const noteUrlAsPath = new URL(noteUrl).pathname;
const timeAgo = useTimeAgo(createdAt, {
messages: {
justNow: "now",

View file

@ -4,16 +4,23 @@
<ReblogHeader v-if="note.reblog" :avatar="note.account.avatar" :display-name="note.account.display_name"
:url="reblogAccountUrl" :emojis="note.account.emojis" />
<Header :avatar="noteToUse.account.avatar" :corner-avatar="note.reblog ? note.account.avatar : undefined"
:acct="noteToUse.account.acct" :display-name="noteToUse.account.display_name"
:note-url="url" :acct="noteToUse.account.acct" :display-name="noteToUse.account.display_name"
:visibility="noteToUse.visibility" :url="accountUrl" :created-at="new Date(noteToUse.created_at)"
:small-layout="smallLayout" :emojis="noteToUse.account.emojis" />
</CardHeader>
<CardContent>
<Content :content="noteToUse.content" :quote="note.quote ?? undefined" :attachments="noteToUse.media_attachments" :plain-content="noteToUse.plain_content ?? undefined" :emojis="noteToUse.emojis" />
<Content :content="noteToUse.content" :quote="note.quote ?? undefined"
:attachments="noteToUse.media_attachments" :plain-content="noteToUse.plain_content ?? undefined"
:emojis="noteToUse.emojis" />
</CardContent>
<CardFooter v-if="!hideActions" class="p-4 pt-0">
<Actions :reply-count="noteToUse.replies_count" :like-count="noteToUse.favourites_count" :url="url"
:api-note-string="JSON.stringify(note, null, 4)" :reblog-count="noteToUse.reblogs_count" :remote-url="noteToUse.url" :is-remote="isRemote" :author-id="noteToUse.account.id" @edit="useEvent('composer:edit', note)" @reply="useEvent('composer:reply', note)" @quote="useEvent('composer:quote', note)" @delete="useEvent('note:delete', note)" :note-id="noteToUse.id" :liked="noteToUse.favourited ?? false" :reblogged="noteToUse.reblogged ?? false" />
:api-note-string="JSON.stringify(note, null, 4)" :reblog-count="noteToUse.reblogs_count"
:remote-url="noteToUse.url" :is-remote="isRemote" :author-id="noteToUse.account.id"
@edit="useEvent('composer:edit', note)" @reply="useEvent('composer:reply', note)"
@quote="useEvent('composer:quote', note)" @delete="useEvent('note:delete', note)"
:note-id="noteToUse.id" :liked="noteToUse.favourited ?? false"
:reblogged="noteToUse.reblogged ?? false" />
</CardFooter>
</Card>
</template>

View file

@ -1,41 +0,0 @@
<template>
<component :is="disableLink ? 'div' : NuxtLink" :href="accountUrl" class="flex flex-row">
<Skeleton :enabled="!account" shape="rect" class="!h-12 w-12">
<div class="shrink-0">
<Avatar class="h-12 w-12 rounded ring-1 ring-white/5" :src="account?.avatar"
:alt="`${account?.acct}'s avatar'`" />
</div>
</Skeleton>
<div class="flex flex-col items-start justify-around ml-4 grow overflow-hidden">
<div class="flex flex-row items-center justify-between w-full">
<div class="font-semibold text-gray-200 line-clamp-1 break-all">
<Skeleton :enabled="!account" :min-width="90" :max-width="170" shape="rect">
{{
account?.display_name }}
</Skeleton>
</div>
</div>
<span class="text-gray-400 text-sm line-clamp-1 break-all w-full">
<Skeleton :enabled="!account" :min-width="130" :max-width="250" shape="rect">
@{{
account?.acct
}}
</Skeleton>
</span>
</div>
</component>
</template>
<script lang="ts" setup>
import type { Account } from "@versia/client/types";
import Avatar from "~/components/avatars/avatar.vue";
import Skeleton from "~/components/skeleton/Skeleton.vue";
import { NuxtLink } from "#components";
const props = defineProps<{
account?: Account;
disableLink?: boolean;
}>();
const accountUrl = props.account && `/@${props.account.acct}`;
</script>