Skip to content

fix: APPS-3158 update block card with image #681

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

Merged
merged 11 commits into from
Jan 31, 2025
25 changes: 9 additions & 16 deletions src/stories/BlockCardWithImage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const FTVACustomTitleDescription = TemplateFTVACustomTitleDescription.bin

const mockArticles = [
{
title: '<h3><em>Preserving In Transit:</em> The Chinese in California</h3>',
ftvaAlternativeTitle: '<h3><em>Preserving In Transit:</em> The Chinese in California</h3>',
articleCategories: [
{
title: 'Interview'
Expand Down Expand Up @@ -218,7 +218,7 @@ const mockArticles = [
]
},
{
title: '<h3>From McKinley to LBJ: Presidents in the Hearst Newsreels</h3>',
ftvaAlternativeTitle: '<h3>From McKinley to LBJ: Presidents in the Hearst Newsreels</h3>',
articleCategories: [
{
title: 'Newsreels'
Expand Down Expand Up @@ -247,7 +247,7 @@ const mockArticles = [
]
},
{
title: '<h3>The Effervescent Artist, Educator and Activist Betty Chen</h3>',
ftvaAlternativeTitle: '<h3>The Effervescent Artist, Educator and Activist Betty Chen</h3>',
articleCategories: [
{
title: 'Educators'
Expand Down Expand Up @@ -308,13 +308,12 @@ function TemplateFTVAArticleBlogListing(args) {
category="Interview, People"
:dateCreated="mockArticles[0].postDate"
>

<template #customTitle>
<rich-text v-html="mockArticles[0].title" />
<RichText :rich-text-content="mockArticles[0].ftvaAlternativeTitle" />
</template>

<template #customDescription>
<rich-text v-html="mockArticles[0].ftvaHomepageDescription" />
<RichText :rich-text-content="mockArticles[0].ftvaHomepageDescription" />
</template>
</block-card-with-image>

Expand All @@ -336,14 +335,12 @@ function TemplateFTVAArticleBlogListing(args) {
category="Interview, People"
:dateCreated="mockArticles[1].postDate"
>

<template #customTitle>

<rich-text v-html="mockArticles[1].title" />
<RichText :rich-text-content="mockArticles[1].ftvaAlternativeTitle" />
</template>

<template #customDescription>
<rich-text v-html="mockArticles[1].ftvaHomepageDescription" />
<RichText :rich-text-content="mockArticles[1].ftvaHomepageDescription" />
</template>
</block-card-with-image>

Expand All @@ -356,19 +353,15 @@ function TemplateFTVAArticleBlogListing(args) {
category="Interview, People"
:dateCreated="mockArticles[2].postDate"
>

<template #customTitle>
<rich-text v-html="mockArticles[2].title" />
<RichText :rich-text-content="mockArticles[2].ftvaAlternativeTitle" />
</template>

<template #customDescription>
<rich-text v-html="mockArticles[2].ftvaHomepageDescription" />
<RichText :rich-text-content="mockArticles[2].ftvaHomepageDescription" />
</template>
</block-card-with-image>
</div>
<section-wrapper>

</section-wrapper>
</section-wrapper>
`,
}
Expand Down
8 changes: 6 additions & 2 deletions src/styles/ftva/_block-card-with-image.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO refactor this component to get rid of position absolute for the date/byline

.ftva.block-highlight {
position: relative;

Expand Down Expand Up @@ -88,13 +90,15 @@
}
}

// because right now the byline position is set to absolute
// we need to add this margin to push the date down
:deep(.custom-description) {
.rich-text {
padding-bottom: 24px;
margin-bottom: 48px;
}
}

/* This keeps the moleule image from expanding vertically when in tablet size */
/* This keeps the molecule image from expanding vertically when in tablet size */
&.is-vertical {
flex-direction: column;

Expand Down
14 changes: 13 additions & 1 deletion src/styles/ftva/_card-meta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,19 @@
.custom-title {
:deep(.rich-text) {
max-width: none;
padding-right: 30px;
margin: 0;

.parsed-content {
margin-bottom: 18px;
}

h3 {
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}

div {
@include ftva-h3;
}
Expand All @@ -67,8 +78,9 @@
.custom-description {
:deep(.rich-text) {
max-width: none;
padding-bottom: 1px;
padding-right: 30px;
margin: 0;
margin-bottom: 48px;

div {
p {
Expand Down
Loading