aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/standard_sliding_panel.tsx
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-11-14 09:31:38 +0800
committerGitHub <noreply@github.com>2018-11-14 09:31:38 +0800
commit4fc457b78b30e761164eac26fe5f1ebcddd11f7d (patch)
tree05a0d01029815d36370f8548d365289f555e8be4 /packages/instant/src/components/standard_sliding_panel.tsx
parente02dc13805349a770506350c69e9061f596b48b2 (diff)
parent2f6b1273aaf621beebcbc70af4bb6c5f4a8217a3 (diff)
downloaddexon-sol-tools-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.tar.gz
dexon-sol-tools-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.tar.zst
dexon-sol-tools-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.zip
Merge pull request #1242 from 0xProject/feature/instant/metamask-connect-flow
[instant] Install/Unlock MetaMask, connect PaymentDropdown to redux state
Diffstat (limited to 'packages/instant/src/components/standard_sliding_panel.tsx')
-rw-r--r--packages/instant/src/components/standard_sliding_panel.tsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/instant/src/components/standard_sliding_panel.tsx b/packages/instant/src/components/standard_sliding_panel.tsx
new file mode 100644
index 000000000..f587ff79a
--- /dev/null
+++ b/packages/instant/src/components/standard_sliding_panel.tsx
@@ -0,0 +1,29 @@
+import * as React from 'react';
+
+import { SlideAnimationState, StandardSlidingPanelContent, StandardSlidingPanelSettings } from '../types';
+
+import { InstallWalletPanelContent } from './install_wallet_panel_content';
+import { SlidingPanel } from './sliding_panel';
+
+export interface StandardSlidingPanelProps extends StandardSlidingPanelSettings {
+ onClose: () => void;
+}
+
+export class StandardSlidingPanel extends React.Component<StandardSlidingPanelProps> {
+ public render(): React.ReactNode {
+ const { animationState, content, onClose } = this.props;
+ return (
+ <SlidingPanel animationState={animationState} onClose={onClose}>
+ {this._getNodeForContent(content)}
+ </SlidingPanel>
+ );
+ }
+ private readonly _getNodeForContent = (content: StandardSlidingPanelContent): React.ReactNode => {
+ switch (content) {
+ case StandardSlidingPanelContent.InstallWallet:
+ return <InstallWalletPanelContent />;
+ case StandardSlidingPanelContent.None:
+ return null;
+ }
+ };
+}