From 6fc80cd7764bec67b68d4a1ecf5d297fb7040e5a Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Mon, 17 Dec 2018 12:04:35 +0100 Subject: Fixes scrollable anchors in why page --- packages/website/ts/@next/pages/why.tsx | 99 ++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 45 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/pages/why.tsx b/packages/website/ts/@next/pages/why.tsx index a267bd09e..9c3c4d0a2 100644 --- a/packages/website/ts/@next/pages/why.tsx +++ b/packages/website/ts/@next/pages/why.tsx @@ -1,6 +1,7 @@ import * as _ from 'lodash'; import * as React from 'react'; -import AnchorLink from 'react-anchor-link-smooth-scroll'; +import ScrollableAnchor, { configureAnchors } from 'react-scrollable-anchor'; + import styled from 'styled-components'; import {Hero} from 'ts/@next/components/hero'; @@ -79,6 +80,8 @@ const useCaseSlides = [ }, ]; +configureAnchors({ offset: -60 }); + export class NextWhy extends React.Component { public state = { isContactModalOpen: false, @@ -136,57 +139,63 @@ export class NextWhy extends React.Component {
- Benefits - Use Cases - Features + Benefits + Use Cases + Features - - What 0x offers - - {_.map(offersData, (item, index) => ( - - ))} - - - - Use Cases - - {_.map(useCaseSlides, (item, index) => ( - + + What 0x offers + + {_.map(offersData, (item, index) => ( + + ))} + + + + + + Use Cases + + {_.map(useCaseSlides, (item, index) => ( + + ))} + + + + + + + Exchange Functionality + + {_.map(functionalityData, (item, index) => ( + ))} - - - - - Exchange Functionality - - {_.map(functionalityData, (item, index) => ( - - ))} - + +
@@ -270,7 +279,7 @@ const NavStickyWrap = styled(WrapSticky)` } `; -const ChapterLink = styled(AnchorLink)` +const ChapterLink = styled.a` color: ${props => props.theme.textColor}; font-size: 22px; margin-bottom: 25px; -- cgit v1.2.3