Skip to content

Commit

Permalink
fixing ternary logic for rendering links in BlockCardGridItem
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Aug 1, 2024
1 parent eb17f98 commit 77e0856
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions packages/vue/src/components/BlockCardGrid/BlockCardGrid.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const BlockCardGridData = [
width: 800
},
srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
},
link: {
page: null,
externalLink: ''
}
},
{
Expand All @@ -39,15 +43,20 @@ export const BlockCardGridData = [
link: {
page: {
url: '#'
}
},
externalLink: ''
}
},
{
label: 'Factoid 3',
title: 'Nimble Limbs',
description:
'Proin sapien nulla, consequat et aliquam tristique, sollicitudin vitae lorem. Etiam nec vestibulum ante, semper blandit tortor. Nam id bibendum leo. Suspendisse a cursus felis, eget tristique nibh. Proin facilisis tortor eget pulvinar cursus.',
image: null
image: null,
link: {
page: null,
externalLink: ''
}
},
{
label: 'Factoid 4',
Expand All @@ -61,6 +70,10 @@ export const BlockCardGridData = [
width: 800
},
srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
},
link: {
page: null,
externalLink: ''
}
},
{
Expand All @@ -69,7 +82,8 @@ export const BlockCardGridData = [
description: 'The robot has four limbs, each with seven degrees of freedom.',
image: null,
link: {
externalLink: '#'
externalLink: '#',
page: null
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseLink
v-if="link"
v-if="link?.page || link?.externalLink"
variant="none"
:to="link?.page?.url ? link.page.url : undefined"
:href="link?.externalLink ? link?.externalLink : undefined"
Expand Down

0 comments on commit 77e0856

Please sign in to comment.