11import { View , Text } from 'react-native' ;
22import React from 'react' ;
33import { styles } from './styles' ;
4- import type { SpeedoMeterProps } from './types' ;
4+ import type { CenterContentProps } from './types' ;
55
6- const CenterContent = ( props : SpeedoMeterProps ) => {
6+ const CenterContent = ( props : CenterContentProps ) => {
77 const {
88 title,
99 subTitle,
@@ -17,26 +17,28 @@ const CenterContent = (props: SpeedoMeterProps) => {
1717 isHideValue,
1818 value,
1919 centerContentStyle,
20- hideStyle ,
20+ unitValueContenStyle ,
2121 } = props ;
2222
2323 return (
2424 < View style = { [ styles . hideCenterContent , centerContentStyle ] } >
2525 { ! isHideTitle && (
26- < Text style = { [ titleStyle , styles . helperText ] } > { title } </ Text >
26+ < Text style = { [ styles . helperText , styles . subTitleWidth , titleStyle ] } >
27+ { title }
28+ </ Text >
2729 ) }
2830 { ! isHideValue && (
29- < View style = { [ styles . hideValue , hideStyle ] } >
30- < Text style = { [ styles . valueText , valueStyle , styles . large_header ] } >
31+ < View style = { [ styles . hideValue , unitValueContenStyle ] } >
32+ < Text style = { [ styles . valueText , styles . large_header , valueStyle ] } >
3133 { value }
3234 </ Text >
33- < Text style = { [ styles . valueUnit , unitStyle , styles . helperText ] } >
35+ < Text style = { [ styles . valueUnit , styles . helperText , unitStyle ] } >
3436 { unit }
3537 </ Text >
3638 </ View >
3739 ) }
3840 { ! isHideSubtitle && (
39- < Text style = { [ subTitleStyle , styles . helperText , styles . subTitleWidth ] } >
41+ < Text style = { [ styles . helperText , styles . subTitleWidth , subTitleStyle ] } >
4042 { subTitle }
4143 </ Text >
4244 ) }
0 commit comments