-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7f8d8b
commit c176330
Showing
3 changed files
with
23 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,47 @@ | ||
<template> | ||
<router-link | ||
class="flex flex-col gap-3 border border-gray-200 rounded p-4 pb-2 cursor-pointer h-30 hover:bg-surface-gray-2 transition-all" | ||
:to="{ | ||
name: 'ArticlePublic', | ||
params: { | ||
articleId: article.name, | ||
}, | ||
}" | ||
> | ||
<div class="flex justify-between items-center cursor-pointer w-full"> | ||
<!-- Left Side --> | ||
<div class="flex p-2 gap-3 flex-1 max-w-[50%]"> | ||
<div class="flex flex-col gap-1.5 w-full"> | ||
<h5 class="text-lg font-semibold text-gray-800 truncate max-w-[70%]"> | ||
{{ article.title }} | ||
</h5> | ||
<div class="text-sm text-gray-600 truncate max-w-[70%]"> | ||
{{ articleSubTitle }} | ||
</div> | ||
<!-- Title and sub content --> | ||
<div class="flex gap-3 flex-1"> | ||
<div class="flex flex-col gap-1.5 w-full"> | ||
<h5 class="text-base font-medium text-gray-800 truncate"> | ||
{{ article.title }} | ||
</h5> | ||
<div class="text-p-sm text-gray-600 line-clamp-2"> | ||
{{ article.content }} | ||
</div> | ||
</div> | ||
|
||
<!-- Right Side --> | ||
<div class="flex flex-1 justify-between p-2 items-center gap-10"> | ||
<div class="flex gap-2 items-center"> | ||
<Avatar :label="article.author.name" :image="article.author.image" /> | ||
<span class="text-sm text-gray-600 flex-1 truncate">{{ | ||
article.author.name | ||
}}</span> | ||
</div> | ||
<span class="text-sm text-gray-600">{{ | ||
dayjs.tz(article.published_on).format("DD, MMM YYYY") | ||
</div> | ||
<!-- Avatar and published date --> | ||
<div class="flex justify-between items-center"> | ||
<div class="flex gap-2 items-center"> | ||
<Avatar :label="article.author.name" :image="article.author.image" /> | ||
<span class="text-sm text-gray-600 flex-1 truncate">{{ | ||
article.author.name | ||
}}</span> | ||
</div> | ||
<span class="text-sm text-gray-600">{{ | ||
dayjs.tz(article.modified).fromNow() | ||
}}</span> | ||
</div> | ||
</router-link> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import { Avatar } from "frappe-ui"; | ||
import { dayjs } from "@/dayjs"; | ||
import { Article } from "@/types"; | ||
import { dayjs } from "@/dayjs"; | ||
const props = defineProps<{ | ||
article: Article; | ||
}>(); | ||
const articleSubTitle = computed( | ||
() => | ||
props.article.content || | ||
"This article helps you understand the topic effectively." | ||
); | ||
</script> | ||
|
||
<style scoped></style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters