Skip to content

Commit

Permalink
fga-eps-mds#164 - Standardizing listing of meeting screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronyell committed Apr 26, 2018
1 parent caa1571 commit 2154a42
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 44 deletions.
1 change: 0 additions & 1 deletion src/actions/auxiliary/getCounselorFromGroupAuxiliary.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const getCounselorFromGroup = async (codGroup) => {

export const getCounselor = async (counselorLink, linkWithCodMembro) => {
try {
console.log(counselorLink);
const response = await axios.get(counselorLink);
const auxCodMembro = linkWithCodMembro.substr(linkWithCodMembro.indexOf('membros/'));
const codMembro = auxCodMembro.substr(8);
Expand Down
91 changes: 50 additions & 41 deletions src/screens/MeetingInvites.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
StyleSheet,
Text,
View,
TouchableOpacity,
ScrollView,
ActivityIndicator,
BackHandler,
Expand All @@ -17,6 +16,10 @@ import Header from '../components/Header';
import LocalizationMapButton from '../components/LocalizationMapButton';
import { backHandlerPop } from '../NavigationFunctions';
import stylesList from '../Styles/ListStyles';
import { getCounselorDataWithEmail } from '../services/extractDataCounselor';
import ScheduleCard from '../components/ScheduleCard';
import getMeetingData from '../services/extractDataMeeting';
import Button from '../components/Button';

const styles = StyleSheet.create({
principal: {
Expand Down Expand Up @@ -103,6 +106,25 @@ const styles = StyleSheet.create({

});

const buttonBoxStyle = StyleSheet.create({
design: {
borderColor: 'black',
borderWidth: 0.8,
borderRadius: 7,
backgroundColor: 'white',
padding: 8,
justifyContent: 'center',
marginRight: 15,
marginTop: 5,
marginBottom: 5,
},

text: {
fontSize: 12,
textAlign: 'center',
},
});

class MeetingInvites extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -159,26 +181,19 @@ class MeetingInvites extends React.Component {
}
return (
this.props.listOfScheduleMeetingInAGroup.map(meetingSchedule => (
<View style={styles.listScheduleMeeting}>
<View style={styles.textBox}>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Data: </Text>
{meetingSchedule.content.date}
</Text>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Horário: </Text>
{meetingSchedule.content.time}
</Text>
</View>
<View style={styles.buttonInformation}>
<TouchableOpacity
<ScheduleCard
data={getMeetingData(meetingSchedule.content)}
keyProp={meetingSchedule.nuvemCode}
>
<View style={{ flex: 3 }}>
<Button
style={buttonBoxStyle}
enabled
text="+ INFORMAÇÕES"
onPress={() => this.getInfo(meetingSchedule.content)}
key="+MeetingInfo"
>
<Text style={styles.buttonText}> + INFORMAÇÕES</Text>
</TouchableOpacity>
/>
</View>
</View>
</ScheduleCard>
))
);
}
Expand Down Expand Up @@ -216,20 +231,14 @@ class MeetingInvites extends React.Component {
return (
this.state.invitees.map(counselor => (
<View style={styles.listRegisters} key={counselor.nuvemCode}>
<View style={styles.textBox}>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Nome: </Text>
{counselor.name}
</Text>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>E-mail: </Text>
{counselor.email}
</Text>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Telefone: </Text>
{counselor.profile.phone}
</Text>
</View>
{
getCounselorDataWithEmail(counselor).map(item => (
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>{item.label}</Text>
{item.value}
</Text>
))
}
</View>
))
);
Expand Down Expand Up @@ -276,14 +285,14 @@ class MeetingInvites extends React.Component {
<ScrollView>
<View style={styles.listScheduleMeeting}>
<View style={styles.textBox}>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Data: </Text>
{this.state.meetingSchedule.date}
</Text>
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Horário: </Text>
{this.state.meetingSchedule.time}
</Text>
{
getMeetingData(this.state.meetingSchedule).map(item => (
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>{item.label} </Text>
{item.value}
</Text>
))
}
{this.verificationDescription()}
<Text style={styles.text}>
<Text style={{ fontWeight: 'bold' }}>Número de convidados: </Text>
Expand Down
20 changes: 18 additions & 2 deletions src/services/extractDataCounselor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getManagerCounselorData = (counselor) => {
export const getManagerCounselorData = (counselor) => {
const data = [
{
label: 'Nome:',
Expand All @@ -16,4 +16,20 @@ const getManagerCounselorData = (counselor) => {
return data;
};

export default getManagerCounselorData;
export const getCounselorDataWithEmail = (counselor) => {
const data = [
{
label: 'Nome:',
value: counselor.name,
},
{
label: 'E-mail:',
value: counselor.email,
},
{
label: 'Telefone:',
value: counselor.profile.phone,
},
];
return data;
};
15 changes: 15 additions & 0 deletions src/services/extractDataMeeting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const getMeetingData = (meeting) => {
const data = [
{
label: 'Data:',
value: meeting.date,
},
{
label: 'Horário:',
value: meeting.time,
},
];
return data;
};

export default getMeetingData;

0 comments on commit 2154a42

Please sign in to comment.