Skip to content

Commit

Permalink
Merge pull request #118 from usdevs/cheryl/add-ctph-calendar-alert
Browse files Browse the repository at this point in the history
Add CTPH calendar change alert
  • Loading branch information
Yoshi275 committed Jan 6, 2020
2 parents 469b801 + ed30b08 commit 45d1469
Show file tree
Hide file tree
Showing 38 changed files with 82 additions and 153 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"redux-firestore": "^0.8.0",
"styled-components": "^3.3.3",
"typography": "^0.16.17",
"yarn": "^1.21.1",
"yup": "^0.27.0"
},
"scripts": {
Expand Down
7 changes: 1 addition & 6 deletions src/components/Events/Calendar/EventCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,5 @@ const mapStateToProps = state => {

export default compose(
firebaseConnect(),
connect(
mapStateToProps,
null,
null,
areStatesEqual
)
connect(mapStateToProps, null, null, areStatesEqual)
)(EventCalendar)
5 changes: 1 addition & 4 deletions src/components/Events/CreateEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(CreateEvent)
compose(firebaseConnect(), connect(mapStateToProps))(CreateEvent)
)
22 changes: 22 additions & 0 deletions src/components/Events/CtphAlert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { useState } from 'react'
import { Alert } from 'reactstrap'

const CtphAlert = props => {
const [visible, setVisible] = useState(true)

const onDismiss = () => setVisible(false)

return (
<Alert color="primary" isOpen={visible} toggle={onDismiss}>
<div className="text-center">
Looking for CTPH bookings? They have been temporarily moved.{' '}
<a href="https://bit.ly/ctphbookings" className="alert-link">
Click here for the latest CTPH bookings!
</a>
!
</div>
</Alert>
)
}

export default CtphAlert
5 changes: 1 addition & 4 deletions src/components/Events/EditEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(EditEvent)
compose(firebaseConnect(), connect(mapStateToProps))(EditEvent)
)
5 changes: 1 addition & 4 deletions src/components/Events/EventForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,4 @@ const mapStateToProps = state => {
}
}

export default compose(
firebaseConnect(),
connect(mapStateToProps)
)(EventForm)
export default compose(firebaseConnect(), connect(mapStateToProps))(EventForm)
6 changes: 6 additions & 0 deletions src/components/Events/Events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
import { Container, Row, Col, Button } from 'reactstrap'
import { headerEvent as header } from '../../resources/images.js'
import CtphAlert from './CtphAlert'
import EventCalendar from './Calendar/EventCalendar'
import FontAwesomeIcon from '@fortawesome/react-fontawesome'
import CreateEventButton from '../reusable/CreateEventButton.js'
Expand All @@ -23,6 +24,11 @@ class Events extends Component {
<img src={header} className="img-fluid" alt="header" />
</Col>
</Row>
<Row>
<Col sm="12">
<CtphAlert />
</Col>
</Row>
<Row>
<Col>
<div className="d-flex">
Expand Down
5 changes: 1 addition & 4 deletions src/components/Events/ManageEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(ManageEvents)
compose(firebaseConnect(), connect(mapStateToProps))(ManageEvents)
)
6 changes: 6 additions & 0 deletions src/components/Events/Spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Container, Row, Col } from 'reactstrap'
import { headerSpaces as header } from '../../resources/images.js'
import EventCalendar from './Calendar/EventCalendar'
import CreateEventButton from '../reusable/CreateEventButton.js'
import CtphAlert from './CtphAlert'

class Spaces extends Component {
render() {
Expand All @@ -13,6 +14,11 @@ class Spaces extends Component {
<img src={header} className="img-fluid" alt="header" />
</Col>
</Row>
<Row>
<Col sm="12">
<CtphAlert />
</Col>
</Row>
<Row>
<Col>
<div className="d-flex">
Expand Down
5 changes: 1 addition & 4 deletions src/components/General/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Dashboard)
compose(firebaseConnect(), connect(mapStateToProps))(Dashboard)
)
5 changes: 1 addition & 4 deletions src/components/General/Feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Feedback)
compose(firebaseConnect(), connect(mapStateToProps))(Feedback)
)
5 changes: 1 addition & 4 deletions src/components/General/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Home)
compose(firebaseConnect(), connect(mapStateToProps))(Home)
)
5 changes: 1 addition & 4 deletions src/components/Groups/CircleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,4 @@ const mapStateToProps = state => {
}
}

export default compose(
firebaseConnect(),
connect(mapStateToProps)
)(CircleForm)
export default compose(firebaseConnect(), connect(mapStateToProps))(CircleForm)
5 changes: 1 addition & 4 deletions src/components/Groups/EditGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(EditGroup)
compose(firebaseConnect(), connect(mapStateToProps))(EditGroup)
)
5 changes: 1 addition & 4 deletions src/components/Groups/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Group)
compose(firebaseConnect(), connect(mapStateToProps))(Group)
)
5 changes: 1 addition & 4 deletions src/components/Groups/GroupAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(GroupAdmin)
compose(firebaseConnect(), connect(mapStateToProps))(GroupAdmin)
)
5 changes: 1 addition & 4 deletions src/components/Groups/GroupGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ const mapStateToProps = state => {
}
}

