11import React , { SetStateAction , useState } from "react" ;
2+ import { useSafeAreaInsets } from "react-native-safe-area-context" ;
23import {
34 Box ,
45 Button ,
@@ -46,6 +47,7 @@ export const CircularProgressScreen = () => {
4647 const [ selectedSize , setSelectedSize ] = useState < CircularProgressSizes > ( "md" ) ;
4748 const [ hasHints , setHasHints ] = useState < boolean > ( false ) ;
4849 const [ hasCustomTrack , setHasCustomTrack ] = useState < boolean > ( false ) ;
50+ const safeAreaInsets = useSafeAreaInsets ( ) ;
4951
5052 return (
5153 < Box style = { tailwind . style ( "flex-1 justify-center bg-white-900" ) } >
@@ -56,23 +58,25 @@ export const CircularProgressScreen = () => {
5658 >
5759 < CircularProgress
5860 style = { ! hasCustomTrack ? null : tailwind . style ( "w-48 h-48" ) }
59- hint = { ! hasHints ? null : `${ progressValue } %` }
61+ hint = { ! hasHints ? undefined : `${ progressValue } %` }
6062 value = { progressValue }
6163 themeColor = { selectedTheme }
6264 size = { selectedSize }
6365 progressTrackColor = {
64- ! hasCustomTrack ? null : tailwind . getColor ( "text-green-600" )
66+ ! hasCustomTrack ? undefined : tailwind . getColor ( "text-green-600" )
6567 }
6668 />
6769 </ Box >
6870 < Box
6971 style = { tailwind . style (
70- " rounded-t-lg shadow-lg bg-gray-100 justify-end p-2" ,
72+ ` rounded-t-lg shadow-lg bg-gray-100 justify-end px-2 pt-2 pb-[ ${ safeAreaInsets . bottom } ]` ,
7173 ) }
7274 >
7375 < RadioGroup
7476 value = { selectedSize }
75- onChange = { ( value : CircularProgressSizes ) => setSelectedSize ( value ) }
77+ onChange = { ( value : string ) =>
78+ setSelectedSize ( value as CircularProgressSizes )
79+ }
7680 orientation = "horizontal"
7781 >
7882 < Group label = "Sizes" >
@@ -84,7 +88,9 @@ export const CircularProgressScreen = () => {
8488 </ RadioGroup >
8589 < RadioGroup
8690 value = { selectedTheme }
87- onChange = { ( value : CircularProgressTheme ) => setSelectedTheme ( value ) }
91+ onChange = { ( value : string ) =>
92+ setSelectedTheme ( value as CircularProgressTheme )
93+ }
8894 orientation = "horizontal"
8995 >
9096 < Group label = "Theme" style = { tailwind . style ( "mt-2" ) } >
0 commit comments