From 8d0b6702c0bd1e6e42a847ada731d1857aedcc62 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Mon, 10 Dec 2018 17:38:23 +0100 Subject: Edits why page, removes zenscroll --- .../website/ts/@next/constants/globalStyle.tsx | 1 + packages/website/ts/@next/pages/about/mission.tsx | 2 +- packages/website/ts/@next/pages/why.tsx | 60 ++++++++-------------- 3 files changed, 22 insertions(+), 41 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/constants/globalStyle.tsx b/packages/website/ts/@next/constants/globalStyle.tsx index 160c46ad5..c7c90c0ba 100644 --- a/packages/website/ts/@next/constants/globalStyle.tsx +++ b/packages/website/ts/@next/constants/globalStyle.tsx @@ -76,6 +76,7 @@ const GlobalStyles = withTheme(createGlobalStyle ` -webkit-font-smoothing: antialiased; color: ${props => props.theme.textColor}; font-feature-settings: "zero"; + scroll-behavior: smooth; } .visuallyHidden { diff --git a/packages/website/ts/@next/pages/about/mission.tsx b/packages/website/ts/@next/pages/about/mission.tsx index cbc113888..11177d462 100644 --- a/packages/website/ts/@next/pages/about/mission.tsx +++ b/packages/website/ts/@next/pages/about/mission.tsx @@ -78,4 +78,4 @@ export const NextAboutMission = () => ( -); \ No newline at end of file +); diff --git a/packages/website/ts/@next/pages/why.tsx b/packages/website/ts/@next/pages/why.tsx index 028f211da..88c0ca69b 100644 --- a/packages/website/ts/@next/pages/why.tsx +++ b/packages/website/ts/@next/pages/why.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash'; import * as React from 'react'; +import AnchorLink from 'react-anchor-link-smooth-scroll'; import styled from 'styled-components'; -import zenscroll from 'zenscroll'; import { colors } from 'ts/style/colors'; @@ -63,28 +63,6 @@ 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}Ref`]); - } - - public scrollToBenefits = () => { - // was going to onClick={() => this.scrollToSection('name')} but ts/linting - // doesnt like it, lets do this for now - this.scrollToSection('benefits'); - } - - public scrollToCases = () => { - this.scrollToSection('cases'); - } - - public scrollToFunctionality = () => { - this.scrollToSection('functionality'); - } - public render(): React.ReactNode { return ( @@ -138,25 +116,22 @@ export class NextWhy extends React.PureComponent {
- - Benefits - Use Cases - Features - + + Benefits + Use Cases + Features + - + What 0x offers {_.map(offersData, (item, index) => ( - + {item.title} @@ -167,22 +142,19 @@ export class NextWhy extends React.PureComponent { ))} - + Use Cases slider - + Exchange Functionality {_.map(functionalityData, (item, index) => ( - + {item.title} @@ -231,13 +203,21 @@ const SectionWrap = styled.div` } @media (max-width: ${BREAKPOINTS.mobile}) { + text-align: left; + & + &:before { width: 100%; } } `; -const ChapterLink = styled.a` +const NavStickyWrap = styled(WrapSticky)` + @media (max-width: ${BREAKPOINTS.mobile}) { + display: none; + } +`; + +const ChapterLink = styled(AnchorLink)` color: ${props => props.theme.textColor}; font-size: 22px; margin-bottom: 15px; -- cgit v1.2.3