aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/onboarding/onboarding_flow.tsx
blob: 5bbf84e1bb186522fe2e24ee27f4598a8261668a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 }}
            />
        );
    }
};