• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

akvo / nmis-mobile / 5775566633

06 Aug 2023 08:24AM UTC coverage: 77.568% (-2.5%) from 80.041%
5775566633

Pull #116

github

ifirmawan
[#115] Create snapshot: FormDataDetails
Pull Request #116: Feature/115 cannot open submitted data point

628 of 874 branches covered (71.85%)

Branch coverage included in aggregate %.

67 of 67 new or added lines in 5 files covered. (100.0%)

1343 of 1667 relevant lines covered (80.56%)

16.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/app/src/pages/FormData/FormDataNavigation.js
1
import React from 'react';
2
import { View, Text, StyleSheet } from 'react-native';
3
import { Button } from '@rneui/themed';
4
import Icon from 'react-native-vector-icons/Ionicons';
5
import { UIState } from '../../store';
6
import { i18n } from '../../lib';
7

8
const colorPrimary = '#1f2937';
3✔
9

10
const FormDataNavigation = ({ totalPage, currentPage, setCurrentPage }) => {
3✔
11
  const activeLang = UIState.useState((s) => s.lang);
×
12
  const trans = i18n.text(activeLang);
×
13

14
  const goBack = () => {
×
15
    setCurrentPage(currentPage - 1);
×
16
  };
17
  const goNext = () => {
×
18
    setCurrentPage(currentPage + 1);
×
19
  };
20

21
  const disabledBack = currentPage === 0;
×
22
  const disabledNext = currentPage === totalPage - 1;
×
23
  const colorIconBack = disabledBack ? '#9ca3af' : colorPrimary;
×
24
  const colorIconNext = disabledNext ? '#9ca3af' : colorPrimary;
×
25
  return (
×
26
    <View style={styles.container}>
27
      <Button
28
        type="clear"
29
        testID="button-back"
30
        disabled={disabledBack}
31
        onPress={goBack}
32
        icon={<Icon name="chevron-back" style={{ ...styles.icon, color: colorIconBack }} />}
33
        buttonStyle={styles.button}
34
        titleStyle={styles.buttonTitle}
35
      >
36
        {trans.buttonBack}
37
      </Button>
38
      <Text testID="text-pagination" style={styles.paginationText}>
39
        {currentPage + 1}/{totalPage}
40
      </Text>
41
      <Button
42
        type="clear"
43
        testID="button-next"
44
        disabled={disabledNext}
45
        onPress={goNext}
46
        icon={<Icon name="chevron-forward" style={{ ...styles.icon, color: colorIconNext }} />}
47
        buttonStyle={styles.button}
48
        titleStyle={styles.buttonTitle}
49
        iconRight
50
      >
51
        {trans.buttonNext}
52
      </Button>
53
    </View>
54
  );
55
};
56

57
const styles = StyleSheet.create({
3✔
58
  container: {
59
    display: 'flex',
60
    flexDirection: 'row',
61
    alignItems: 'center',
62
    justifyContent: 'space-around',
63
    borderTopColor: 'grey',
64
    borderTopWidth: 0.5,
65
    borderBottomWidth: 0,
66
    paddingVertical: 8,
67
  },
68
  icon: {
69
    fontSize: 18,
70
    paddingHorizontal: 4,
71
  },
72
  button: {
73
    fontSize: 14,
74
    paddingHorizontal: 8,
75
  },
76
  buttonTitle: {
77
    color: colorPrimary,
78
  },
79
  paginationText: {
80
    width: '60%',
81
    textAlign: 'center',
82
    fontSize: 14,
83
    color: colorPrimary,
84
  },
85
});
86

87
export default FormDataNavigation;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc