aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/onboarding
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-05-23 01:15:58 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-05-25 01:51:06 +0800
commit7af77d3eb0a73a0bd27898f5d3842c7dc7afef77 (patch)
tree9e054751e325965ce7c0d6ab18dbbd7447808751 /packages/website/ts/components/onboarding
parentde1ff52de3c9953dfb60283c8025b73d6e417029 (diff)
downloaddexon-sol-tools-7af77d3eb0a73a0bd27898f5d3842c7dc7afef77.tar.gz
dexon-sol-tools-7af77d3eb0a73a0bd27898f5d3842c7dc7afef77.tar.zst
dexon-sol-tools-7af77d3eb0a73a0bd27898f5d3842c7dc7afef77.zip
Basic onboarding flow infrastructure set up
Diffstat (limited to 'packages/website/ts/components/onboarding')
-rw-r--r--packages/website/ts/components/onboarding/onboarding_flow.tsx31
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx29
2 files changed, 60 insertions, 0 deletions
diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx
new file mode 100644
index 000000000..5bbf84e1b
--- /dev/null
+++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx
@@ -0,0 +1,31 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import Joyride, { Step, StyleOptions } from 'react-joyride';
+
+import { zIndex } from 'ts/utils/style';
+
+interface OnboardingFlowProps {
+ steps: Step[];
+ stepIndex?: number;
+ isRunning: boolean;
+}
+
+const style: StyleOptions = {
+ zIndex: zIndex.overlay,
+};
+
+// Wrapper around Joyride with defaults and styles set
+export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
+ public render(): React.ReactNode {
+ const { steps, stepIndex, isRunning } = this.props;
+ return (
+ <Joyride
+ run={isRunning}
+ debug={true}
+ steps={steps}
+ stepIndex={stepIndex}
+ styles={{ options: style }}
+ />
+ );
+ }
+};
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
new file mode 100644
index 000000000..57b209fac
--- /dev/null
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -0,0 +1,29 @@
+import * as React from 'react';
+
+import { OnboardingFlow } from 'ts/components/onboarding/onboarding_flow';
+
+export interface PortalOnboardingFlowProps {
+ stepIndex: number;
+ isRunning: boolean;
+}
+
+const steps = [
+ {
+ target: '.wallet',
+ content: 'Hey!',
+ placement: 'right',
+ disableBeacon: true,
+ },
+];
+
+export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlow> {
+ public render(): React.ReactNode {
+ return (
+ <OnboardingFlow
+ steps={steps}
+ stepIndex={this.props.stepIndex}
+ isRunning={this.props.isRunning}
+ />
+ )
+ }
+};