From 54f79c2798c095344b003139144b77fc1024d8c3 Mon Sep 17 00:00:00 2001
From: fragosti <francesco.agosti93@gmail.com>
Date: Fri, 15 Jun 2018 13:17:02 -0700
Subject: Improve styles of onboarding tooltip

---
 .../components/onboarding/onboarding_tooltip.tsx   | 87 ++++++++++++++--------
 1 file changed, 58 insertions(+), 29 deletions(-)

(limited to 'packages/website/ts/components/onboarding/onboarding_tooltip.tsx')

diff --git a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx
index 9e0744dcb..0858ad326 100644
--- a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx
+++ b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx
@@ -1,8 +1,12 @@
+import { colors } from '@0xproject/react-shared';
 import * as React from 'react';
 
+import { Button } from 'ts/components/ui/button';
 import { Container } from 'ts/components/ui/container';
+import { IconButton } from 'ts/components/ui/icon_button';
 import { Island } from 'ts/components/ui/island';
-import { Pointer } from 'ts/components/ui/pointer';
+import { Pointer, PointerDirection } from 'ts/components/ui/pointer';
+import { Text, Title } from 'ts/components/ui/text';
 
 export type ContinueButtonDisplay = 'enabled' | 'disabled';
 
@@ -14,45 +18,70 @@ export interface OnboardingTooltipProps {
     onClickNext: () => void;
     onClickBack: () => void;
     continueButtonDisplay?: ContinueButtonDisplay;
-    hideBackButton?: boolean;
-    hideNextButton?: boolean;
+    shouldHideBackButton?: boolean;
+    shouldHideNextButton?: boolean;
+    pointerDirection?: PointerDirection;
+    className?: string;
 }
 
-// TODO: Make this more general button.
-export interface ContinueButtonProps {
-    display: ContinueButtonDisplay;
-    children?: string;
-    onClick: () => void;
-}
-
-export const ContinueButton: React.StatelessComponent<ContinueButtonProps> = (props: ContinueButtonProps) => {
-    const isDisabled = props.display === 'disabled';
-    return (
-        <button disabled={isDisabled} onClick={isDisabled ? undefined : props.onClick}>
-            {props.children}
-        </button>
-    );
-};
-
-export const OnboardingTooltip: React.StatelessComponent<OnboardingTooltipProps> = (props: OnboardingTooltipProps) => (
-    <Pointer direction="left">
+export const OnboardingTooltip: React.StatelessComponent<OnboardingTooltipProps> = ({
+    title,
+    content,
+    continueButtonDisplay,
+    onClickNext,
+    onClickBack,
+    onClose,
+    shouldHideBackButton,
+    shouldHideNextButton,
+    pointerDirection,
+    className,
+}) => (
+    <Pointer className={className} direction={pointerDirection}>
         <Island>
             <Container paddingRight="30px" paddingLeft="30px" maxWidth={350} paddingTop="15px" paddingBottom="15px">
                 <div className="flex flex-column">
-                    {props.title}
-                    {props.content}
-                    {props.continueButtonDisplay && (
-                        <ContinueButton onClick={props.onClickNext} display={props.continueButtonDisplay}>
+                    <div className="flex justify-between">
+                        <Title>{title}</Title>
+                        <Container position="relative" bottom="20px" left="15px">
+                            <IconButton color={colors.grey} iconName="zmdi-close" onClick={onClose}>
+                                Close
+                            </IconButton>
+                        </Container>
+                    </div>
+                    <Container marginBottom="15px">
+                        <Text>{content}</Text>
+                    </Container>
+                    {continueButtonDisplay && (
+                        <Button
+                            isDisabled={continueButtonDisplay === 'disabled'}
+                            onClick={onClickNext}
+                            fontColor={colors.white}
+                            fontSize="15px"
+                            backgroundColor={colors.mediumBlue}
+                        >
                             Continue
-                        </ContinueButton>
+                        </Button>
                     )}
-                    {!props.hideBackButton && <button onClick={props.onClickBack}>Back</button>}
-                    {!props.hideNextButton && <button onClick={props.onClickNext}>Skip</button>}
-                    <button onClick={props.onClose}>Close</button>
+                    <Container className="flex justify-between" marginTop="15px">
+                        {!shouldHideBackButton && (
+                            <Text fontColor={colors.grey} onClick={onClickBack}>
+                                Back
+                            </Text>
+                        )}
+                        {!shouldHideNextButton && (
+                            <Text fontColor={colors.grey} onClick={onClickNext}>
+                                Skip
+                            </Text>
+                        )}
+                    </Container>
                 </div>
             </Container>
         </Island>
     </Pointer>
 );
 
+OnboardingTooltip.defaultProps = {
+    pointerDirection: 'left',
+};
+
 OnboardingTooltip.displayName = 'OnboardingTooltip';
-- 
cgit v1.2.3

