@widergy/utilitygo-smart-bill-mobile 3.1.1 → 3.1.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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.1.2](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.1.1...v3.1.2) (2025-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGDESA-2724] smart bill visual fixes ([#47](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/issues/47)) ([65d24b5](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/commit/65d24b50e156e77da64a336c693de1ce4a216b10))
7
+
1
8
  ## [3.1.1](https://github.com/widergy/UtilityGO-Smart-Bill-Mobile/compare/v3.1.0...v3.1.1) (2025-10-06)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/utilitygo-smart-bill-mobile",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "UtilityGO SmartBill Mobile",
5
5
  "license": "MIT",
6
6
  "main": "src/lib/index.js",
@@ -122,11 +122,12 @@ const SmartBillSummary = ({
122
122
  {filteredTabOptions.find(tab => tab.value === currentTab)?.header && (
123
123
  <BillHeader
124
124
  assets={assets}
125
+ billNumber={smartBill?.bill_number}
126
+ billType={smartBill?.bill_type}
125
127
  colors={colors}
126
- header={translations?.billingTab.header}
127
128
  debtStatusLabel={smartBill?.debt_status_label}
129
+ header={translations?.billingTab.header}
128
130
  smartBill={smartBill}
129
- billNumber={smartBill?.bill_number}
130
131
  />
131
132
  )}
132
133
  {TAB_COMPONENT_MAPPER?.[currentTab]?.({
@@ -0,0 +1,45 @@
1
+ /* eslint-disable react/forbid-prop-types */
2
+ import React from 'react';
3
+ import { Surface, UTLabel } from '@widergy/mobile-ui';
4
+ import { View } from 'react-native';
5
+ import { object, string } from 'prop-types';
6
+
7
+ import { createStyles } from './styles';
8
+
9
+ const AccountCard = ({ accountCard, colors, meterNumber, readingType }) => {
10
+ const styles = createStyles(colors);
11
+ const { title: accountCardTitle, meterNumberHelpText, readingTypeHelpText } = accountCard;
12
+
13
+ return (
14
+ <Surface elevation={1} style={styles.accountCard}>
15
+ <UTLabel variant="title3" weight="medium">
16
+ {accountCardTitle}
17
+ </UTLabel>
18
+
19
+ <View style={styles.container}>
20
+ {!!meterNumber && (
21
+ <View style={styles.content}>
22
+ <UTLabel weight="bold">{meterNumber}</UTLabel>
23
+ <UTLabel colorTheme="gray">{meterNumberHelpText}</UTLabel>
24
+ </View>
25
+ )}
26
+
27
+ {!!readingType && (
28
+ <View style={styles.content}>
29
+ <UTLabel weight="bold">{readingType}</UTLabel>
30
+ <UTLabel colorTheme="gray">{readingTypeHelpText}</UTLabel>
31
+ </View>
32
+ )}
33
+ </View>
34
+ </Surface>
35
+ );
36
+ };
37
+
38
+ AccountCard.propTypes = {
39
+ accountCard: object,
40
+ colors: object,
41
+ meterNumber: string,
42
+ readingType: string
43
+ };
44
+
45
+ export default AccountCard;
@@ -0,0 +1,21 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export const createStyles = colors =>
4
+ StyleSheet.create({
5
+ accountCard: {
6
+ backgroundColor: colors.light01,
7
+ borderRadius: 8,
8
+ padding: 16,
9
+ flexDirection: 'column',
10
+ gap: 24
11
+ },
12
+ container: {
13
+ flexDirection: 'row'
14
+ },
15
+ content: {
16
+ flex: 1,
17
+ flexDirection: 'column',
18
+ gap: 8,
19
+ paddingVertical: 12
20
+ }
21
+ });
@@ -6,34 +6,33 @@ import { arrayOf, object } from 'prop-types';
6
6
 
7
7
  import styles from './styles';
8
8
 
9
- const ActionCards = ({ actionCards }) => {
10
- return (
11
- <View style={styles.actionCardsContainer}>
12
- {actionCards?.map(({ onPress, Icon = 'IconChevronRight', statusAttributes = {}, title }) => (
13
- <UTActionCard
14
- classNames={{ headerTitles: styles.headerAndChildrenContainer }}
15
- disabled={!onPress}
16
- headerActions={
17
- onPress
18
- ? [
19
- {
20
- colorTheme: 'accent',
21
- Icon,
22
- isPrimary: true
23
- }
24
- ]
25
- : []
26
- }
27
- key={title}
28
- mainAction={onPress}
29
- title={title}
30
- titleProps={{ style: styles.titleActionCard }}
31
- {...statusAttributes}
32
- />
33
- ))}
34
- </View>
35
- );
36
- };
9
+ const ActionCards = ({ actionCards }) => (
10
+ <View style={styles.actionCardsContainer}>
11
+ {actionCards?.map(({ onPress, Icon = 'IconChevronRight', statusAttributes = {}, title, description }) => (
12
+ <UTActionCard
13
+ classNames={{ headerTitles: styles.headerAndChildrenContainer }}
14
+ disabled={!onPress}
15
+ headerActions={
16
+ onPress
17
+ ? [
18
+ {
19
+ colorTheme: 'accent',
20
+ Icon,
21
+ isPrimary: true
22
+ }
23
+ ]
24
+ : []
25
+ }
26
+ key={title}
27
+ mainAction={onPress}
28
+ title={title}
29
+ description={description}
30
+ titleProps={{ style: styles.titleActionCard }}
31
+ {...statusAttributes}
32
+ />
33
+ ))}
34
+ </View>
35
+ );
37
36
 
38
37
  ActionCards.propTypes = {
39
38
  actionCards: arrayOf(object),
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/forbid-prop-types */
2
2
  import React from 'react';
3
- import { Surface, UTLabel } from '@widergy/mobile-ui';
3
+ import { Surface, UTLabel, UTStatus } from '@widergy/mobile-ui';
4
4
  import { View, Image } from 'react-native';
5
5
  import { string, object } from 'prop-types';
6
6
 
@@ -9,7 +9,7 @@ import { getCurrentPeriod, getFormattedDate } from '../../utils';
9
9
 
10
10
  import { createStyles } from './styles';
11
11
 
12
- const BillHeader = ({ assets, colors, header, debtStatusLabel, smartBill, billNumber }) => {
12
+ const BillHeader = ({ assets, colors, header, debtStatusLabel, smartBill, billNumber, billType }) => {
13
13
  const styles = createStyles(colors);
14
14
  const { UtilityLogo } = assets.billingTab;
15
15
 
@@ -22,7 +22,14 @@ const BillHeader = ({ assets, colors, header, debtStatusLabel, smartBill, billNu
22
22
  {UtilityLogo && <Image resizeMode="contain" source={UtilityLogo} height={35} />}
23
23
  <View style={styles.billHeaderLabels}>
24
24
  <View style={styles.valueAndHelpText}>
25
- <UTLabel variant="small">{billNumber}</UTLabel>
25
+ <View style={styles.billTypeAndNumber}>
26
+ {!!billType && (
27
+ <UTStatus variant="gray" withoutIcon labelProps={{ colorTheme: 'dark' }}>
28
+ {billType}
29
+ </UTStatus>
30
+ )}
31
+ <UTLabel variant="small">{billNumber}</UTLabel>
32
+ </View>
26
33
  <UTLabel colorTheme="gray" variant="small">
27
34
  {billTypeHelpText}
28
35
  </UTLabel>
@@ -45,11 +52,12 @@ const BillHeader = ({ assets, colors, header, debtStatusLabel, smartBill, billNu
45
52
 
46
53
  BillHeader.propTypes = {
47
54
  assets: object,
55
+ billNumber: string,
56
+ billType: string,
48
57
  colors: object,
49
- header: object,
50
58
  debtStatusLabel: string,
51
- smartBill: object,
52
- billNumber: string
59
+ header: object,
60
+ smartBill: object
53
61
  };
54
62
 
55
63
  export default BillHeader;
@@ -24,5 +24,10 @@ export const createStyles = colors =>
24
24
  padding: 16,
25
25
  marginHorizontal: 16,
26
26
  marginTop: 16
27
+ },
28
+ billTypeAndNumber: {
29
+ alignItems: 'center',
30
+ flexDirection: 'row',
31
+ gap: 4
27
32
  }
28
33
  });
@@ -2,10 +2,12 @@ import ActionCards from './components/ActionCards';
2
2
  import TotalCard from './components/TotalCard';
3
3
  import RateCard from './components/RateCard';
4
4
  import TitularCard from './components/TitularCard';
5
+ import AccountCard from './components/AccountCard';
5
6
 
6
7
  export const COMPONENTS = {
8
+ AccountCard,
7
9
  ActionCards,
8
- TotalCard,
9
10
  RateCard,
10
- TitularCard
11
+ TitularCard,
12
+ TotalCard
11
13
  };
@@ -26,9 +26,12 @@ const Billing = ({
26
26
  client,
27
27
  debt_status_label: debtStatusLabel,
28
28
  detail,
29
- expirations
29
+ expirations,
30
+ meter_number: meterNumber,
31
+ reading_periods: readingPeriods
30
32
  } = smartBill;
31
33
  const {
34
+ accountCard = {},
32
35
  adhered,
33
36
  automaticDebit = {},
34
37
  digitalBill = {},
@@ -58,13 +61,16 @@ const Billing = ({
58
61
  const { title: automaticDebitTitle } = automaticDebit;
59
62
  const isAdheredToDigitalBill = client?.adherence_to_digital_bill;
60
63
  const isAdheredToAutomaticDebit = adherenceToAutomaticDebit === adherenceStatus?.subscribed;
64
+ const emailDigitalBill = client?.email_digital_bill;
65
+ const readingType = readingPeriods?.[0]?.type;
61
66
 
62
67
  const actionCards = [
63
68
  {
64
69
  isAdhered: isAdheredToDigitalBill,
65
70
  onPress: !isAdheredToDigitalBill && handleGoToDigitalBill,
66
71
  showStatus: true,
67
- title: digitalBillTitle
72
+ title: digitalBillTitle,
73
+ description: emailDigitalBill
68
74
  },
69
75
  {
70
76
  isAdhered: isAdheredToAutomaticDebit,
@@ -94,6 +100,7 @@ const Billing = ({
94
100
  };
95
101
  });
96
102
  const props = {
103
+ accountCard,
97
104
  actionCards,
98
105
  assets,
99
106
  billNumber,
@@ -109,13 +116,15 @@ const Billing = ({
109
116
  formatAmount,
110
117
  handlers,
111
118
  header,
119
+ meterNumber,
112
120
  normalizedRate,
113
121
  rateCardTranslations,
114
122
  ratesTableLink,
115
- titularCard,
123
+ readingType,
116
124
  smartBill,
117
125
  subsidy,
118
126
  subsidyLevels,
127
+ titularCard,
119
128
  totalAmountLabel,
120
129
  totalCard,
121
130
  trackRedirectionToExternalLink,