aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/zero_ex_instant_container.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-31 07:57:42 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-31 07:57:42 +0800
commit91f8487947d7941b508c34d1bfc1e72c0840c33d (patch)
treef3382eda9cae53b2b61e9f2c3cd4690ce6d7cc52 /packages/instant/src/components/zero_ex_instant_container.tsx
parent4456c3ee14f5cd778e0d16ab42a3e2e34d102f23 (diff)
downloaddexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar.gz
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar.bz2
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar.lz
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar.xz
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.tar.zst
dexon-sol-tools-91f8487947d7941b508c34d1bfc1e72c0840c33d.zip
feat: implement sliding panel
Diffstat (limited to 'packages/instant/src/components/zero_ex_instant_container.tsx')
-rw-r--r--packages/instant/src/components/zero_ex_instant_container.tsx78
1 files changed, 50 insertions, 28 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx
index c8d5235c8..818a9a957 100644
--- a/packages/instant/src/components/zero_ex_instant_container.tsx
+++ b/packages/instant/src/components/zero_ex_instant_container.tsx
@@ -7,36 +7,58 @@ import { SelectedAssetInstantHeading } from '../containers/selected_asset_instan
import { ColorOption } from '../style/theme';
import { zIndex } from '../style/z_index';
-import { Panel } from './panel';
+import { SlideAnimationState } from './animations/slide_animation';
+import { SlidingPanel } from './sliding_panel';
import { Container, Flex } from './ui';
export interface ZeroExInstantContainerProps {}
+export interface ZeroExInstantContainerState {
+ tokenSelectionPanelAnimationState: SlideAnimationState;
+}
-export const ZeroExInstantContainer: React.StatelessComponent<ZeroExInstantContainerProps> = props => (
- <Container width="350px" position="relative">
- <Container zIndex={zIndex.errorPopup} position="relative">
- <LatestError />
- </Container>
- <Container
- zIndex={zIndex.mainContainer}
- position="relative"
- backgroundColor={ColorOption.white}
- borderRadius="3px"
- hasBoxShadow={true}
- overflow="hidden"
- >
- <Flex direction="column" justify="flex-start">
- <SelectedAssetInstantHeading />
- <LatestBuyQuoteOrderDetails />
- <Container padding="20px" width="100%">
- <SelectedAssetBuyOrderStateButtons />
+export class ZeroExInstantContainer extends React.Component<ZeroExInstantContainerProps, ZeroExInstantContainerState> {
+ public state = {
+ tokenSelectionPanelAnimationState: 'none' as SlideAnimationState,
+ };
+ public render(): React.ReactNode {
+ return (
+ <Container width="350px" position="relative">
+ <Container zIndex={zIndex.errorPopup} position="relative">
+ <LatestError />
</Container>
- </Flex>
- {/* <Container position="absolute" left="0px" bottom="0px" width="100%" height="100%">
- <SlideAnimationHelper direction="up" downY="200px">
- <Panel> Hey </Panel>
- </SlideAnimationHelper>
- </Container> */}
- </Container>
- </Container>
-);
+ <Container
+ zIndex={zIndex.mainContainer}
+ position="relative"
+ backgroundColor={ColorOption.white}
+ borderRadius="3px"
+ hasBoxShadow={true}
+ overflow="hidden"
+ >
+ <Flex direction="column" justify="flex-start">
+ <SelectedAssetInstantHeading onSymbolClick={this._handleSymbolClick} />
+ <LatestBuyQuoteOrderDetails />
+ <Container padding="20px" width="100%">
+ <SelectedAssetBuyOrderStateButtons />
+ </Container>
+ </Flex>
+ <SlidingPanel
+ animationState={this.state.tokenSelectionPanelAnimationState}
+ onClose={this._handlePanelClose}
+ >
+ Select Your Token
+ </SlidingPanel>
+ </Container>
+ </Container>
+ );
+ }
+ private readonly _handleSymbolClick = (): void => {
+ this.setState({
+ tokenSelectionPanelAnimationState: 'slidIn',
+ });
+ };
+ private readonly _handlePanelClose = (): void => {
+ this.setState({
+ tokenSelectionPanelAnimationState: 'slidOut',
+ });
+ };
+}