Skip to content

Commit

Permalink
Special event final updates r1
Browse files Browse the repository at this point in the history
  • Loading branch information
c3bryant committed Jul 23, 2017
1 parent 1f3fc54 commit e8cd878
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion app/styles/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var css = StyleSheet.create({
navAndroidTitle: { color: COLOR_WHITE, fontSize: 24, marginTop: -8, fontWeight: '300' },
navCampusLogoTitle: { resizeMode: 'contain', height: 26, marginTop: platformIOS() ? 26 : 12, alignSelf: 'center' },
navIOSIconStyle: { tintColor:COLOR_WHITE, marginTop: -2 },
navButtonTextIOS: { color: COLOR_WHITE, marginTop: -2, fontWeight: '300', fontSize: 18 },
navButtonTextIOS: { color: COLOR_WHITE, marginTop: -3, fontWeight: '300', fontSize: 18 },
navAndroidIconStyle: { tintColor:COLOR_WHITE, marginTop: -6 },
navButtonTextAndroid: { color: COLOR_WHITE, marginTop: -6, fontWeight: '300', fontSize: 18 },
// 102 - Tab Bar
Expand Down
121 changes: 60 additions & 61 deletions app/views/specialEvents/SpecialEventsListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from 'react-native';
import { connect } from 'react-redux';
import moment from 'moment';
import Icon from 'react-native-vector-icons/FontAwesome';
import ElevatedView from 'react-native-elevated-view';

import {
Expand All @@ -34,7 +33,7 @@ const dataSource = new ListView.DataSource({
const SpecialEventsListView = ({ addSpecialEvents, specialEventsSchedule,
specialEventsScheduleIds, removeSpecialEvents, saved,disabled, personal, rows,
scrollEnabled, style, labels, labelItemIds, selectedDay, days, daysItemIds, inCard,
specialEventsTitle, clearFilters }) => {
specialEventsTitle, handleFilterPress }) => {

let scheduleIdArray = [];
// Use ids from selectedDay
Expand Down Expand Up @@ -82,7 +81,7 @@ const SpecialEventsListView = ({ addSpecialEvents, specialEventsSchedule,
if (personal && scheduleIdArray.length === 0) {
return (
<View style={[style, rows ? styles.card : styles.full]}>
<Text style={styles.noSavedSessions}>
<Text style={styles.noSessions}>
Click the star icon next to a session to save it to your schedule.
</Text>
</View>
Expand All @@ -95,62 +94,68 @@ const SpecialEventsListView = ({ addSpecialEvents, specialEventsSchedule,
<LabelsContainer
labels={labels}
hide={personal}
clearFilters={clearFilters}
handleFilterPress={handleFilterPress}
/>
<ListView
style={[style, rows ? styles.card : styles.full]}
scrollEnabled={scrollEnabled}
stickySectionHeadersEnabled={false}
dataSource={
dataSource.cloneWithRowsAndSections(
convertToTimeMap(
specialEventsSchedule,
adjustData(specialEventsSchedule, scheduleIdArray, saved, personal, rows)
{(!personal && scheduleIdArray.length === 0) ? (
<Text style={styles.noSessions}>
There are no events for your selected filters.
</Text>
) : (
<ListView
style={[style, rows ? styles.card : styles.full]}
scrollEnabled={scrollEnabled}
stickySectionHeadersEnabled={false}
dataSource={
dataSource.cloneWithRowsAndSections(
convertToTimeMap(
specialEventsSchedule,
adjustData(specialEventsSchedule, scheduleIdArray, saved, personal, rows)
)
)
)
}
renderRow={(rowData, sectionID, rowID, highlightRow) => {
// Don't render first row bc rendered by header
if (Number(rowID) !== 0) {
return (
<View style={styles.rowContainer}>
<EmptyItem />
<SpecialEventsItem
specialEventsData={rowData}
saved={saved.includes(rowData.id)}
add={(disabled) ? null : addSpecialEvents}
remove={removeSpecialEvents}
title={specialEventsTitle}
/>
</View>
);
} else {
return null;
}
}}
renderSectionHeader={(sectionData, sectionID) => (
// Render header along with first row
<View style={styles.rowContainer}>
<SpecialEventsHeader
timestamp={sectionID}
rows={rows}
/>
<SpecialEventsItem
specialEventsData={sectionData[0]}
saved={saved.includes(sectionData[0].id)}
add={(disabled) ? null : addSpecialEvents}
remove={removeSpecialEvents}
title={specialEventsTitle}
/>
</View>
)}
/>
renderRow={(rowData, sectionID, rowID, highlightRow) => {
// Don't render first row bc rendered by header
if (Number(rowID) !== 0) {
return (
<View style={styles.rowContainer}>
<EmptyItem />
<SpecialEventsItem
specialEventsData={rowData}
saved={saved.includes(rowData.id)}
add={(disabled) ? null : addSpecialEvents}
remove={removeSpecialEvents}
title={specialEventsTitle}
/>
</View>
);
} else {
return null;
}
}}
renderSectionHeader={(sectionData, sectionID) => (
// Render header along with first row
<View style={styles.rowContainer}>
<SpecialEventsHeader
timestamp={sectionID}
rows={rows}
/>
<SpecialEventsItem
specialEventsData={sectionData[0]}
saved={saved.includes(sectionData[0].id)}
add={(disabled) ? null : addSpecialEvents}
remove={removeSpecialEvents}
title={specialEventsTitle}
/>
</View>
)}
/>
)}
</View>
);
}
};

const LabelsContainer = ({ labels, hide, clearFilters }) => {
const LabelsContainer = ({ labels, hide, handleFilterPress }) => {
if (hide || !Array.isArray(labels) || labels.length === 0) {
return null;
} else {
Expand All @@ -159,7 +164,7 @@ const LabelsContainer = ({ labels, hide, clearFilters }) => {
elevation={2}
>
<Touchable
onPress={() => clearFilters()}
onPress={() => handleFilterPress()}
style={styles.labelsContainer}
>
<Text
Expand All @@ -171,11 +176,6 @@ const LabelsContainer = ({ labels, hide, clearFilters }) => {
labels.map((label, index) => label + ((index !== labels.length - 1) ? (', ') : ('')))
}
</Text>
<Icon
name="close"
size={15}
style={styles.closeIcon}
/>
</Touchable>
</ElevatedView>
);
Expand Down Expand Up @@ -301,10 +301,9 @@ const styles = StyleSheet.create({
rowContainer: { flexDirection: 'row', height: 76 },
full: { flexGrow: 1, width: WINDOW_WIDTH, height: (WINDOW_HEIGHT - NAVIGATOR_HEIGHT - TAB_BAR_HEIGHT) },
card: { width: MAX_CARD_WIDTH },
noSavedSessions: { flexGrow: 1, fontSize: 16, textAlign: 'center', padding: 20, lineHeight: 22 },
labelsContainer: { width: WINDOW_WIDTH, flexDirection: 'row', backgroundColor: COLOR_PRIMARY, alignItems: 'center' },
labelText: { width: WINDOW_WIDTH - 20, padding: 4, fontSize: 16, color: 'white', },
closeIcon: { color: 'white', margin: 4 },
noSessions: { flexGrow: 1, fontSize: 16, textAlign: 'center', padding: 20, lineHeight: 22 },
labelsContainer: { alignItems: 'center', justifyContent: 'flex-start', borderBottomWidth: 2, borderBottomColor: COLOR_PRIMARY },
labelText: { width: WINDOW_WIDTH, paddingVertical: 4, paddingHorizontal: 20, fontSize: 14, color: COLOR_PRIMARY, },
});

export default ActualSpecialEventsListView;
13 changes: 7 additions & 6 deletions app/views/specialEvents/SpecialEventsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import logger from '../../util/logger';
import SpecialEventsListView from './SpecialEventsListView';
import {
COLOR_PRIMARY,
COLOR_SECONDARY,
COLOR_LGREY,
COLOR_MGREY,
COLOR_DGREY,
Expand Down Expand Up @@ -173,7 +174,7 @@ class SpecialEventsView extends Component {
scrollEnabled={true}
personal={this.state.personal}
selectedDay={this.props.days[this.state.selectedDay]}
clearFilters={() => this.handleFilterSelect([])}
handleFilterPress={this.handleFilterPress}
/>
<FakeTabBar
personal={this.state.personal}
Expand Down Expand Up @@ -248,7 +249,7 @@ const DaysBar = ({ days, selectedDay, handleDayPress }) => {
days.map((day, index) =>
<Touchable
key={day}
style={index === 0 ? styles.plainButtonFirst : styles.plainButton }
style={index !== selectedDay ? styles.plainButton : styles.selectedButton }
onPress={() => handleDayPress(index)}
>
<Text
Expand All @@ -271,14 +272,14 @@ const styles = StyleSheet.create({
scrollContentContainer: { flexGrow: 1 },
buttonContainer: { flex: 1, flexDirection: 'row', alignItems: 'center' },
selectedButton: { flexGrow: 1, minWidth: WINDOW_WIDTH / 4, height: TAB_BAR_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: COLOR_PRIMARY },
plainButtonFirst: { flexGrow: 1, minWidth: WINDOW_WIDTH / 4, height: TAB_BAR_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: COLOR_WHITE },
plainButton: { flexGrow: 1, minWidth: WINDOW_WIDTH / 4, height: TAB_BAR_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: COLOR_WHITE, borderLeftWidth: 1, borderLeftColor: COLOR_MGREY },
plainButton: { flexGrow: 1, minWidth: WINDOW_WIDTH / 4, height: TAB_BAR_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: COLOR_WHITE, borderRightWidth: 1, borderRightColor: COLOR_MGREY },
selectedButton: { flexGrow: 1, minWidth: WINDOW_WIDTH / 4, height: TAB_BAR_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: COLOR_SECONDARY, borderRightWidth: 1, borderRightColor: COLOR_MGREY },
selectedText: { textAlign: 'center', fontSize: 18, color: 'white' },
plainText: { textAlign: 'center', fontSize: 18, opacity: 0.5 },
tabBar: { borderTopWidth: 1, borderColor: COLOR_DGREY, backgroundColor: COLOR_WHITE, height: TAB_BAR_HEIGHT },
daysBar: { borderBottomWidth: 1, borderColor: COLOR_MGREY, backgroundColor: COLOR_WHITE, height: TAB_BAR_HEIGHT },
selectedDayText: { textAlign: 'center', fontSize: 18, color: COLOR_PRIMARY },
selectedDayText: { textAlign: 'center', fontSize: 18, color: COLOR_WHITE, backgroundColor: COLOR_SECONDARY },
filterText: { textAlign: 'center', fontSize: 17, color: 'white' },
backButtonContainer: { flexDirection: 'row', justifyContent: 'center', alignItems: 'center', marginTop: -6 },
backButtonContainer: { flexDirection: 'row', justifyContent: 'center', alignItems: 'center', marginTop: -7 },
backButtonImage: { color: COLOR_WHITE, marginRight: 7 },
});

0 comments on commit e8cd878

Please sign in to comment.