diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-22 16:39:07 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-22 16:39:07 +0800 |
commit | 3ce295a2af17feef6cd4e3140196501805493719 (patch) | |
tree | 964df912ce86d98a211f81f3d6159d797a37c3b3 /packages/website/ts/components/onboarding/onboarding_card.tsx | |
parent | a30107ab867964d371b2d5fc6791c7b1963f1c7b (diff) | |
parent | 0515c6acded983bba05320895ea2c2891f37055c (diff) | |
download | dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.gz dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.tar.zst dexon-sol-tools-3ce295a2af17feef6cd4e3140196501805493719.zip |
Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (40 commits)
Use make-promises-safe as a preloader instead of manually importing
Updated compiler runs to be 1,000,000
Add event to setSignatureValidatorApproval, rename signer => signerAddress accross all contracts
Add senderAddress to Fill and Cancel logs, add comments to events and types
Fix Island component
Add missing image assets for Chris and Mel
Fix some bugs in sol-cov
Remove unreachable PreSigned check
Fix linting
Buttons look hella disabled now
Remove border radius, fix width issue for unlock step
Add Chris and Mel to about page
fix linter issues
only call getLocationByOffset if source if defined
Set settleOrder and settleMatchedOrders to private
Prevent prettier issue
Support mobile friendly onboarding flows
Removed MixinSettlement. Moved `settleOrder` into `MixinExchangeCore` and `settleMatchedOrders` into `MixinMatchOrders`
Migrations after rebasing
Linter
...
Diffstat (limited to 'packages/website/ts/components/onboarding/onboarding_card.tsx')
-rw-r--r-- | packages/website/ts/components/onboarding/onboarding_card.tsx | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/packages/website/ts/components/onboarding/onboarding_card.tsx b/packages/website/ts/components/onboarding/onboarding_card.tsx new file mode 100644 index 000000000..bc83b8034 --- /dev/null +++ b/packages/website/ts/components/onboarding/onboarding_card.tsx @@ -0,0 +1,84 @@ +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 { Text, Title } from 'ts/components/ui/text'; + +export type ContinueButtonDisplay = 'enabled' | 'disabled'; + +export interface OnboardingCardProps { + title?: string; + content: React.ReactNode; + isLastStep: boolean; + onClose: () => void; + onClickNext: () => void; + onClickBack: () => void; + continueButtonDisplay?: ContinueButtonDisplay; + shouldHideBackButton?: boolean; + shouldHideNextButton?: boolean; + continueButtonText?: string; + borderRadius?: string; +} + +export const OnboardingCard: React.StatelessComponent<OnboardingCardProps> = ({ + title, + content, + continueButtonDisplay, + continueButtonText, + onClickNext, + onClickBack, + onClose, + shouldHideBackButton, + shouldHideNextButton, + borderRadius, +}) => ( + <Island borderRadius={borderRadius}> + <Container paddingRight="30px" paddingLeft="30px" maxWidth={350} paddingTop="15px" paddingBottom="15px"> + <div className="flex flex-column"> + <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} + > + {continueButtonText} + </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> +); + +OnboardingCard.defaultProps = { + continueButtonText: 'Continue', +}; + +OnboardingCard.displayName = 'OnboardingCard'; |