From 803086da5769c7cad2b4bbb80496ea58b353e5b8 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Thu, 13 Dec 2018 17:27:40 +0100 Subject: Cleans up as much as old layout --- packages/website/ts/@next/components/banner.tsx | 1 - .../components/dropdowns/dropdown_developers.tsx | 8 ++-- .../website/ts/@next/components/dropdowns/mock.tsx | 5 --- packages/website/ts/@next/components/footer.tsx | 37 +++++++++---------- packages/website/ts/@next/components/header.tsx | 43 ++++++++++------------ .../ts/@next/components/sections/landing/cta.tsx | 7 +--- 6 files changed, 42 insertions(+), 59 deletions(-) delete mode 100644 packages/website/ts/@next/components/dropdowns/mock.tsx diff --git a/packages/website/ts/@next/components/banner.tsx b/packages/website/ts/@next/components/banner.tsx index a3740c25a..7141a4eb1 100644 --- a/packages/website/ts/@next/components/banner.tsx +++ b/packages/website/ts/@next/components/banner.tsx @@ -4,7 +4,6 @@ import styled from 'styled-components'; import {colors} from 'ts/style/colors'; import {Button} from 'ts/@next/components/button'; -import {Wrap, WrapCentered} from 'ts/@next/components/layout'; import {ThemeInterface} from 'ts/@next/components/siteWrap'; import {Heading, Paragraph} from 'ts/@next/components/text'; diff --git a/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx b/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx index 8a4db2656..317302d44 100644 --- a/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx +++ b/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx @@ -4,7 +4,7 @@ import {Link as RouterLink} from 'react-router-dom'; import styled, {withTheme} from 'styled-components'; import {Button} from 'ts/@next/components/button'; -import {Column, Wrap, WrapGrid} from 'ts/@next/components/layout'; +import {Column, FlexWrap, WrapGrid} from 'ts/@next/components/newLayout'; import {Heading} from 'ts/@next/components/text'; import {GlobalStyle} from 'ts/@next/constants/globalStyle'; @@ -90,7 +90,7 @@ export const DropdownDevelopers = withTheme((props: Props) => ( - + ( - + Useful Links @@ -155,7 +155,7 @@ const StyledGrid = styled(WrapGrid.withComponent('ul'))` } `; -const StyledWrap = styled(Wrap)` +const StyledWrap = styled(FlexWrap)` padding-top: 20px; margin-top: 30px; position: relative; diff --git a/packages/website/ts/@next/components/dropdowns/mock.tsx b/packages/website/ts/@next/components/dropdowns/mock.tsx deleted file mode 100644 index 9ead533d6..000000000 --- a/packages/website/ts/@next/components/dropdowns/mock.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from 'react'; - -export const Dropdown = () => ( -
Dropdown menu placeholder
-); diff --git a/packages/website/ts/@next/components/footer.tsx b/packages/website/ts/@next/components/footer.tsx index defc4ba81..11d18c7f7 100644 --- a/packages/website/ts/@next/components/footer.tsx +++ b/packages/website/ts/@next/components/footer.tsx @@ -3,15 +3,10 @@ import * as React from 'react'; import { Link as ReactRouterLink } from 'react-router-dom'; import styled from 'styled-components'; -import { colors } from 'ts/style/colors'; - -import { BREAKPOINTS, Column, Section, Wrap, WrapGrid } from 'ts/@next/components/layout'; import { Logo } from 'ts/@next/components/logo'; +import { Column, FlexWrap, WrapGrid } from 'ts/@next/components/newLayout'; import { NewsletterForm } from 'ts/@next/components/newsletter_form'; -interface FooterInterface { -} - interface LinkInterface { text: string; url: string; @@ -66,15 +61,15 @@ const linkRows: LinkRows[] = [ }, ]; -export const Footer: React.StatelessComponent = ({}) => ( - - - +export const Footer: React.StatelessComponent = () => ( + + + - + {_.map(linkRows, (row, index) => ( = ({}) => ( ))} - + ); @@ -108,38 +103,40 @@ const LinkList = (props: LinkListProps) => ( ); -const FooterSection = styled.footer` +const FooterWrap = styled.footer` padding: 40px 30px 30px 30px; margin-top: 30px; background-color: ${props => props.theme.footerBg}; -`; - -const FooterWrap = styled(FooterSection)` color: ${props => props.theme.footerColor}; path { fill: ${props => props.theme.footerColor}; } - @media (min-width: ${BREAKPOINTS.mobile}) { + @media (min-width: 768px) { height: 350px; } `; const FooterColumn = styled(Column)` - @media (min-width: ${BREAKPOINTS.mobile}) { + @media (min-width: 768px) { width: ${props => props.width}; } - @media (max-width: ${BREAKPOINTS.mobile}) { + @media (max-width: 768px) { display: ${props => props.isMobileHidden && 'none'}; text-align: left; } `; const FooterSectionWrap = styled(FooterColumn)` - @media (max-width: ${BREAKPOINTS.mobile}) { + @media (max-width: 768px) { width: 50%; + + & + & { + margin-top: 0; + margin-bottom: 30px; + } } `; diff --git a/packages/website/ts/@next/components/header.tsx b/packages/website/ts/@next/components/header.tsx index d7046ec7a..c5c67ac80 100644 --- a/packages/website/ts/@next/components/header.tsx +++ b/packages/website/ts/@next/components/header.tsx @@ -3,18 +3,14 @@ import * as React from 'react'; import { Link as ReactRouterLink } from 'react-router-dom'; import styled, { withTheme } from 'styled-components'; -import { colors } from 'ts/style/colors'; - import { Button } from 'ts/@next/components/button'; import { DropdownDevelopers } from 'ts/@next/components/dropdowns/dropdown_developers'; import { DropdownProducts } from 'ts/@next/components/dropdowns/dropdown_products'; -import { Dropdown } from 'ts/@next/components/dropdowns/mock'; import { Hamburger } from 'ts/@next/components/hamburger'; -import { BREAKPOINTS, Section, Wrap } from 'ts/@next/components/layout'; import { Logo } from 'ts/@next/components/logo'; -import { Paragraph } from 'ts/@next/components/text'; - import { MobileNav } from 'ts/@next/components/mobileNav'; +import { FlexWrap } from 'ts/@next/components/newLayout'; +import { Paragraph } from 'ts/@next/components/text'; interface HeaderProps { isOpen: boolean; @@ -96,11 +92,15 @@ class HeaderBase extends React.Component { - + {_.map(navItems, (link, index) => ( - + ))} - + { - - ); + + ); } } @@ -122,11 +122,10 @@ export const Header = withTheme(HeaderBase); const NavItem = (props): React.ReactNode => { const { link, index } = props; - const Wrapper = link.dropdownComponent ? LinkWrap : React.Fragment; const Subnav = link.dropdownComponent; return ( - + { } - + ); }; -const StyledHeader = styled(Section.withComponent('header'))` +const StyledHeader = styled.header` + padding: 30px; + @media (max-width: 800px) { min-height: ${props => props.isOpen ? '385px' : '70px'}; overflow: hidden; position: relative; transition: min-height 0.25s ease-in-out; } - - @media (max-width: 800px) { - background-color: ${props => props.theme.bgColor}; - } `; -const LinkWrap = styled.div` +const LinkWrap = styled.li` position: relative; a { @@ -189,7 +186,7 @@ const StyledNavLink = styled(ReactRouterLink).attrs({ } `; -const HeaderWrap = styled(Wrap)` +const HeaderWrap = styled(FlexWrap)` justify-content: space-between; align-items: center; @@ -200,7 +197,7 @@ const HeaderWrap = styled(Wrap)` } `; -const StyledButtonWrap = styled.div` +const NavLinks = styled.ul` display: flex; align-items: center; justify-content: space-between; @@ -249,7 +246,7 @@ const DropdownWrap = styled.div` margin-left: -11px; } - @media (max-width: ${BREAKPOINTS.mobile}) { + @media (max-width: 768px) { display: none; } `; diff --git a/packages/website/ts/@next/components/sections/landing/cta.tsx b/packages/website/ts/@next/components/sections/landing/cta.tsx index 5a0617256..49fc48c1c 100644 --- a/packages/website/ts/@next/components/sections/landing/cta.tsx +++ b/packages/website/ts/@next/components/sections/landing/cta.tsx @@ -1,12 +1,7 @@ import * as React from 'react'; -import {Button, ButtonWrap, Link} from 'ts/@next/components/button'; -import {Icon, InlineIconWrap} from 'ts/@next/components/icon'; -import {Wrap, WrapCentered, WrapGrid} from 'ts/@next/components/layout'; -import {Heading, Paragraph} from 'ts/@next/components/text'; - -import {Column, Section} from 'ts/@next/components/newLayout'; import {BlockIconLink} from 'ts/@next/components/blockIconLink'; +import {Section} from 'ts/@next/components/newLayout'; interface Props { onContactClick?: () => void; -- cgit