22import React , { Component } from 'react' ;
33import { Animated , Easing , View , Text , NativeModules , Modal , StatusBar , Platform } from 'react-native' ;
44import Tooltip from './Tooltip' ;
5+ import StepNumber from './StepNumber' ;
56import styles , { MARGIN , ARROW_SIZE , STEP_NUMBER_DIAMETER , STEP_NUMBER_RADIUS } from './style' ;
67
78type Props = {
@@ -16,6 +17,7 @@ type Props = {
1617 easing : ?func ,
1718 animationDuration : ?number ,
1819 tooltipComponent : ?React$Component ,
20+ stepNumberComponent : ?React$Component ,
1921 overlay : 'svg' | 'view' ,
2022 animated : boolean ,
2123 androidStatusBarVisible : boolean ,
@@ -39,6 +41,7 @@ class CopilotModal extends Component<Props, State> {
3941 easing : Easing . elastic ( 0.7 ) ,
4042 animationDuration : 400 ,
4143 tooltipComponent : Tooltip ,
44+ stepNumberComponent : StepNumber ,
4245 // If react-native-svg native module was avaialble, use svg as the default overlay component
4346 overlay : typeof NativeModules . RNSVGSvgViewManager !== 'undefined' ? 'svg' : 'view' ,
4447 // If animated was not specified, rely on the default overlay type
@@ -235,20 +238,25 @@ class CopilotModal extends Component<Props, State> {
235238 }
236239
237240 renderTooltip ( ) {
238- const { tooltipComponent : TooltipComponent } = this . props ;
241+ const { tooltipComponent : TooltipComponent , stepNumberComponent : StepNumberComponent } = this . props ;
239242
240243 return [
241244 < Animated . View
242245 key = "stepNumber"
243246 style = { [
244- styles . stepNumber ,
247+ styles . stepNumberContainer ,
245248 {
246249 left : this . state . animatedValues . stepNumberLeft ,
247250 top : Animated . add ( this . state . animatedValues . top , - STEP_NUMBER_RADIUS ) ,
248251 } ,
249252 ] }
250253 >
251- < Text style = { [ styles . stepNumberText ] } > { this . props . currentStepNumber } </ Text >
254+ < StepNumberComponent
255+ isFirstStep = { this . props . isFirstStep }
256+ isLastStep = { this . props . isLastStep }
257+ currentStep = { this . props . currentStep }
258+ currentStepNumber = { this . props . currentStepNumber }
259+ />
252260 </ Animated . View > ,
253261 < Animated . View key = "arrow" style = { [ styles . arrow , this . state . arrow ] } /> ,
254262 < Animated . View key = "tooltip" style = { [ styles . tooltip , this . state . tooltip ] } >
0 commit comments