-
Notifications
You must be signed in to change notification settings - Fork 67
/
StepContent.tsx
52 lines (47 loc) 路 1.16 KB
/
StepContent.tsx
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import {Button, Typography} from 'antd';
import React from 'react';
import {TooltipRenderProps} from 'react-joyride';
import * as S from './StepContent.styled';
const StepContent = ({
continuous,
index,
step,
backProps,
primaryProps,
tooltipProps,
size,
skipProps,
isLastStep,
}: TooltipRenderProps) => (
<S.Container {...tooltipProps} data-cy="onboarding-container">
<S.Header>
<S.Title>{step.title}</S.Title>
<S.TitleText data-cy="onboarding-step">{` ${index + 1} of ${size}`}</S.TitleText>
</S.Header>
<S.Body>
<Typography.Text>{step.content}</Typography.Text>
</S.Body>
<S.Footer>
<div>
{!isLastStep && (
<Button {...skipProps} type="text">
Skip
</Button>
)}
</div>
<div>
{index > 0 && !isLastStep && (
<Button {...backProps} type="text">
Prev
</Button>
)}
{continuous && (
<Button {...primaryProps} type="link" data-cy="onboarding-next">
{isLastStep ? 'Done' : 'Next'}
</Button>
)}
</div>
</S.Footer>
</S.Container>
);
export default StepContent;