Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions components/torrent/TorrentCommentTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<template>
<div id="torrent-comment" class="flex flex-col gap-6">
<div class="flex flex-row items-center justify-between">
<h2 class="mr-1 text-2xl font-medium text-left text-neutral-content/50">
Comment
</h2>
<button
class="flex flex-col items-center justify-center w-10 h-10 duration-200 bg-transparent text-base-content/50 hover:text-base-content rounded-xl"
@click="collapsed = !collapsed"
>
<ChevronDownIcon class="w-6" :class="{ 'rotate-90': collapsed }" />
</button>
</div>
<template v-if="!collapsed">
<div class="flex flex-col w-full h-full p-6 grow bg-base-100 rounded-2xl">
<template v-if="torrent.comment">
<Markdown :source="torrent.comment" />
</template>
<template v-else>
<span class="italic text-neutral-content">No comment provided.</span>
</template>
</div>
</template>
</div>
</template>

<script setup lang="ts">
import { ChevronDownIcon } from "@heroicons/vue/24/solid";
import { TorrentResponse } from "torrust-index-types-lib";
import { PropType } from "vue";
import { ref } from "#imports";
import Markdown from "~/components/Markdown.vue";

const collapsed = ref(false);

const props = defineProps({
torrent: {
type: Object as PropType<TorrentResponse>,
required: true
}
});
</script>

<style scoped>

</style>
1 change: 1 addition & 0 deletions components/torrent/TorrentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</div>
<div v-if="torrent" class="flex flex-col flex-auto w-full gap-6">
<TorrentDescriptionTab :torrent="torrent" @updated="reloadTorrent" />
<TorrentCommentTab :torrent="torrent" @updated="reloadTorrent" />
<TorrentFilesTab :torrent="torrent" @updated="reloadTorrent" />
<TorrentTrackersTab :torrent="torrent" @updated="reloadTorrent" />
</div>
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"dompurify": "^3.0.5",
"marked": "^7.0.2",
"notiwind-ts": "^2.0.2",
"torrust-index-api-lib": "^1.0.0-alpha.1",
"torrust-index-types-lib": "^1.0.0-alpha.1",
"torrust-index-api-lib": "^1.0.0-alpha.3",
"torrust-index-types-lib": "^1.0.0-alpha.3",
"uuid": "^9.0.0"
}
}