Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions src/components/Navigation/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,41 @@ export const MaxWidth: Story = {
),
},
}

export const WithAdditionalLogos: Story = {
args: {
maxWidth: 1440,
filled: true,
fixed: true,
additionalLogos: [
<img
src='https://placehold.co/91x32/0066CC/FFFFFF?text=Partner+1'
alt='Partner Logo 1'
height='32px'
/>,
<img
src='https://placehold.co/91x32/00A86B/FFFFFF?text=Partner+2'
alt='Partner Logo 2'
height='32px'
/>,
],
children: (
<>
<a
href='https://www.wri.org/about/privacy-policy'
target='_blank'
rel='noreferrer'
>
Privacy policy
</a>
<a
href='https://www.wri.org/about/wri-data-platforms-tos'
target='_blank'
rel='noreferrer'
>
Terms of service
</a>
</>
),
},
}
13 changes: 12 additions & 1 deletion src/components/Navigation/Footer/FooterDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { Footer } from '../..'

const FooterDemo = () => (
<Footer maxWidth={1440} filled fixed>
<Footer
maxWidth={1440}
filled
fixed
additionalLogos={[
<img
src='https://placehold.co/91x32/b0b0b0/31343C?font=playfair-display&text=Partner+Logo'
alt='Partner Logo'
height='32px'
/>
]}
>
<a
href='https://www.wri.org/about/privacy-policy'
target='_blank'
Expand Down
30 changes: 30 additions & 0 deletions src/components/Navigation/Footer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type FooterProps = {
fixed?: boolean
filled?: boolean
maxWidth?: number
additionalLogos?: React.ReactNode[]
}
```

Expand Down Expand Up @@ -126,3 +127,32 @@ type FooterProps = {
</a>
</Footer>
```

## With Additional Logos

```tsx
<Footer
maxWidth={1440}
filled
fixed
additionalLogos={[
<img src='/partner-logo-1.svg' alt='Partner Logo 1' height='32px' />,
<img src='/partner-logo-2.svg' alt='Partner Logo 2' height='32px' />,
]}
>
<a
href='https://www.wri.org/about/privacy-policy'
target='_blank'
rel='noreferrer'
>
Privacy policy
</a>
<a
href='https://www.wri.org/about/wri-data-platforms-tos'
target='_blank'
rel='noreferrer'
>
Terms of service
</a>
</Footer>
```
6 changes: 5 additions & 1 deletion src/components/Navigation/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
footerContentStyles,
footerLabelStyles,
footerStyles,
footerLogosContainerStyles,
} from './styled'
import { WriLogoBlackAndWhiteIcon } from '../../icons'

Expand All @@ -16,14 +17,17 @@ const Footer = ({
fixed,
filled,
maxWidth,
additionalLogos,
}: FooterProps) => {
const actualYear = new Date().getFullYear()

return (
<footer css={footerStyles(fixed, filled)}>
<div css={footerContainerStyles(maxWidth)}>
<div>
<div css={footerLogosContainerStyles}>
<WriLogoBlackAndWhiteIcon height='32px' width='91px' />
{/* eslint-disable-next-line react/no-array-index-key */}
{additionalLogos && additionalLogos.map((logo, index) => <div key={index}>{logo}</div>)}
</div>
<div css={footerContentStyles}>{children}</div>
<div>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Navigation/Footer/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ export const footerLabelStyles = css`
text-align: left;
}
`

export const footerLogosContainerStyles = css`
display: flex;
align-items: center;
gap: 16px;
`
1 change: 1 addition & 0 deletions src/components/Navigation/Footer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export type FooterProps = {
fixed?: boolean
filled?: boolean
maxWidth?: number
additionalLogos?: React.ReactNode[]
}
Loading