export default compose(
firebaseConnect(),
connect(mapStateToProps)
)(GroupGrid)
export default compose(firebaseConnect(), connect(mapStateToProps))(GroupGrid)
5 changes: 1 addition & 4 deletions src/components/Groups/Groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Groups)
compose(firebaseConnect(), connect(mapStateToProps))(Groups)
)
5 changes: 1 addition & 4 deletions src/components/Groups/ManageGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(ManageGroups)
compose(firebaseConnect(), connect(mapStateToProps))(ManageGroups)
)
5 changes: 1 addition & 4 deletions src/components/InterestGroups/ManageInterestGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(ManageGroups)
compose(firebaseConnect(), connect(mapStateToProps))(ManageGroups)
)
5 changes: 1 addition & 4 deletions src/components/IntlProgs/CreateIntlProg.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(CreateIntlProg)
compose(firebaseConnect(), connect(mapStateToProps))(CreateIntlProg)
)
5 changes: 1 addition & 4 deletions src/components/IntlProgs/CreateIntlProgReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(CreateIntlProgReview)
compose(firebaseConnect(), connect(mapStateToProps))(CreateIntlProgReview)
)
5 changes: 1 addition & 4 deletions src/components/IntlProgs/IntlProg.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(IntlProg)
compose(firebaseConnect(), connect(mapStateToProps))(IntlProg)
)
5 changes: 1 addition & 4 deletions src/components/IntlProgs/IntlProgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(IntlProgs)
compose(firebaseConnect(), connect(mapStateToProps))(IntlProgs)
)
5 changes: 1 addition & 4 deletions src/components/Modules/AddReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(AddReview)
compose(firebaseConnect(), connect(mapStateToProps))(AddReview)
)
5 changes: 1 addition & 4 deletions src/components/Modules/EditReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(EditReview)
compose(firebaseConnect(), connect(mapStateToProps))(EditReview)
)
5 changes: 1 addition & 4 deletions src/components/Modules/ManageReviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(ManageReviews)
compose(firebaseConnect(), connect(mapStateToProps))(ManageReviews)
)
5 changes: 1 addition & 4 deletions src/components/Modules/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Module)
compose(firebaseConnect(), connect(mapStateToProps))(Module)
)
5 changes: 1 addition & 4 deletions src/components/Modules/ModuleAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,4 @@ const mapStateToProps = state => {
}
}

export default compose(
firebaseConnect(),
connect(mapStateToProps)
)(ModuleAdmin)
export default compose(firebaseConnect(), connect(mapStateToProps))(ModuleAdmin)
5 changes: 1 addition & 4 deletions src/components/Modules/Modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Modules)
compose(firebaseConnect(), connect(mapStateToProps))(Modules)
)
5 changes: 1 addition & 4 deletions src/components/Users/ProfileForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,4 @@ const mapStateToProps = state => {
}
}

export default compose(
firebaseConnect(),
connect(mapStateToProps)
)(ProfileForm)
export default compose(firebaseConnect(), connect(mapStateToProps))(ProfileForm)
5 changes: 1 addition & 4 deletions src/components/Users/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(Settings)
compose(firebaseConnect(), connect(mapStateToProps))(Settings)
)
5 changes: 1 addition & 4 deletions src/components/reusable/CreateEventButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(CreateEventButton)
compose(firebaseConnect(), connect(mapStateToProps))(CreateEventButton)
)
5 changes: 1 addition & 4 deletions src/components/reusable/GroupAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(GroupAutocomplete)
compose(firebaseConnect(), connect(mapStateToProps))(GroupAutocomplete)
)
5 changes: 1 addition & 4 deletions src/components/reusable/IntlProgAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(GroupAutocomplete)
compose(firebaseConnect(), connect(mapStateToProps))(GroupAutocomplete)
)
5 changes: 1 addition & 4 deletions src/components/reusable/UserForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,5 @@ const mapStateToProps = state => {
}

export default withRouter(
compose(
firebaseConnect(),
connect(mapStateToProps)
)(UserForm)
compose(firebaseConnect(), connect(mapStateToProps))(UserForm)
)
5 changes: 4 additions & 1 deletion src/firestore/EventsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export function getEventVenueBookingsAfter(
firestore
.get({
collection: 'events',
where: [['endDate', '>=', date.toDate()], ['venue', '==', venueID]],
where: [
['endDate', '>=', date.toDate()],
['venue', '==', venueID]
],
orderBy: ['endDate'],
storeAs: alias
})
Expand Down
Loading

0 comments on commit 45d1469

Please sign in to comment.