diff options
Diffstat (limited to 'packages/website/ts/@next/components/footer.tsx')
-rw-r--r-- | packages/website/ts/@next/components/footer.tsx | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/packages/website/ts/@next/components/footer.tsx b/packages/website/ts/@next/components/footer.tsx index aff5c13c4..be5c075f9 100644 --- a/packages/website/ts/@next/components/footer.tsx +++ b/packages/website/ts/@next/components/footer.tsx @@ -8,16 +8,27 @@ import { Button } from './button'; import { Section, Wrap, Column } from './layout'; import { Logo } from './logo'; -export interface FooterInterface { +interface FooterInterface { } -export interface LinkInterface { +interface LinkInterface { text: string; url: string; newWindow?: boolean; } -const linkRows = [ +interface LinkRows { + [key: string]: { + heading: string; + links: Array<LinkInterface>; + } +} + +interface LinkListProps { + links: Array<LinkInterface>; +} + +const linkRows: LinkRows = [ { heading: 'Products', links: [ @@ -65,15 +76,7 @@ export const Footer: React.StatelessComponent<FooterInterface> = ({}) => ( { row.heading } </RowHeading> - <ul> - {_.map(row.links, (link, index) => ( - <li key={`fl-${index}`}> - <Link href={link.url}> - { link.text } - </Link> - </li> - ))} - </ul> + <LinkList links={row.links} /> </Column> ))} </Wrap> @@ -82,6 +85,19 @@ export const Footer: React.StatelessComponent<FooterInterface> = ({}) => ( </FooterWrap> ); + +const LinkList = (props: LinkListProps) => ( + <ul> + {_.map(props.links, (link, index) => ( + <li key={`fl-${index}`}> + <Link href={link.url}> + { link.text } + </Link> + </li> + ))} + </ul> +); + const FooterWrap = Section.withComponent('footer'); const RowHeading = styled.h3` |