From 592c1715571be07ca0f28a7f48f62001b45e846a Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 17 Dec 2018 13:29:39 -0800 Subject: Custom getStartedLink based on screen size --- packages/website/ts/@next/pages/instant.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/@next/pages/instant.tsx b/packages/website/ts/@next/pages/instant.tsx index 0214ddd08..26a296977 100644 --- a/packages/website/ts/@next/pages/instant.tsx +++ b/packages/website/ts/@next/pages/instant.tsx @@ -1,3 +1,4 @@ +import { utils as sharedUtils } from '@0x/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import styled, { keyframes } from 'styled-components'; @@ -13,8 +14,12 @@ import { Section, SectionProps } from 'ts/@next/components/newLayout'; import { SiteWrap } from 'ts/@next/components/siteWrap'; import { Heading, Paragraph } from 'ts/@next/components/text'; import { Configurator } from 'ts/@next/pages/instant/configurator'; +import { WebsitePaths } from 'ts/types'; +import { utils } from 'ts/utils/utils'; import { ModalContact } from '../components/modals/modal_contact'; +const CONFIGURATOR_MIN_WIDTH_PX = 1050; + const featuresData = [ { title: 'Support ERC-20 and ERC-721 tokens', @@ -70,6 +75,15 @@ interface Props { }; } +export const getStartedClick = () => { + if (window.innerWidth < CONFIGURATOR_MIN_WIDTH_PX) { + utils.openUrl(`${WebsitePaths.Wiki}#Get-Started-With-Instant`); + } else { + sharedUtils.setUrlHash('configurator'); + sharedUtils.scrollToHash('configurator', ''); + } +}; + export class Next0xInstant extends React.Component { public state = { isContactModalOpen: false, @@ -80,7 +94,7 @@ export class Next0xInstant extends React.Component { Get Started} + actions={} />
@@ -181,7 +195,7 @@ const ConfiguratorSection = styled(Section) < SectionProps > ` - @media (max-width: 1050px) { + @media (max-width: ${CONFIGURATOR_MIN_WIDTH_PX}px) { display: none; } `; -- cgit v1.2.3