Skip to content

Commit

Permalink
Sprint 27 (#462)
Browse files Browse the repository at this point in the history
* Adding missing icons to fields

Adding missing icons to fields on contact details, edit and new screens.

* FAB action colors

giving the fab actions a different color to help quickly identify each action.

* Add initial comment icon

* reformatting Icon code for consitency

* fix icon from user to users for group edit screen

on the group edit screen it used incorrectly a singular icon for group name instead of the group icon.

And minor code cleanup.

* Add new group icons

Group name and Group type

* import status icon; remformatted code identations

* Adding status icons to contacts and group screens

* resolves #259 and adds colors to icons

* styling for addIcons & removeIcons

* added icon for milestone

Added around lines 3014 and 3100 the icon "Octicons" incon named "milestone".

* added fieldsIcons style

fieldsIcons: {
    height: 20,
    width: 20,
  },

* minor sizing adjustments to the icons

* Resolve #407

* Resolves #424

* refinements to remove code conflicts

* fix for church_start_date bad alignment

* Resolve #405

* Resolves #375

* Resolves #416

* Resolves #416

* Resolves #375

* Resolves #366

* Remove console log

* Merge fix

Co-authored-by: Mike Allbutt <yo@ur.id.au>
Co-authored-by: Zachary McCoy <191707+zdmc23@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 24, 2020
1 parent af07f0a commit b12786b
Show file tree
Hide file tree
Showing 22 changed files with 241 additions and 65 deletions.
2 changes: 2 additions & 0 deletions languages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "أسم المجموعة",
"error": "مطلوب اسم"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "جدول الاجتماع",
"quick_button_meeting_postponed": "تم تأجيل الاجتماع",
Expand Down
2 changes: 2 additions & 0 deletions languages/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "দলের নাম",
"error": "নাম প্রয়োজন"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "সভা নির্ধারিত",
"quick_button_meeting_postponed": "সভা স্থগিত",
Expand Down
2 changes: 2 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Group Name",
"error": "Name is required"
},
"memberCount": "Member Count",
"memberList": "Member List",
"fab": {
"quick_button_meeting_scheduled": "Meeting Scheduled",
"quick_button_meeting_postponed": "Meeting Postponed",
Expand Down
2 changes: 2 additions & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Nombre del Grupo",
"error": "El nombre es requerido"
},
"memberCount": "Numero de miembros",
"memberList": "Lista de Miembros",
"fab": {
"quick_button_meeting_scheduled": "Reunión Programada",
"quick_button_meeting_postponed": "Reunión Pospuso",
Expand Down
2 changes: 2 additions & 0 deletions languages/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "اسم گروه",
"error": "نام لازم است"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "جلسه برنامه ریزی شده",
"quick_button_meeting_postponed": "جلسه به تعویق افتاد",
Expand Down
2 changes: 2 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Nom de groupe",
"error": "Nom obligatoire"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Réunion programmée",
"quick_button_meeting_postponed": "Réunion reportée",
Expand Down
2 changes: 2 additions & 0 deletions languages/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Grupno ime",
"error": "Ime je obavezno"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Sastanak zakazan",
"quick_button_meeting_postponed": "Sastanak odgođen",
Expand Down
2 changes: 2 additions & 0 deletions languages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Nama grup",
"error": "Nama harus diisi"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Rapat Terjadwal",
"quick_button_meeting_postponed": "Rapat Ditunda",
Expand Down
2 changes: 2 additions & 0 deletions languages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Groepsnaam",
"error": "Naam is vereist"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Vergadering gepland",
"quick_button_meeting_postponed": "Vergadering uitgesteld",
Expand Down
2 changes: 2 additions & 0 deletions languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Nome do Grupo",
"error": "Nome é necessário"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Reunião agendada",
"quick_button_meeting_postponed": "Reunião adiada",
Expand Down
2 changes: 2 additions & 0 deletions languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Имя группы",
"error": "Имя обязательно"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Встреча запланирована",
"quick_button_meeting_postponed": "Встреча отложена",
Expand Down
2 changes: 2 additions & 0 deletions languages/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Ime skupine",
"error": "Ime je obvezno"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Načrtovan sestanek",
"quick_button_meeting_postponed": "Seja prestavljena",
Expand Down
2 changes: 2 additions & 0 deletions languages/sr.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Назив групе",
"error": "Име је обавезно"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Састанак заказан",
"quick_button_meeting_postponed": "Састанак одложен",
Expand Down
2 changes: 2 additions & 0 deletions languages/sw.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Jina la Kikundi",
"error": "Jina inahitajika"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Mkutano Umepangwa",
"quick_button_meeting_postponed": "Mkutano Ulihairishwa",
Expand Down
2 changes: 2 additions & 0 deletions languages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "Grup ismi",
"error": "İsim gerekli"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "Toplantı Planlandı",
"quick_button_meeting_postponed": "Toplantı Ertelendi",
Expand Down
2 changes: 2 additions & 0 deletions languages/zhCn.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "组的名字",
"error": "名称为必填项"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "会议预定",
"quick_button_meeting_postponed": "会议推迟",
Expand Down
2 changes: 2 additions & 0 deletions languages/zhTw.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"label": "組的名字",
"error": "名稱為必填項"
},
"memberCount": "",
"memberList": "",
"fab": {
"quick_button_meeting_scheduled": "會議預定",
"quick_button_meeting_postponed": "會議推遲",
Expand Down
28 changes: 22 additions & 6 deletions screens/Contact/ContactDetailScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ let commentsFlatList,
baptizedBySelectizeRef,
coachedSelectizeRef,
baptizedSelectizeRef,
coachingSelectizeRef;
coachingSelectizeRef,
datePickerRef;
/* eslint-enable */
const defaultFaithMilestones = [
'milestone_has_bible',
Expand Down Expand Up @@ -1603,12 +1604,18 @@ class ContactDetailScreen extends React.Component {
}));
};

