From 475698ed92dc6310591ec9d0653eaa931d7e03f6 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 29 Oct 2018 17:02:46 -0700 Subject: feat: add basic panel component and other small improvements --- .../instant/src/components/instant_heading.tsx | 8 +++---- packages/instant/src/components/panel.tsx | 27 ++++++++++++++++++++++ packages/instant/src/components/ui/index.ts | 2 ++ .../src/components/zero_ex_instant_container.tsx | 5 ++-- packages/instant/src/style/z_index.ts | 5 ++++ 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 packages/instant/src/components/panel.tsx create mode 100644 packages/instant/src/style/z_index.ts diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx index 1ef276ff3..81aa62a77 100644 --- a/packages/instant/src/components/instant_heading.tsx +++ b/packages/instant/src/components/instant_heading.tsx @@ -8,9 +8,7 @@ import { AsyncProcessState, OrderProcessState, OrderState } from '../types'; import { format } from '../util/format'; import { AmountPlaceholder } from './amount_placeholder'; -import { Container, Flex, Text } from './ui'; -import { Icon } from './ui/icon'; -import { Spinner } from './ui/spinner'; +import { Container, Flex, Icon, Spinner, Text } from './ui'; export interface InstantHeadingProps { selectedAssetAmount?: BigNumber; @@ -72,11 +70,11 @@ export class InstantHeading extends React.Component { const processState = this.props.buyOrderState.processState; if (processState === OrderProcessState.FAILURE) { - return ; + return ; } else if (processState === OrderProcessState.PROCESSING) { return ; } else if (processState === OrderProcessState.SUCCESS) { - return ; + return ; } return undefined; } diff --git a/packages/instant/src/components/panel.tsx b/packages/instant/src/components/panel.tsx new file mode 100644 index 000000000..bb16ed9b1 --- /dev/null +++ b/packages/instant/src/components/panel.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; + +import { ColorOption } from '../style/theme'; +import { zIndex } from '../style/z_index'; + +import { Button, Container, Text } from './ui'; + +export interface PanelProps { + onClose?: () => void; +} + +export const Panel: React.StatelessComponent = ({ children, onClose }) => ( + + + {children} + +); diff --git a/packages/instant/src/components/ui/index.ts b/packages/instant/src/components/ui/index.ts index bf5f6c700..7cfee2491 100644 --- a/packages/instant/src/components/ui/index.ts +++ b/packages/instant/src/components/ui/index.ts @@ -3,3 +3,5 @@ export { Button } from './button'; export { Flex } from './flex'; export { Container } from './container'; export { Input } from './input'; +export { Icon } from './icon'; +export { Spinner } from './spinner'; diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx index ff19351ff..ded0d075e 100644 --- a/packages/instant/src/components/zero_ex_instant_container.tsx +++ b/packages/instant/src/components/zero_ex_instant_container.tsx @@ -6,6 +6,7 @@ import { SelectedAssetBuyOrderStateButtons } from '../containers/selected_asset_ import { SelectedAssetInstantHeading } from '../containers/selected_asset_instant_heading'; import { ColorOption } from '../style/theme'; +import { zIndex } from '../style/z_index'; import { Container, Flex } from './ui'; @@ -13,11 +14,11 @@ export interface ZeroExInstantContainerProps {} export const ZeroExInstantContainer: React.StatelessComponent = props => ( - +