Skip to content
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

feat: APPS-3007 Add BlockInfo external icon #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pages/collections/[slug].vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="ts" setup>
<script setup>
// COMPONENT RE-IMPORTS
// TODO: remove when we have implemented component library as a module
// https://nuxt.com/docs/guide/directory-structure/components#library-authors
Expand Down Expand Up @@ -63,15 +63,16 @@ const parsedCarouselData = computed(() => {
// Map icon names to svg names for infoBlock
const parsedInfoBlockIconLookup = {
'icon-download': 'svg-call-to-action-ftva-pdf',
'icon-external-link': 'svg-call-to-action-ftva-info'
'icon-info': 'svg-call-to-action-ftva-info',
'icon-external-link': 'svg-call-to-action-ftva-external-link-dark'
}
const parsedInfoBlock = computed(() => {
// fail gracefully if data does not exist (server-side)
if (!page.value.infoBlock || page.value.infoBlock.length === 0) {
return null
}
return page.value.infoBlock.map((item, index) => {
const parsedIcon = parsedInfoBlockIconLookup[item?.icon] ? parsedInfoBlockIconLookup[item.icon] : parsedInfoBlockIconLookup['icon-external-link']
const parsedIcon = parsedInfoBlockIconLookup[item?.icon] ? parsedInfoBlockIconLookup[item.icon] : parsedInfoBlockIconLookup['icon-info']
return {
text: item.text,
icon: parsedIcon
Expand Down
Loading