Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature changeattendeestospeakers #125

Merged
merged 3 commits into from
Sep 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/scenes/Event/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ SingleEvent.propTypes = {
eventCode: PropTypes.string,
id: PropTypes.string,
location: PropTypes.objectOf(PropTypes.string),
speakers: PropTypes.arrayOf(PropTypes.string),
//speakers: PropTypes.arrayOf(PropTypes.string),
talks: PropTypes.arrayOf(PropTypes.string)
}).isRequired,
eventDataSet: PropTypes.arrayOf(PropTypes.shape({
Expand Down
4 changes: 2 additions & 2 deletions js/scenes/Event/EventContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ EventContainer.propTypes = {
eventCode: PropTypes.string,
id: PropTypes.string,
location: PropTypes.objectOf(PropTypes.string),
speakers: PropTypes.arrayOf(PropTypes.string),
//speakers: PropTypes.arrayOf(PropTypes.string),
talks: PropTypes.arrayOf(PropTypes.string)
})).isRequired,
}).isRequired,
Expand Down Expand Up @@ -115,7 +115,7 @@ EventContainer.propTypes = {
eventCode: PropTypes.string,
id: PropTypes.string,
location: PropTypes.objectOf(PropTypes.string),
speakers: PropTypes.arrayOf(PropTypes.string),
//speakers: PropTypes.arrayOf(PropTypes.string),
talks: PropTypes.arrayOf(PropTypes.string)
}).isRequired
}).isRequired
Expand Down
8 changes: 4 additions & 4 deletions js/scenes/Events/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ const Events = ({
<Text style={styles.eventTime}>{eventTime(item.startTime)} - {eventTime(item.endTime)}</Text>
</View>
<View style={styles.attendeeContainer}>
{item.attendees.map(attendee => (
{item.speakers.map(speaker => (
<Image
key={attendee.user_id}
key={speaker.user_id}
style={styles.attendeeImage}
source={{ uri: attendee.imageUrl }}
source={{ uri: speaker.imageUrl }}
/>
))}
</View>
Expand Down Expand Up @@ -108,7 +108,7 @@ Events.PropTypes = {
id: PropTypes.string,
eventCode: PropTypes.string,
attendees: PropTypes.objectOf(PropTypes.string),
speakers: PropTypes.objectOf(PropTypes.string),
//speakers: PropTypes.objectOf(PropTypes.string),
talks: PropTypes.objectOf(PropTypes.string),
location: PropTypes.objectOf(PropTypes.shape({
city: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions js/scenes/Events/EventsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../redux/modules/actions/eventActions';
import { colors, typography } from '../../config/styles';
import { auth } from '../../config/firebase';
import { getTime } from '../../config/helpers';
import { idToObjs } from '../Lib/helperFunctions';
import { idToObjsSpeakers } from '../Lib/helperFunctions';

class EventsContainer extends Component {
static route = {
Expand Down Expand Up @@ -57,7 +57,7 @@ class EventsContainer extends Component {

withAttendeeData = (events, users) => {
return events.map(event => {
return idToObjs(event, users);
return idToObjsSpeakers(event, users);
});
}

Expand Down
7 changes: 7 additions & 0 deletions js/scenes/Lib/helperFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export const idToObjs = (event, users) => {
}, { ...event, attendees: [] });
}

export const idToObjsSpeakers = (event, users) => {
return event.speakers.reduce((acc, cur) => {
acc.speakers.push(users[cur])
return acc;
}, { ...event, speakers: [] });
}

export const getNextEvent = (events, users) => {
return idToObjs(calcNextEventDate(events), users);
}
Expand Down
2 changes: 1 addition & 1 deletion js/scenes/TalkStats/TalkStatsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TalkStatsContainer.propTypes = {
eventCode: PropTypes.string,
event_id: PropTypes.string,
score: PropTypes.number,
speaker_id: PropTypes.string,
//speaker_id: PropTypes.string,
talkStats: PropTypes.arrayOf(PropTypes.shape({
quality: PropTypes.string,
value: PropTypes.number,
Expand Down