From c7139b92add64ca01784f8433facda2ab273f7b1 Mon Sep 17 00:00:00 2001 From: ArneBo Date: Sun, 26 Jan 2025 00:45:05 +0100 Subject: [PATCH] refactor(front): channel card --- front/src/components/audio/ChannelCard.vue | 72 ++++++++-------------- front/src/components/ui/Card.vue | 13 +++- 2 files changed, 36 insertions(+), 49 deletions(-) diff --git a/front/src/components/audio/ChannelCard.vue b/front/src/components/audio/ChannelCard.vue index cb0e7623e..88540e67b 100644 --- a/front/src/components/audio/ChannelCard.vue +++ b/front/src/components/audio/ChannelCard.vue @@ -10,7 +10,8 @@ import { useRouter } from 'vue-router' import moment from 'moment' import PlayButton from '~/components/audio/PlayButton.vue' -import TagsList from '~/components/tags/List.vue' +import Card from '~/components/ui/Card.vue' +import Spacer from '~/components/ui/Spacer.vue' interface Props { object: Channel @@ -21,7 +22,7 @@ const store = useStore() const router = useRouter() const imageUrl = computed(() => props.object.artist?.cover - ? store.getters['instance/absoluteUrl'](props.object.artist.cover.urls.medium_square_crop) + ? store.getters['instance/absoluteUrl'](props.object.artist.cover.urls.large_square_crop) : null ) @@ -43,64 +44,39 @@ const updatedAgo = computed(() => moment(props.object.artist?.modification_date) diff --git a/front/src/components/ui/Card.vue b/front/src/components/ui/Card.vue index 2754db14e..cfc023d95 100644 --- a/front/src/components/ui/Card.vue +++ b/front/src/components/ui/Card.vue @@ -24,6 +24,10 @@ const props = defineProps<{ & WidthProps >() +const tags = computed(() => { + return props.tags?.slice(0, 2) +}) + const image = typeof props.image === 'string' ? { src: props.image } : props.image const isExternalLink = computed(() => { @@ -82,7 +86,13 @@ const attributes = computed(() => - + #{{ tag }} @@ -206,6 +216,7 @@ const attributes = computed(() => >.tags { padding: 0 var(--fw-card-padding); margin-top: 8px; + align-self: center; } >.content {