Line clamp on content thumbnails for description

This commit is contained in:
austinkelsay 2024-10-13 17:19:49 -05:00
parent 03b771283a
commit cae0396092
3 changed files with 11 additions and 6 deletions

View File

@ -96,9 +96,14 @@ export function CourseTemplate({ course }) {
WebkitLineClamp: "2"
}}>
<div className="w-full flex flex-row justify-between items-start">
{(course.summary || course.description)?.split('\n').map((line, index) => (
{/* <div className="flex flex-col max-h-[200px]">
{(course.summary || course.description)?.split('\n').map((line, index) => (
<span className="line-clamp-2" key={index}>{line}</span>
))}
</div> */}
<p className="line-clamp-2">{(course.summary || course.description)?.split('\n').map((line, index) => (
<span key={index}>{line}</span>
))}
))}</p>
<div className="flex flex-col items-end">
{
course?.price && course?.price > 0 ? (

View File

@ -85,9 +85,9 @@ export function DocumentTemplate({ document }) {
WebkitLineClamp: "2"
}}>
<div className="w-full flex flex-row justify-between items-start">
{(document.summary || document.description)?.split('\n').map((line, index) => (
<p className="line-clamp-2">{(document.summary || document.description)?.split('\n').map((line, index) => (
<span key={index}>{line}</span>
))}
))}</p>
<div className="flex flex-col items-end">
{
document?.price && document?.price > 0 ? (

View File

@ -87,9 +87,9 @@ export function VideoTemplate({ video }) {
WebkitLineClamp: "2"
}}>
<div className="w-full flex flex-row justify-between items-start">
{(video.summary || video.description)?.split('\n').map((line, index) => (
<p className="line-clamp-2">{(video.summary || video.description)?.split('\n').map((line, index) => (
<span key={index}>{line}</span>
))}
))}</p>
<div className="flex flex-col items-end">
{
video?.price && video?.price > 0 ? (