@widergy/utilitygo-smart-bill-mobile 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/lib/components/SmartBillSummary/index.js +26 -20
- package/src/lib/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/index.js +27 -21
- package/src/lib/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionComparison/styles.js +4 -0
- package/src/lib/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionEvolution/index.js +11 -6
- package/src/lib/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/components/ConsumptionEvolution/utils.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.4.2](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v2.4.1...v2.4.2) (2025-05-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* configurable ai drawer ([#35](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/35)) ([ba8f400](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/ba8f4001fde2bf15687202fd4e6231c75be84e3a))
|
|
7
|
+
|
|
8
|
+
## [2.4.1](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v2.4.0...v2.4.1) (2025-05-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* smartbill consumption comparison ([#33](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/33)) ([9686b13](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/9686b13ac715e38086ffb288d726955b3123ec6f))
|
|
14
|
+
|
|
1
15
|
# [2.4.0](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v2.3.0...v2.4.0) (2025-05-14)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/forbid-prop-types */
|
|
2
|
-
|
|
2
|
+
/* eslint-disable react/jsx-fragments */
|
|
3
|
+
import React, { Fragment, useEffect, useState } from 'react';
|
|
3
4
|
import { UTButton, UTLoading, UTTabs } from '@widergy/mobile-ui';
|
|
4
5
|
import { View } from 'react-native';
|
|
5
6
|
import { arrayOf, bool, func, object, shape, string } from 'prop-types';
|
|
@@ -23,6 +24,7 @@ const SmartBillSummary = ({
|
|
|
23
24
|
}) => {
|
|
24
25
|
const {
|
|
25
26
|
aiQuestionsList,
|
|
27
|
+
aiQuestionsPanelEnabled,
|
|
26
28
|
glossaryError,
|
|
27
29
|
glossaryLoading,
|
|
28
30
|
notEnoughBillsErrorType,
|
|
@@ -79,26 +81,30 @@ const SmartBillSummary = ({
|
|
|
79
81
|
})}
|
|
80
82
|
</View>
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
{aiQuestionsPanelEnabled && (
|
|
85
|
+
<Fragment>
|
|
86
|
+
<UTButton
|
|
87
|
+
colorTheme="primary"
|
|
88
|
+
Icon="EnergyIconChatSparkFilled"
|
|
89
|
+
onPress={openAIDrawer}
|
|
90
|
+
style={{ icon: styles.AIFloatButtonIcon, root: styles.AIFloatButton }}
|
|
91
|
+
/>
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
<AIDrawer
|
|
94
|
+
aiQuestionsList={aiQuestionsList}
|
|
95
|
+
answer={smartBillAIAnswer}
|
|
96
|
+
colors={colors}
|
|
97
|
+
components={components}
|
|
98
|
+
error={smartBillAIAnswerError}
|
|
99
|
+
getAnswer={getSmartBillAIAnswer}
|
|
100
|
+
isOpen={aiDrawerIsOpen}
|
|
101
|
+
loading={smartBillAIAnswerLoading}
|
|
102
|
+
notEnoughBillsErrorType={notEnoughBillsErrorType}
|
|
103
|
+
onClose={closeAIDrawer}
|
|
104
|
+
translations={translations}
|
|
105
|
+
/>
|
|
106
|
+
</Fragment>
|
|
107
|
+
)}
|
|
102
108
|
</UTLoading>
|
|
103
109
|
);
|
|
104
110
|
};
|
|
@@ -13,33 +13,39 @@ const ConsumptionComparison = ({ colors, periodsToCompare = [], texts }) => {
|
|
|
13
13
|
const styles = createStyles(colors);
|
|
14
14
|
const maxValue = getMaxValue(periodsToCompare);
|
|
15
15
|
const title = texts?.consumptions?.comparisonTitle;
|
|
16
|
+
const showComparison = periodsToCompare?.length > 1;
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<Fragment>
|
|
19
|
-
<UTLabel
|
|
20
|
+
<UTLabel
|
|
21
|
+
colorTheme="gray"
|
|
22
|
+
style={showComparison ? styles.consumptionComparisonLabel : styles.consumptionComparisonLabelNoData}
|
|
23
|
+
variant="small">
|
|
20
24
|
{title}
|
|
21
25
|
</UTLabel>
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
{showComparison && (
|
|
27
|
+
<View style={styles.container}>
|
|
28
|
+
{periodsToCompare.map(({ consumptions, current, number, settlements, year }) => {
|
|
29
|
+
const { value, unit } = consumptions?.[0] || {};
|
|
30
|
+
const barHeight = getBarHeight(maxValue, value);
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
return (
|
|
33
|
+
<View key={number + year} style={styles.barContainer}>
|
|
34
|
+
<UTLabel style={styles.value} variant="small">
|
|
35
|
+
{getFormattedValue(value, unit)}
|
|
36
|
+
</UTLabel>
|
|
37
|
+
<GradientBar colors={colors} height={barHeight} isCurrent={current} />
|
|
38
|
+
<UTLabel style={styles.year} variant="small" weight="medium">
|
|
39
|
+
{year}
|
|
40
|
+
</UTLabel>
|
|
41
|
+
<UTLabel style={styles.period} colorTheme="gray" variant="small">
|
|
42
|
+
{getPeriod(settlements)}
|
|
43
|
+
</UTLabel>
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
})}
|
|
47
|
+
</View>
|
|
48
|
+
)}
|
|
43
49
|
</Fragment>
|
|
44
50
|
);
|
|
45
51
|
};
|
|
@@ -12,11 +12,16 @@ const ConsumptionEvolution = ({ assets, colors, periods, texts }) => {
|
|
|
12
12
|
const { consumptionEvolution: backgroundImages } = assets || {};
|
|
13
13
|
const { consumptionEvolution: consumptionEvolutionLabels } = texts || {};
|
|
14
14
|
const { title } = consumptionEvolutionLabels || {};
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const {
|
|
16
|
+
colorTheme,
|
|
17
|
+
description,
|
|
18
|
+
icon,
|
|
19
|
+
Image,
|
|
20
|
+
percentage,
|
|
21
|
+
period,
|
|
22
|
+
shade = '04',
|
|
23
|
+
size = 24
|
|
24
|
+
} = getConsumptionComparison(backgroundImages, consumptionEvolutionLabels, periods);
|
|
20
25
|
|
|
21
26
|
return (
|
|
22
27
|
<UTActionCard
|
|
@@ -28,7 +33,7 @@ const ConsumptionEvolution = ({ assets, colors, periods, texts }) => {
|
|
|
28
33
|
surfaceElevation={0}>
|
|
29
34
|
<View style={styles.childrenContainer}>
|
|
30
35
|
<View style={styles.chipContainer}>
|
|
31
|
-
<UTIcon area colorTheme={colorTheme} name={icon} shade=
|
|
36
|
+
<UTIcon area colorTheme={colorTheme} name={icon} shade={shade} size={size} />
|
|
32
37
|
{percentage && (
|
|
33
38
|
<UTLabel colorTheme={colorTheme} variant="title2" weight="medium">
|
|
34
39
|
{percentage}
|