Skip to content

Commit

Permalink
footer updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gaudyb committed Apr 11, 2024
1 parent d1beeb7 commit 7adea3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions packages/components/src/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { FC } from 'react'
import { memo, useMemo } from 'react'

import { Container, LinkA, LinkDiv } from './Footer.styles.js'
import type { FooterLinkDetails, FooterProps } from './Footer.types.js'
import type { FooterLinkProps, FooterProps } from './Footer.types.js'

export const defaultFooterLinks: Array<FooterLinkDetails> = [
export const defaultFooterLinks: Array<FooterLinkProps> = [
{
name: 'Privacy & Cookies',
href: ' https://go.microsoft.com/fwlink/?LinkId=521839',
Expand Down Expand Up @@ -48,11 +48,13 @@ export const Footer: FC<FooterProps> = memo(function Footer({
)

const footerLinks = useMemo(() => {
return links.map(({ name, href }, i) => {
return (
<Link key={name} divider={i !== 0} style={style} href={href}>
return links.map(({ name, href, onClick, hide }, i) => {
return (hide === false || hide === undefined) ? (
<Link key={name} divider={i !== 0} style={style} href={href} onClick={onClick}>
{name}
</Link>
) : (
null
)
})
}, [links, style])
Expand All @@ -74,13 +76,12 @@ const Link: FC<
id,
className,
divider,
hide,
children,
href,
style,
onClick,
}) {
return (href == null || href === '') && (hide == null || hide === false) ? (
return (href == null || href === '') ? (
<>
{divider && <Text variant='tiny'>|</Text>}
<LinkDiv style={style} className={className} id={id} onClick={onClick}>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Footer/Footer.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @public
*/
export type FooterLinkDetails = { name: string; href: string }
export type FooterLinkDetails = { name: string; href: string; hide: boolean }

/**
* Defaults to {
Expand Down

0 comments on commit 7adea3b

Please sign in to comment.