Skip to content

Commit

Permalink
Merge branch 'vaash/2609' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
VarunVAshrit committed Dec 6, 2024
2 parents 22e6fb5 + 4fb878d commit e33cdc8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions sanityv3/schemas/textSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
16 changes: 13 additions & 3 deletions web/pageComponents/shared/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -12,9 +14,8 @@ function getSomeSvg(someType: SomeType) {
youtube: <Youtube width={24} />,
}

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) {
Expand All @@ -27,6 +28,7 @@ type FooterProps = {
}

const Footer = forwardRef<HTMLDivElement, FooterProps>(function Footer({ footerData, ...rest }, ref) {
const intl = useIntl()
return (
<footer className="min-h-12 clear-both text-white-100 bg-slate-blue-95 py-4 px-0" ref={ref} {...rest}>
<div className="flex flex-row flex-wrap my-0 mx-auto justify-between px-layout-sm pb-2 max-w-screen-2xl max-md:flex-col">
Expand Down Expand Up @@ -60,6 +62,14 @@ const Footer = forwardRef<HTMLDivElement, FooterProps>(function Footer({ footerD
</div>
</section>
))}
<section
className="flex flex-col max-md:py-4 max-md:w-4/5">
<LinkButton
onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
className={`group text-sm px-0 py-2 text-white-100 underline underline-offset-8 hover:underline hover:text-moss-green-90`} >
{intl.formatMessage({ id: 'footer_to_top_button', defaultMessage: 'To top' })}
</LinkButton>
</section>
</div>
<div className="flex md:justify-center justify-start pl-4 pt-12 pb-3">
<span className="text-2xs text-white-100">Copyright {new Date().getFullYear()} Equinor ASA</span>
Expand Down
9 changes: 3 additions & 6 deletions web/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ module.exports = {
flex: {
fr: '1 1 1',
},
aria: {
current: 'current="page"',
},
typography: (theme) => ({
DEFAULT: {
css: [
Expand Down Expand Up @@ -498,12 +501,6 @@ module.exports = {
},
},
},
variants: {
extend: {
borderColor: ['aria-current'],
backgroundColor: ['aria-current'],
},
},
plugins: [
require('@tailwindcss/typography'),
plugin(function ({ addVariant, matchVariant, addUtilities, theme }) {
Expand Down

0 comments on commit e33cdc8

Please sign in to comment.