Skip to content

Commit

Permalink
#1496 | Tidy section separator and add section count info
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Sep 13, 2024
1 parent 068e034 commit 821387e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SearchResultsHeader extends AbstractComponent {
flexDirection: 'row',
justifyContent: 'space-between',
borderWidth: 1,
marginBottom: 3,
borderStyle: 'solid',
borderColor: Colors.InputBorderNormal,
paddingVertical: DGS.resizeHeight(15),
Expand All @@ -37,7 +38,7 @@ class SearchResultsHeader extends AbstractComponent {
<View style={SearchResultsHeader.styles.container}>
<Text>
<Text style={{fontSize: 12, color: Styles.lightgrey}}>{totalCount}</Text>
<Text style={{fontSize: 12, color: Styles.lightgrey}}>{` ${this.I18n.t("totalMatchingResults")}`}</Text>
<Text style={{fontSize: 12, color: Styles.lightgrey}}>{` ${this.I18n.t("matchingResults")}`}</Text>
</Text>
{displayResultCounts &&
<Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Path from "../../framework/routing/Path";
import AbstractComponent from "../../framework/view/AbstractComponent";
import {SectionList, StyleSheet, Text} from "react-native";
import Fonts from "../primitives/Fonts";
import _ from "lodash";
import IndividualDetails from "./IndividualDetails";
import React from "react";
import React, {Fragment} from "react";
import General from "../../utility/General";
import AppHeader from "../common/AppHeader";
import SearchResultsHeader from "../individual/SearchResultsHeader";
Expand All @@ -13,6 +12,8 @@ import PropTypes from "prop-types";
import CHSContainer from "../common/CHSContainer";
import Colors from "../primitives/Colors";
import Distances from "../primitives/Distances";
import Styles from '../primitives/Styles';
import {View} from 'native-base';

@Path('/IndividualListView')
class IndividualListView extends AbstractComponent {
Expand Down Expand Up @@ -44,11 +45,15 @@ class IndividualListView extends AbstractComponent {
}
}

renderHeader = ({section: {title}}) => (
_.isEmpty(title) ? null : <Text style={[Fonts.typography("paperFontTitle"), styles.TextHeaderStyle]}>
{title}
</Text>
);
renderHeader = ({section: {title, data}}) => (_.isEmpty(title) ? null :
<View style={{display: 'flex', flexDirection: 'row'}}>
<Text style={{
fontSize: 12, color: Styles.blackColor
}}>{` ${title}`}</Text>
<Text style={{
fontSize: 12, color: Styles.lightgrey
}}>{` ${this.I18n.t("matchingResults")}: ${data.length}`}</Text>
</View>);

renderItems = (item, section, listType, cardType) => {
const individualWithMetadata = listType === 'total' ? {individual: item, visitInfo: {visitName: []}} : item;
Expand Down Expand Up @@ -97,7 +102,7 @@ class IndividualListView extends AbstractComponent {
renderItem={({item, section}) => this.renderItems(item, section, this.props.listType, this.props.headerTitle)}
renderSectionHeader={this.renderHeader}
SectionSeparatorComponent={({trailingItem}) => allUniqueGroups.length > 1 && !trailingItem ? (
<Separator style={{alignSelf: 'stretch'}} height={5} backgroundColor={Colors.GreyContentBackground}/>) : null}
<Separator style={{alignSelf: 'stretch', margin: 6}} height={2} backgroundColor={Colors.GreyBackground}/>) : null}
initialNumToRender={15}
updateCellsBatchingPeriod={500}
maxToRenderPerBatch={30}
Expand Down
3 changes: 2 additions & 1 deletion packages/openchs-android/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@
"totalQueuedCount": "Total Queued",
"videoListNotAvailable": "No video list available",
"lastLoaded": "Last Loaded",
"totalMatchingResults": "matching results",
"totalMatchingResults": "Total matching results",
"matchingResults": "matching results",
"displayed": "Displayed",
"uploadMedia": "Uploading saved media files",
"uploadLocallySavedData": "Uploading saved data",
Expand Down
1 change: 1 addition & 0 deletions packages/openchs-android/translations/gu_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"Okay": "બરાબર",
"videoListNotAvailable": "વિડિઓ સૂચિ ઉપલબ્ધ નથી",
"totalMatchingResults": "કુલ મેળ ખાતા પરિણામો",
"matchingResults": "મેળ ખાતા પરિણામો",
"displayed": "પ્રદર્શિત",
"uploadMedia": "સેવ કરેલી મીડિયા ફાઇલ્સ અપલોડ થઇ રહી છે",
"uploadLocallySavedData": "સેવ કરેલો ડેટા અપલોડ થઇ રહ્યો છે",
Expand Down
1 change: 1 addition & 0 deletions packages/openchs-android/translations/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"Okay": "ठीक है",
"videoListNotAvailable": "वीडियो सूची उपलब्ध नहीं है",
"totalMatchingResults": "कुल मेल खाते परिणाम",
"matchingResults": "मेल खाते परिणाम",
"displayed": "प्रदर्शित",
"uploadMedia": "सेव की गयी मीडिया फाइल्स अपलोड हो रही है",
"uploadLocallySavedData": "सेव किया गया डाटा अपलोड हो रहा है",
Expand Down
1 change: 1 addition & 0 deletions packages/openchs-android/translations/ka_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"videoListNotAvailable": "ಯಾವುದೇ ವೀಡಿಯೊ ಪಟ್ಟಿ ಲಭ್ಯವಿಲ್ಲ",
"lastLoaded": "ಕೊನೆಯ ಲೋಡೆಡ್",
"totalMatchingResults": "ಒಟ್ಟು ಹೊಂದಾಣಿಕೆಯ ಫಲಿತಾಂಶಗಳು",
"matchingResults": "ಹೊಂದಾಣಿಕೆಯ ಫಲಿತಾಂಶಗಳು",
"displayed": "ಪ್ರದರ್ಶಿಸಲಾಗಿದೆ",
"uploadMedia": "ಉಳಿಸಿದ ಮೀಡಿಯಾ ಫೈಲ್‌ಗಳನ್ನು ಅಪ್‌ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ",
"uploadLocallySavedData": "ಉಳಿಸಿದ ಡೇಟಾವನ್ನು ಅಪ್‌ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ",
Expand Down
1 change: 1 addition & 0 deletions packages/openchs-android/translations/mr_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
"Okay": "ठीक आहे",
"videoListNotAvailable": "व्हिडिओ यादी उपलब्ध नाही",
"totalMatchingResults": "एकूण जुळणारे परिणाम",
"matchingResults": "जुळणारे परिणाम",
"displayed": "प्रदर्शित",
"uploadMedia": "सेव्ह केलेल्या मीडिया फायली अपलोड करीत आहे",
"uploadLocallySavedData": "सेव्ह केलेला डेटा अपलोड करीत आहे",
Expand Down
2 changes: 2 additions & 0 deletions packages/openchs-android/translations/ta_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
"videoListNotAvailable": "வீடியோ பட்டியல் எதுவும் கிடைக்கவில்லை",
"lastLoaded": "கடைசியாக ஏற்றப்பட்டது",
"totalMatchingResults": "பொருத்தமான மொத்தம் முடிவுகள்",

"matchingResults": "பொருத்தமான முடிவுகள்",
"displayed": "காண்பிக்க",
"uploadMedia": "சேமித்த மீடியா கோப்புகளைப் பதிவேற்றுதல்",
"uploadLocallySavedData": "சேமிக்கப்பட்ட தரவைப் பதிவேற்றுதல்",
Expand Down

0 comments on commit 821387e

Please sign in to comment.