From b2eb2fd314c28353684f4cd0f6474a2256d7544e Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 17 Oct 2023 10:54:17 +1100 Subject: [PATCH] refactor: :recycle: replace icon at mapping level --- packages/nuxt-ripple/composables/use-tide-site.ts | 12 +----------- .../mapping/utils/processSiteSocialLinks.ts | 3 ++- .../src/components/contact-us/RplContactUs.vue | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/nuxt-ripple/composables/use-tide-site.ts b/packages/nuxt-ripple/composables/use-tide-site.ts index f3e951885b..867cc63a46 100644 --- a/packages/nuxt-ripple/composables/use-tide-site.ts +++ b/packages/nuxt-ripple/composables/use-tide-site.ts @@ -32,17 +32,7 @@ export const useTideSite = async (id?: number): Promise => { return data.value } - // Intercept social links, replace icon-twitter with icon-x - return Object.fromEntries( - Object.entries(siteData.value).map(([k, v]) => [ - k, - k !== 'socialLinks' - ? v - : siteData.value[k].map((link: any) => - link.icon === 'icon-twitter' ? { ...link, icon: 'icon-x' } : link - ) - ]) - ) as any + return siteData.value } export default useTideSite diff --git a/packages/nuxt-ripple/mapping/utils/processSiteSocialLinks.ts b/packages/nuxt-ripple/mapping/utils/processSiteSocialLinks.ts index 04c3630870..84255647e6 100644 --- a/packages/nuxt-ripple/mapping/utils/processSiteSocialLinks.ts +++ b/packages/nuxt-ripple/mapping/utils/processSiteSocialLinks.ts @@ -23,7 +23,8 @@ export const getIconForUrl = (urlString: string) => { case 'linkedin.com': return 'icon-linkedin' case 'twitter.com': - return 'icon-twitter' + case 'x.com': + return 'icon-x' case 'youtube.com': return 'icon-youtube' default: diff --git a/packages/ripple-ui-core/src/components/contact-us/RplContactUs.vue b/packages/ripple-ui-core/src/components/contact-us/RplContactUs.vue index a13b708cbc..f5fb723801 100644 --- a/packages/ripple-ui-core/src/components/contact-us/RplContactUs.vue +++ b/packages/ripple-ui-core/src/components/contact-us/RplContactUs.vue @@ -42,7 +42,7 @@ const handleClick = (event) => { ) } -// Intercept social links to replace icon-twitter with icon-x +// Replace icon-twitter with icon-x const socialLinks = computed(() => props.items.map((i) => i.icon === 'icon-twitter' ? { ...i, icon: 'icon-x' } : i