11import {
22 Body ,
33 H6 ,
4- HSpacer ,
4+ HStack ,
5+ IconButton ,
56 IOButton ,
67 IOColors ,
78 useIOTheme ,
8- VSpacer
9+ VStack
910} from "@pagopa/io-app-design-system" ;
1011import { useCallback , useState } from "react" ;
1112import { Dimensions , StyleSheet , View } from "react-native" ;
@@ -123,43 +124,51 @@ export const TourTooltip = ({
123124 ] }
124125 />
125126 < View style = { [ styles . tooltip , { backgroundColor : tooltipBgColor } ] } >
126- < H6 > { title } </ H6 >
127- < VSpacer size = { 4 } />
128- < Body > { description } </ Body >
129- < VSpacer size = { 8 } />
130- < Body weight = "Semibold" > { `${ stepIndex + 1 } / ${ totalSteps } ` } </ Body >
131- < VSpacer size = { 16 } />
132- < View style = { styles . buttonsRow } >
133- < IOButton
134- variant = "link"
135- color = "primary"
136- label = { I18n . t ( "features.tour.skip" ) }
137- onPress = { handleSkip }
138- />
139- < View style = { styles . rightButtons } >
140- { ! isFirstStep && (
141- < >
127+ < VStack space = { 16 } >
128+ < VStack space = { 4 } >
129+ < HStack
130+ space = { 8 }
131+ style = { {
132+ justifyContent : "space-between" ,
133+ alignItems : "flex-start"
134+ } }
135+ >
136+ < H6 style = { { flexShrink : 1 } } > { title } </ H6 >
137+ < IconButton
138+ icon = "closeSmall"
139+ color = "neutral"
140+ accessibilityLabel = { I18n . t ( "features.tour.skip" ) }
141+ onPress = { handleSkip }
142+ />
143+ </ HStack >
144+ < Body > { description } </ Body >
145+ </ VStack >
146+ < HStack
147+ style = { { justifyContent : "space-between" , alignItems : "center" } }
148+ >
149+ < Body weight = "Semibold" > { `${ stepIndex + 1 } / ${ totalSteps } ` } </ Body >
150+ < HStack space = { 8 } style = { { alignItems : "center" } } >
151+ { ! isFirstStep && (
142152 < IOButton
143153 variant = "link"
144154 color = "primary"
145155 label = { I18n . t ( "features.tour.back" ) }
146156 onPress = { handleBack }
147157 />
148- < HSpacer size = { 8 } />
149- </ >
150- ) }
151- < IOButton
152- variant = "link"
153- color = "primary"
154- label = {
155- isLastStep
156- ? I18n . t ( "features.tour.done" )
157- : I18n . t ( "features.tour.next" )
158- }
159- onPress = { handleNext }
160- />
161- </ View >
162- </ View >
158+ ) }
159+ < IOButton
160+ variant = "link"
161+ color = "primary"
162+ label = {
163+ isLastStep
164+ ? I18n . t ( "features.tour.done" )
165+ : I18n . t ( "features.tour.next" )
166+ }
167+ onPress = { handleNext }
168+ />
169+ </ HStack >
170+ </ HStack >
171+ </ VStack >
163172 </ View >
164173 </ Animated . View >
165174 ) ;
@@ -168,28 +177,19 @@ export const TourTooltip = ({
168177const styles = StyleSheet . create ( {
169178 container : {
170179 position : "absolute" ,
171- zIndex : 10000
180+ zIndex : 100
172181 } ,
173182 tooltip : {
174183 borderRadius : BORDER_RADIUS ,
175184 borderCurve : "continuous" ,
176- padding : 16 ,
177- boxShadow : "0px 2px 8px rgba(0, 0, 0, 0.15)"
185+ boxShadow : "0px 2px 8px rgba(0, 0, 0, 0.15)" ,
186+ padding : 16
178187 } ,
179188 arrow : {
180189 position : "absolute" ,
181190 width : ARROW_SIZE ,
182191 height : ARROW_SIZE ,
183192 transform : [ { rotate : "45deg" } ] ,
184193 zIndex : 2
185- } ,
186- buttonsRow : {
187- flexDirection : "row" ,
188- justifyContent : "space-between" ,
189- alignItems : "center"
190- } ,
191- rightButtons : {
192- flexDirection : "row" ,
193- alignItems : "center"
194194 }
195195} ) ;
0 commit comments