Skip to content

Commit

Permalink
Merge pull request sap-labs-france#595 from sap-labs-france/fixes
Browse files Browse the repository at this point in the history
Fixed statistics and charging stations styles
  • Loading branch information
LucasBrazi06 authored Jan 10, 2022
2 parents 62c1c6b + 1f13680 commit d009b30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/I18n/I18nManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export default class I18nManager {
(!options.compactThreshold || (options.compactThreshold && value > options.compactThreshold));
const isCurrency = options.currency && options.style === NumberFormatStyleEnum.CURRENCY;
options.currency = options.currency || I18nManager.currency;
if(!options.currency) {
delete options.currency
}
const isUnit = options.unit && options.style === NumberFormatStyleEnum.UNIT;
const isPercent = options.style === NumberFormatStyleEnum.PERCENT;

Expand Down
4 changes: 1 addition & 3 deletions src/components/charging-station/ChargingStationComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ export default class ChargingStationComponent extends React.Component<Props, Sta
</View>
</View>
<View style={style.subHeaderContent}>
{chargingStation.siteArea ? (
{chargingStation.siteArea && (
<Text style={style.address} ellipsizeMode={'tail'} numberOfLines={1}>
{Utils.formatAddress(chargingStation.siteArea.address)}
</Text>
) : (
<Text>-</Text>
)}
{chargingStation.distanceMeters > 0 && <Text style={style.distance}>{Utils.formatDistance(chargingStation.distanceMeters)}</Text>}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default function computeStyleSheet(): StyleSheet.NamedStyles<any> {
},
address: {
color: commonColor.textColor,
fontSize: '12@s'
fontSize: '12@s',
flex: 1
},
distance: {
color: commonColor.textColor
Expand Down
2 changes: 1 addition & 1 deletion src/screens/statistics/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default class Statistics extends BaseScreen<Props, State> {
compactDisplay: 'long',
compactThreshold: 1000000
});
const totalCost = I18nManager.formatNumberWithCompacts(totalPrice, {
const totalCost = !isPricingActive ? null : I18nManager.formatNumberWithCompacts(totalPrice, {
notation: NumberFormatNotationEnum.COMPACT,
compactStyle: NumberFormatCompactStyleEnum.FINANCE,
compactDisplay: 'short',
Expand Down

0 comments on commit d009b30

Please sign in to comment.