From bdd287559cac066fe9aaa2012a9e16e63d93dbc5 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Mon, 10 Dec 2018 16:19:12 +0100 Subject: Mobile styling on why page --- packages/website/ts/@next/pages/why.tsx | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/@next/pages/why.tsx b/packages/website/ts/@next/pages/why.tsx index 956cbbc57..028f211da 100644 --- a/packages/website/ts/@next/pages/why.tsx +++ b/packages/website/ts/@next/pages/why.tsx @@ -7,7 +7,7 @@ import { colors } from 'ts/style/colors'; import { Banner } from 'ts/@next/components/banner'; import { Icon } from 'ts/@next/components/icon'; -import { Column, Section, Wrap, WrapCentered, WrapSticky } from 'ts/@next/components/layout'; +import { BREAKPOINTS, Column, Section, Wrap, WrapCentered, WrapSticky } from 'ts/@next/components/layout'; import { Link } from 'ts/@next/components/link'; import { SiteWrap } from 'ts/@next/components/siteWrap'; import { Heading, Paragraph } from 'ts/@next/components/text'; @@ -63,8 +63,12 @@ const functionalityData = [ ]; export class NextWhy extends React.PureComponent { + public benefitsRef = React.createRef(); + public casesRef = React.createRef(); + public functionalityRef = React.createRef(); + public scrollToSection = (sectionName: 'benefits' | 'cases' | 'features') => { - zenscroll.to(this[sectionName]); + zenscroll.to(this[`${sectionName}Ref`]); } public scrollToBenefits = () => { @@ -142,7 +146,7 @@ export class NextWhy extends React.PureComponent { - this.benefits = elem}> + What 0x offers {_.map(offersData, (item, index) => ( @@ -156,19 +160,19 @@ export class NextWhy extends React.PureComponent { {item.title} - + {item.description} ))} - this.cases = elem}> + Use Cases slider - this.functionality = elem}> + Exchange Functionality {_.map(functionalityData, (item, index) => ( @@ -182,7 +186,7 @@ export class NextWhy extends React.PureComponent { {item.title} - + {item.description} @@ -208,6 +212,7 @@ const SectionWrap = styled.div` & + & { padding-top: 60px; + margin-top: 60px; } & + &:before { @@ -215,10 +220,21 @@ const SectionWrap = styled.div` position: absolute; top: 0; left: 0; - width: 100vw; height: 1px; background-color: #3d3d3d; } + + @media (min-width: ${BREAKPOINTS.mobile}) { + & + &:before { + width: 100vw; + } + } + + @media (max-width: ${BREAKPOINTS.mobile}) { + & + &:before { + width: 100%; + } + } `; const ChapterLink = styled.a` -- cgit v1.2.3