From 16ddd21a5f418cb1e421657a903c3aaf8064b62a Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 27 Nov 2018 02:00:32 -0800 Subject: feat(website): instant features section --- packages/website/ts/containers/instant.ts | 3 + packages/website/ts/pages/instant/features.tsx | 70 ++++++++++++++-------- packages/website/ts/pages/instant/instant.tsx | 6 +- .../ts/pages/instant/introducing_0x_instant.tsx | 2 +- packages/website/ts/pages/instant/screenshots.tsx | 2 +- packages/website/ts/style/colors.ts | 3 +- 6 files changed, 55 insertions(+), 31 deletions(-) diff --git a/packages/website/ts/containers/instant.ts b/packages/website/ts/containers/instant.ts index 9bcfb903b..12ae7454e 100644 --- a/packages/website/ts/containers/instant.ts +++ b/packages/website/ts/containers/instant.ts @@ -4,10 +4,12 @@ import { Dispatch } from 'redux'; import { Instant as InstantComponent, InstantProps } from 'ts/pages/instant/instant'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; +import { ScreenWidths } from 'ts/types'; import { Translate } from 'ts/utils/translate'; interface ConnectedState { translate: Translate; + screenWidth: ScreenWidths; } interface ConnectedDispatch { @@ -16,6 +18,7 @@ interface ConnectedDispatch { const mapStateToProps = (state: State, _ownProps: InstantProps): ConnectedState => ({ translate: state.translate, + screenWidth: state.screenWidth, }); const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ diff --git a/packages/website/ts/pages/instant/features.tsx b/packages/website/ts/pages/instant/features.tsx index 205982044..b460796c1 100644 --- a/packages/website/ts/pages/instant/features.tsx +++ b/packages/website/ts/pages/instant/features.tsx @@ -6,14 +6,33 @@ import { Text } from 'ts/components/ui/text'; import { colors } from 'ts/style/colors'; import { ScreenWidths } from 'ts/types'; -export const Features = () => ( - - - - - - - +export interface FeatureProps { + screenWidth: ScreenWidths; +} + +export const Features = (props: FeatureProps) => ( + + + + ); @@ -32,34 +51,35 @@ interface FeatureItemProps { const FeatureItem = (props: FeatureItemProps) => { const { imgSrc, title, description, linkInfos, screenWidth } = props; - const shouldShowImage = screenWidth === ScreenWidths.Lg; - const image = ; - const missionStatementClassName = !shouldShowImage ? 'center' : undefined; - const missionStatement = ( - - + const isLargeScreen = screenWidth === ScreenWidths.Lg; + const image = ; + const info = ( + + {title} - - + + {description} ); return ( -
- {shouldShowImage ? ( - + + {isLargeScreen ? ( + {image} - {missionStatement} + {info} ) : ( - {missionStatement} + + {image} + + {info} + + )} -
+
); }; diff --git a/packages/website/ts/pages/instant/instant.tsx b/packages/website/ts/pages/instant/instant.tsx index 87d6a64d4..eaaeb1689 100644 --- a/packages/website/ts/pages/instant/instant.tsx +++ b/packages/website/ts/pages/instant/instant.tsx @@ -47,14 +47,14 @@ export class Instant extends React.Component { - + - +