diff options
-rw-r--r-- | packages/website/ts/@next/components/footer.tsx | 40 | ||||
-rw-r--r-- | packages/website/ts/@next/components/layout.tsx | 30 |
2 files changed, 43 insertions, 27 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` diff --git a/packages/website/ts/@next/components/layout.tsx b/packages/website/ts/@next/components/layout.tsx index edf739229..c25981ed6 100644 --- a/packages/website/ts/@next/components/layout.tsx +++ b/packages/website/ts/@next/components/layout.tsx @@ -2,36 +2,36 @@ import * as React from 'react'; import styled from 'styled-components'; interface WrapWidths { - default: string, - full: string, - medium: string, - narrow: string, - [key: string]: string, + default: string; + full: string; + medium: string; + narrow: string; + [key: string]: string; } interface ColumnWidths { - [key: string]: string, + [key: string]: string; } interface SectionProps { - noPadding?: any, - noMargin?: any, - bgColor?: string, + noPadding?: any; + noMargin?: any; + bgColor?: string; } interface WrapProps { - width?: 'default' | 'full' | 'medium' | 'narrow', - bgColor?: string, + width?: 'default' | 'full' | 'medium' | 'narrow'; + bgColor?: string; } interface ColumnProps { - colWidth?: '1/4' | '1/3' | '1/2' | '2/3', - noPadding?: any, + colWidth?: '1/4' | '1/3' | '1/2' | '2/3'; + noPadding?: any; } interface GetColWidthArgs { - span?: number, - columns: number, + span?: number; + columns: number; } |