setBaptismDate = (date) => {
setBaptismDate = (date = null) => {
// (event, date) => {
if (!date) {
// Clean DatePicker value
datePickerRef.state.chosenDate = null;
datePickerRef.state.defaultDate = null;
this.forceUpdate();
}
this.setState((prevState) => ({
contact: {
...prevState.contact,
baptism_date: sharedTools.formatDateToBackEnd(date),
baptism_date: date ? sharedTools.formatDateToBackEnd(date) : '',
},
}));
};
Expand Down Expand Up @@ -3256,7 +3263,7 @@ class ContactDetailScreen extends React.Component {
</Col>
<Col>
<Text style={{ marginTop: 'auto', marginBottom: 'auto' }}>
{this.state.contact.baptism_date
{this.state.contact.baptism_date && this.state.contact.baptism_date.length > 0
? moment(new Date(this.state.contact.baptism_date * 1000))
.utc()
.format('LL')
Expand Down Expand Up @@ -3348,22 +3355,31 @@ class ContactDetailScreen extends React.Component {
</Label>
</Col>
</Row>
<Row>
<Row style={styles.formFieldMargin}>
<Col style={styles.formIconLabelCol}>
<View style={styles.formIconLabelView}>
<Icon type="Entypo" name="water" style={[styles.formIcon, { opacity: 0 }]} />
</View>
</Col>
<Col>
<DatePicker
ref={(ref) => (datePickerRef = ref)}
onDateChange={this.setBaptismDate}
defaultDate={
this.state.contact.baptism_date
this.state.contact.baptism_date && this.state.contact.baptism_date.length > 0
? new Date(this.state.contact.baptism_date * 1000)
: ''
}
/>
</Col>
<Col style={[styles.formIconLabel, { marginTop: 'auto', marginBottom: 'auto' }]}>
<Icon
type="AntDesign"
name="close"
style={[styles.formIcon, styles.addRemoveIcons, styles.removeIcons]}
onPress={() => this.setBaptismDate()}
/>
</Col>
</Row>
</View>
</KeyboardAwareScrollView>
Expand Down
18 changes: 16 additions & 2 deletions screens/Contact/ContactsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
import Toast from 'react-native-easy-toast';
import Accordion from 'react-native-collapsible/Accordion';
import { CheckBox } from 'react-native-elements';
import { Header } from 'react-navigation-stack';

import PropTypes from 'prop-types';
import Colors from '../../constants/Colors';
Expand Down Expand Up @@ -120,7 +121,8 @@ const styles = StyleSheet.create({
});
let toastError,
statusCircleSize = 15;
const windowHeight = Dimensions.get('window').height;
const windowHeight = Dimensions.get('window').height,
headerHeight = Header.HEIGHT;

class ContactsScreen extends React.Component {
state = {
Expand All @@ -139,6 +141,7 @@ class ContactsScreen extends React.Component {
currentFilter: '',
},
activeSections: [],
fixFABIndex: false,
};

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -519,6 +522,14 @@ class ContactsScreen extends React.Component {
renderHeader = () => {
return (
<View
onLayout={(event) => {
let viewHeight = event.nativeEvent.layout.height;
// headerHeight * 2 = headerHeight + bottomBarNavigation height
this.setState({
fixFABIndex:
windowHeight - (viewHeight + headerHeight * 2) < 100 && Platform.OS == 'android',
});
}}
style={[
styles.searchBarContainer,
Platform.OS == 'ios'
Expand Down Expand Up @@ -707,7 +718,10 @@ class ContactsScreen extends React.Component {
/>
}
<Fab
style={{ backgroundColor: Colors.tintColor }}
style={[
{ backgroundColor: Colors.tintColor },
this.state.fixFABIndex ? { zIndex: -1 } : {},
]}
position="bottomRight"
onPress={() => this.goToContactDetailScreen()}>
<Icon name="md-add" />
Expand Down
Loading

0 comments on commit b12786b

Please sign in to comment.