Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: do not truncate for promo headline and summary #5008

Merged
merged 1 commit into from
Oct 3, 2023
Merged
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
26 changes: 18 additions & 8 deletions src/pages/Portfolio/ImpactDashboard/EducationPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
v-if="!loading"
:href="url"
@click="trackEvent('blog-headline')"
class="tw-text-h3 text-overflow tw-line-clamp-2 tw-mb-0.5 tw-decoration-white tw-cursor-pointer"
class="tw-text-h3 text-overflow tw-decoration-white tw-cursor-pointer"
:class="{ 'tw-line-clamp-2' : truncateHeadline }"
>
{{ headline }}
</a>
<kv-loading-placeholder v-else class="placeholder" :style="{ height: '2rem' }" />
<p v-if="!loading" class="text-overflow tw-line-clamp-3 md:tw-line-clamp-4">
<p
v-if="!loading" class="text-overflow tw-mt-0.5"
:class="{ 'tw-line-clamp-3 md:tw-line-clamp-4' : truncateSummary }"
>
{{ summary }}
</p>
<kv-loading-placeholder v-else class="placeholder" :style="{ height: '2rem' }" />
Expand Down Expand Up @@ -57,7 +61,7 @@ export default {
sourceSizes: [
{
width: 312,
height: 217,
height: 184,
media: 'min-width: 1025px',
},
{
Expand All @@ -67,7 +71,7 @@ export default {
},
{
width: 278,
height: 200,
height: 180,
media: 'min-width: 0px',
},
]
Expand All @@ -82,6 +86,12 @@ export default {
imageUrl() {
return this.post?.image?.fields?.file?.url ?? '';
},
truncateHeadline() {
return !this.post?.promoHeadline;
},
truncateSummary() {
return !this.post?.promoSummary;
},
headline() {
return this.post?.promoHeadline ?? this.post?.title ?? '';
},
Expand All @@ -97,7 +107,7 @@ export default {

<style lang="postcss" scoped>
.card-container {
height: 387px;
height: 395px;
max-width: 344px;
@apply tw-block tw-bg-eco-green-4 tw-rounded tw-p-2 tw-grid-rows-3 tw-decoration-white tw-mx-auto;

Expand All @@ -116,16 +126,16 @@ export default {

@screen xl {
width: 312px;
height: 217px;
height: 184px;
}
}

.card-container-image {
@apply tw-w-full tw-h-full tw-mb-1;
@apply !tw-block tw-w-full tw-h-full tw-mb-1;
}

.card-container-image >>> img {
max-height: 209px;
max-height: 180px;
@apply tw-rounded;

@screen md {
Expand Down
Loading