Skip to content

Commit

Permalink
feature-static-ids-to-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
cShingleton committed Sep 21, 2017
1 parent 1a61999 commit e437072
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion js/config/surveyhelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const transactionCombo = (talk, updates, textfeedback) => {
statsUpd(updates),
()=>{return speakerref.transaction(
statsUpd(updates),
respondentsUpdate(talk.talk_id, 'EVyPYeHeziX06GqVO9nMZ8ieONh1', textfeedback)
respondentsUpdate(talk.talk_id, auth.currentUser.uid, textfeedback)
)}
)
}
Expand Down
8 changes: 4 additions & 4 deletions js/scenes/Dashboard/Components/MyTalksComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {

import { talkStyles } from '../styles';

const TalkText = ({ talkTitle }) => (
const TalkText = ({ talkTitle, speakerName }) => (
<View style={talkStyles.talkInfoContainer}>
<View style={talkStyles.infoTextContainer}>
<Text style={talkStyles.talkTitle}>
{talkTitle}
</Text>
<Text style={talkStyles.speakerName}>
Craig David
{speakerName}
</Text>
</View>
</View>
Expand All @@ -29,11 +29,11 @@ const TalkScore = ({ tScore }) => (
</View>
);

export const MyTalk = ({ score, title, onPress }) => (
export const MyTalk = ({ score, title, onPress, userName }) => (
<TouchableOpacity onPress={onPress}>
<View style={talkStyles.talkBar}>
<TalkScore tScore={score} />
<TalkText talkTitle={title} />
<TalkText talkTitle={title} speakerName={userName} />
</View>
</TouchableOpacity>
);
Expand Down
11 changes: 7 additions & 4 deletions js/scenes/Dashboard/DashboardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Text } from 'react-native';
import Swiper from 'react-native-swiper';
import { auth } from '../../config/firebase';

import Dashboard from './Pages/Dashboard';
import MyTalks from './Pages/MyTalks';
Expand All @@ -15,8 +16,7 @@ import { styles } from './styles';
const DashboardContainer = ({ userData, talksData }) => {
const { uLoading, users } = userData;
const { tLoading, talks } = talksData;
const testUser = users["wJW3GRYqtWYi4QplGLVSKPxxDtD3"];

const currUser = users[auth.currentUser.uid];
if (uLoading || tLoading) return <Loader />;
return (
<Swiper
Expand All @@ -28,8 +28,11 @@ const DashboardContainer = ({ userData, talksData }) => {
prevButton={<Text style={styles.buttonText}></Text>}
paginationStyle={{ bottom: 11 }}
>
<Dashboard stats={testUser.speakerStats} />
<MyTalks talks={findTalks(testUser.myTalks, talks)} />
<Dashboard stats={currUser.speakerStats} />
<MyTalks
talks={findTalks(currUser.myTalks, talks)}
userName={currUser.fullName}
/>
</Swiper>
);
}
Expand Down
3 changes: 2 additions & 1 deletion js/scenes/Dashboard/Pages/MyTalks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { goToMyTalkStats } from '../../../navigation/navHelpers';
import { colors } from '../../../config/styles';
import { styles, talkStyles } from '../styles';

const MyTalks = ({ talks }) => (
const MyTalks = ({ talks, userName }) => (
<View style={styles.sceneContainer}>
<LinearGradient
style={StyleSheet.absoluteFill}
Expand All @@ -25,6 +25,7 @@ const MyTalks = ({ talks }) => (
<MyTalk
key={talk.talk_id}
title={talk.title}
userName={userName}
score={talk.score}
onPress={() => goToMyTalkStats({ talk })}
/>
Expand Down
2 changes: 1 addition & 1 deletion js/scenes/Event/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const SingleEvent = ({ eventData, eventDataSet, attendEvent, currentUser }) => {

SingleEvent.propTypes = {
eventData: PropTypes.shape({
attendees: PropTypes.arrayOf(PropTypes.shape({
speakers: PropTypes.arrayOf(PropTypes.shape({
bio: PropTypes.string,
email: PropTypes.string,
fullName: PropTypes.string,
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 @@ -59,7 +59,7 @@ EventContainer.propTypes = {
eventsData: PropTypes.shape({
loading: PropTypes.bool,
events: PropTypes.arrayOf(PropTypes.shape({
attendees: PropTypes.arrayOf(PropTypes.string),
//attendees: PropTypes.arrayOf(PropTypes.string),
date: PropTypes.number,
startTime: PropTypes.number,
endTime: PropTypes.number,
Expand Down Expand Up @@ -106,7 +106,7 @@ EventContainer.propTypes = {
}).isRequired,
eventData: PropTypes.shape({
item: PropTypes.shape({
attendees: PropTypes.arrayOf(PropTypes.shape({
speakers: PropTypes.arrayOf(PropTypes.shape({
bio: PropTypes.string,
email: PropTypes.string,
fullName: PropTypes.string,
Expand Down
5 changes: 3 additions & 2 deletions js/scenes/Surveys/SurveysContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Dimensions, Image } from 'react-native';
import logo from '../../assets/images/beta_talks_logo_white_header.png';
import { auth } from '../../config/firebase';

import logo from '../../assets/images/beta_talks_logo_white_header.png';
import '../../redux/modules/actions/questionsActions';
import Surveys from './Pages/Surveys';
import CommentScreen from './Pages/CommentScreen';
Expand Down Expand Up @@ -57,7 +58,7 @@ class SurveysContainer extends Component {
const talk = this.props.talkObj.speakerData;
const surveyAns = this.props.surveyAnswers;
const textfeedback = this.props.comments;
const user = 'dKJaZ8tuniPW1Ee2BduSQQ8wSsp2'
const user = auth.currentUser.uid;
// placeholder id for testing
ExecFeedBackAsync(talk, user, surveyAns, textfeedback);
goToSurveyComplete();
Expand Down

0 comments on commit e437072

Please sign in to comment.