Skip to content

Commit

Permalink
chore(#57): add external link handling to service cards
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianGilbert committed Aug 27, 2024
1 parent 4e3fbf0 commit 0fa7ae8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/ServiceCard.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ Default.args = {
title: 'Services category title across one or two lines',
links: [
{ url: '#', title: 'Link 1' },
{ url: '#', title: 'Link 2' },
{
url: '#',
title: 'Link 2',
external: true,
target: '_blank',
icon: 'upper-right-arrow'
},
{ url: '#', title: 'Link 3' },
{ url: '#', title: 'Link 4' },
{ url: '#', title: 'Link 5' },
Expand Down
9 changes: 8 additions & 1 deletion src/components/ServiceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
<!-- Slot: Default -->
<CTItemList class="ct-service-card__links" :items="links">
<template #default="{ item }">
<CTLink :link="item.url" :text="item.title" :theme="theme" />
<CTLink
:external="item.external"
:icon="item.icon"
:link="item.url"
:target="item.target"
:text="item.title"
:theme="theme"
/>
</template>
</CTItemList>

Expand Down

0 comments on commit 0fa7ae8

Please sign in to comment.