Skip to content

Commit

Permalink
fix: In chart gallery thumbnail is rendered in case of no example in #…
Browse files Browse the repository at this point in the history
…16707 (#26415)

(cherry picked from commit 6d58566)
  • Loading branch information
sivasathyaseeelan authored and michael-s-molina committed Jan 9, 2024
1 parent ed29c5b commit 1daab27
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,18 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) {
grid-area: examples-header;
`}
>
{!!selectedVizMetadata?.exampleGallery?.length && t('Examples')}
{t('Examples')}
</SectionTitle>
<Examples>
{(selectedVizMetadata?.exampleGallery || []).map(example => (
{(selectedVizMetadata?.exampleGallery?.length
? selectedVizMetadata.exampleGallery
: [
{
url: selectedVizMetadata?.thumbnail,
caption: selectedVizMetadata?.name,
},
]
).map(example => (
<img
key={example.url}
src={example.url}
Expand Down

0 comments on commit 1daab27

Please sign in to comment.