style: Mobile Styles
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-24 14:16:13 +01:00
parent 5534f00a7d
commit 91592b06d7
5 changed files with 26 additions and 14 deletions

View File

@@ -71,6 +71,18 @@ function resolveStatus(status: string) {
return bookRecommendationStore.statusOptions.find(option => option.value === status)
}
const rows = computed(() => {
// return all bookRecommendationStore.recommendations but add actions
return bookRecommendationStore.recommendations.map((recommendation) => {
return {
...recommendation,
actions: {
class: 'max-w-96',
},
}
})
})
onMounted(() => {
$echo.private(`BookRecommendation`)
.listen('.BookRecommendationUpdated', (e) => {
@@ -86,7 +98,6 @@ onMounted(() => {
$echo.private(`Vote`)
.listen('.VoteCreated', (e) => {
console.log(e)
bookRecommendationStore.createVoteWS(e.vote)
})
})
@@ -95,18 +106,13 @@ onMounted(() => {
<template>
<div>
<NewBookRecommendation />
<UTable :sort="sort" :loading="bookRecommendationStore.fetchRecommendationsStatus === 'pending'" :columns="columns" :rows="bookRecommendationStore.recommendations">
<UTable :ui="{ td: { base: 'max-w-[0] truncate' } }" :sort="sort" :loading="bookRecommendationStore.fetchRecommendationsStatus === 'pending'" :columns="columns" :rows="rows">
<template #created_at-data="{ row }">
<div>{{ dayjs(row.created_at).format('DD.MM.YYYY') }}</div>
</template>
<template #published_at-data="{ row }">
<div>{{ dayjs(row.published_at).format('DD.MM.YYYY') }}</div>
</template>
<template #description-data="{ row }">
<div v-if="row.description">
{{ `${row.description.substring(0, 50)}...` }}
</div>
</template>
<template #votes-data="{ row }">
{{ row.votes.length }}
</template>
@@ -116,7 +122,7 @@ onMounted(() => {
</UBadge>
</template>
<template #actions-data="{ row }">
<div class="flex space-x-2">
<div class="flex max-w-full space-x-2">
<CastVote :row="row" />
<EditBookRecommendation :row="row" />
<DeleteBookRecommendation :row="row" />