Skip to content

Commit

Permalink
Adjust code regarding the new design tokens (#1085)
Browse files Browse the repository at this point in the history
- Mostly replace div's description to paragraphs to make it more semantic
- Fix gallery block

Co-authored-by: Dan Tovbein <[email protected]>
  • Loading branch information
GP-Dan-Tovbein and dantovbein authored Aug 23, 2023
1 parent 8835620 commit c1fd47b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/src/blocks/Articles/ArticlesFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ArticlesFrontend = props => {
<h2 className="page-section-header">{ article_heading }</h2>
</header>
{ articles_description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: articles_description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: articles_description}} />
}
<ArticlesList posts={posts} postType={postType} />
{ hasMorePages &&
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Columns/ColumnsFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ColumnsFrontend = ({columns_block_style, columns_title, columns_des
</header>
}
{columns_description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: columns_description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: columns_description}} />
}
<Columns
columns_block_style={columns_block_style}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Covers/CoversFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const CoversFrontend = attributes => {
<h2 className="page-section-header" dangerouslySetInnerHTML={{__html: title}} />
}
{description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
}
{isCarouselLayout && !isSmallWindow ? <CoversCarouselLayout {...coversProps} /> : <Covers {...coversProps} />}
{showLoadMoreButton && <CoversGridLoadMoreButton showMoreCovers={showMoreCovers} readMoreText={readMoreText} />}
Expand Down
12 changes: 8 additions & 4 deletions assets/src/blocks/Gallery/GalleryFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ export const GalleryFrontend = ({
</header>
}
{attributes.gallery_block_description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: attributes.gallery_block_description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: attributes.gallery_block_description}} />
}

{layout === 'slider' && <GalleryCarousel onImageClick={openLightbox} images={images} />}
{layout === 'three-columns' && <GalleryThreeColumns onImageClick={openLightbox} images={images} postType={postType} />}
{layout === 'grid' && <GalleryGrid onImageClick={openLightbox} images={images} />}
{images.length ? (
<>
{layout === 'slider' && <GalleryCarousel onImageClick={openLightbox} images={images} />}
{layout === 'three-columns' && <GalleryThreeColumns onImageClick={openLightbox} images={images} postType={postType} />}
{layout === 'grid' && <GalleryGrid onImageClick={openLightbox} images={images} />}
</>
) : null}

{(renderLightbox && items.length) ?
<Lightbox isOpen={isOpen} index={index} items={items} onClose={closeLightbox} /> :
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Media/MediaFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const MediaFrontend = attributes => {
}
{
description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
}
{
media_url && media_url.endsWith('.mp4') ?
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/SocialMedia/SocialMediaFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const SocialMediaFrontend = ({
</header>
}
{!!description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
}
<SocialMediaEmbed
embedCode={embed_code}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/blocks/Timeline/TimelineFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const TimelineFrontend = props => {
</header>
}
{!!description &&
<div className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
<p className="page-section-description" dangerouslySetInnerHTML={{__html: description}} />
}
<Timeline {...nodeProps} />
</section>
Expand Down

0 comments on commit c1fd47b

Please sign in to comment.