From 4a44d66080951715ba18f56c94625b3efe70b5c5 Mon Sep 17 00:00:00 2001 From: VarunVAshrit <159520405+VarunVAshrit@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:00:39 +0530 Subject: [PATCH 01/14] Add a back 'to top' button in the footer#2609 (#2675) * Add a back 'to top' button in the footer#2609 * Added button from @core/Button --- sanityv3/schemas/textSnippets.ts | 5 +++++ web/pageComponents/shared/Footer.tsx | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sanityv3/schemas/textSnippets.ts b/sanityv3/schemas/textSnippets.ts index 9a8c26b3f..21aae7ac3 100644 --- a/sanityv3/schemas/textSnippets.ts +++ b/sanityv3/schemas/textSnippets.ts @@ -327,6 +327,11 @@ const snippets: textSnippet = { defaultValue: 'Submit Form', group: groups.pensionForm, }, + footer_to_top_button: { + title: 'To top button', + defaultValue: 'To top', + group: groups.others, + }, career_fair_form_organisation: { title: 'Organisation', defaultValue: 'School / Organisation', diff --git a/web/pageComponents/shared/Footer.tsx b/web/pageComponents/shared/Footer.tsx index 474aadb2f..36375dff1 100644 --- a/web/pageComponents/shared/Footer.tsx +++ b/web/pageComponents/shared/Footer.tsx @@ -2,6 +2,8 @@ import { forwardRef } from 'react' import { Facebook, Instagram, Linkedin, Twitter, Youtube } from '../../icons' import type { FooterLinkData, SomeType, FooterColumns } from '../../types/index' import { default as NextLink } from 'next/link' +import { useIntl } from 'react-intl' +import { LinkButton } from '@core/Button' function getSomeSvg(someType: SomeType) { const iconMap = { @@ -12,9 +14,8 @@ function getSomeSvg(someType: SomeType) { youtube: , } - if (!(someType in iconMap)) console.warn('Unable to get social icon for footer: Unknown SoMe type passed') - - return iconMap[someType] || null + if (!(someType in iconMap)) console.warn('Unable to get social icon for footer: Unknown SoMe type passed') + return iconMap[someType] || null } function getLink(linkData: FooterLinkData) { @@ -27,6 +28,7 @@ type FooterProps = { } const Footer = forwardRef(function Footer({ footerData, ...rest }, ref) { + const intl = useIntl() return (