@eohjsc/react-native-smart-city 0.3.89 → 0.3.90

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.3.89",
4
+ "version": "0.3.90",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -36,14 +36,13 @@ describe('Test ProgressBar', () => {
36
36
  configuration: { max_value: 100 },
37
37
  value: 8,
38
38
  };
39
- const data = [{ value: 10 }];
39
+ const data = [{ value: 10, unit: 'oC' }];
40
40
  await act(async () => {
41
41
  tree = renderer.create(wrapComponent(item, data));
42
42
  });
43
43
  const instance = tree.root;
44
44
  const texts = instance.findAllByType(Text);
45
45
  expect(texts[0].props.children).toBe('Value bar');
46
- expect(texts[1].props.children).toEqual(['Max value', ': ', 100]);
47
- expect(texts[2].props.children).toEqual([10, ' ', undefined]);
46
+ expect(texts[1].props.children).toEqual('Max value: 100 oC');
48
47
  });
49
48
  });
@@ -23,7 +23,7 @@ const ProgressBar = memo(({ data = [], item }) => {
23
23
  </Text>
24
24
 
25
25
  <Text size={16} style={styles.textMaxValue}>
26
- {t('max_value')}: {maxValue}
26
+ {`${t('max_value')}: ${maxValue} ${unit || measure}`}
27
27
  </Text>
28
28
 
29
29
  <View style={styles.wrapProgressBar}>
@@ -36,9 +36,11 @@ const ProgressBar = memo(({ data = [], item }) => {
36
36
  borderWidth={0}
37
37
  borderRadius={10}
38
38
  />
39
- <Text style={styles.textValue}>
40
- {value} {unit || measure}
41
- </Text>
39
+ <View>
40
+ <Text numberOfLines={1} style={styles.textValue}>
41
+ {value}
42
+ </Text>
43
+ </View>
42
44
  </View>
43
45
  </View>
44
46
  );
@@ -6,29 +6,32 @@ export default StyleSheet.create({
6
6
  container: {
7
7
  flex: 1,
8
8
  flexDirection: 'column', //column direction
9
- marginRight: 60,
10
- marginLeft: 60,
9
+ marginHorizontal: 30,
11
10
  borderWidth: 1,
12
- padding: 12,
11
+ padding: 16,
13
12
  borderRadius: 8,
14
13
  borderColor: Colors.Gray4,
15
14
  marginBottom: 12,
16
15
  },
17
16
  textLabel: {
18
- paddingHorizontal: 16,
17
+ paddingHorizontal: 15,
19
18
  paddingTop: 8,
20
19
  },
21
20
  textMaxValue: {
22
- textAlign: 'right',
21
+ marginTop: 20,
22
+ marginLeft: 14,
23
+ textAlign: 'left',
24
+ fontWeight: 'bold',
25
+ textTransform: 'uppercase',
23
26
  },
24
27
  wrapProgressBar: {
25
28
  flex: 1,
26
29
  flexDirection: 'row',
27
30
  justifyContent: 'center',
28
31
  alignItems: 'center',
29
- padding: 8,
30
32
  },
31
33
  textValue: {
32
34
  marginLeft: 8,
35
+ width: 45,
33
36
  },
34
37
  });