11import dedent from "dedent" ;
22import { type ReactElement , useCallback , useMemo } from "react" ;
3- import { Alert , Animated , Button , Dimensions , SafeAreaView , Text , useAnimatedValue } from "react-native" ;
3+ import { Alert , Animated , Button , Dimensions , Platform , StatusBar , Text , View , useAnimatedValue } from "react-native" ;
44import {
55 AttachStep ,
6+ type RenderProps ,
7+ type SpotlightTour ,
68 SpotlightTourProvider ,
79 TourBox ,
810 type TourState ,
@@ -40,7 +42,7 @@ export function App(): ReactElement {
4042 } , [ ] ) ;
4143
4244 const tourSteps = useMemo ( ( ) : TourStep [ ] => [ {
43- render : ( { next, pause } ) => (
45+ render : ( { next, pause } : RenderProps ) => (
4446 < SpotDescriptionView >
4547 < DescriptionText >
4648 < BoldText > { "Tour: Intro section\n" } </ BoldText >
@@ -59,7 +61,7 @@ export function App(): ReactElement {
5961 render : DocsTooltip ,
6062 } , {
6163 arrow : true ,
62- render : props => (
64+ render : ( props : RenderProps ) => (
6365 < TourBox
6466 title = "Tour: Customization"
6567 backText = "Previous"
@@ -86,13 +88,13 @@ export function App(): ReactElement {
8688 Animated . spring ( gap , {
8789 bounciness : 100 ,
8890 speed : 1 ,
89- toValue : Dimensions . get ( "screen" ) . height * 0.25 ,
91+ toValue : Dimensions . get ( "screen" ) . height * 0.35 ,
9092 useNativeDriver : true ,
9193 } )
9294 . start ( ( ) => resolve ( ) ) ;
9395 } ) ;
9496 } ,
95- render : ( { previous, stop } ) => (
97+ render : ( { previous, stop } : RenderProps ) => (
9698 < SpotDescriptionView >
9799 < DescriptionText >
98100 < BoldText > { "Tour: Try it!\n" } </ BoldText >
@@ -115,7 +117,12 @@ export function App(): ReactElement {
115117 } ] , [ ] ) ;
116118
117119 return (
118- < SafeAreaView >
120+ < View style = { {
121+ flex : 1 ,
122+ paddingTop : Platform . OS === "android" ? StatusBar . currentHeight || 0 : 0 ,
123+ } }
124+ >
125+ < StatusBar translucent = { true } backgroundColor = "transparent" barStyle = "dark-content" />
119126 < SpotlightTourProvider
120127 steps = { tourSteps }
121128 overlayColor = "gray"
@@ -127,15 +134,16 @@ export function App(): ReactElement {
127134 motion = "bounce"
128135 shape = "circle"
129136 arrow = { { color : "#B0C4DE" } }
137+ coordinateAdjustment = { { y : 50 } }
130138 >
131- { ( { resume, start, status } ) => (
139+ { ( { resume, start, status } : SpotlightTour ) => (
132140 < >
133- { status !== "paused" && < Button title = "Start" onPress = { start } /> }
141+ { status !== "paused" && < View style = { { marginTop : 10 } } > < Button title = "Start" onPress = { start } /> </ View > }
134142 { status === "paused" && < Button title = "Resume" onPress = { resume } /> }
135143
136144 < SectionContainerView >
137- < AttachStep index = { 1 } >
138- < TitleText > { "Introduction" } </ TitleText >
145+ < AttachStep index = { 0 } >
146+ < TitleText > { "Introduction. " } </ TitleText >
139147 </ AttachStep >
140148 < DescriptionText >
141149 { dedent `
@@ -146,7 +154,7 @@ export function App(): ReactElement {
146154 </ SectionContainerView >
147155
148156 < SectionContainerView >
149- < AttachStep index = { 0 } >
157+ < AttachStep index = { 1 } >
150158 < TitleText > { "Documentation" } </ TitleText >
151159 </ AttachStep >
152160 < DescriptionText >
@@ -176,6 +184,6 @@ export function App(): ReactElement {
176184 </ >
177185 ) }
178186 </ SpotlightTourProvider >
179- </ SafeAreaView >
187+ </ View >
180188 ) ;
181189}
0 commit comments