Skip to content

Commit

Permalink
bg(venue):implement dynamic venue for specific event
Browse files Browse the repository at this point in the history
- remove the static venue paragraph
- add revenue to prop and to the even card
  • Loading branch information
okellogabrielinnocent committed Aug 5, 2019
1 parent 6ca2201 commit 268ba19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
10 changes: 6 additions & 4 deletions client/components/cards/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import SlackIcon from '../../assets/icons/SlackIcon';
const EventCard = (props) => {
document.title = 'Events page';
const {
id, title, startDate, socialEvent, featuredImage,
id, title, startDate, venue, socialEvent, featuredImage,
} = props;

const date = new Date(startDate);
const shortMonths = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const shortMonth = shortMonths[date.getMonth()];
Expand All @@ -22,10 +22,10 @@ const EventCard = (props) => {
<img src={featuredImage || '/assets/img/img_group_selfie.jpg'} alt={title} className="event-card__picture" />
</div>
<div className="event-card__label">
<p>Lagos</p>
<p>{venue}</p>
</div>
<div className="event-card__action">
<p className="event-card__slack">{<SlackIcon width="100%" color="black" />}</p>
<p className="event-card__slack">{<SlackIcon width="100%" color="black" />}</p>
</div>
<div className="event-card__caption-group">
<div className="event-card__date">
Expand All @@ -46,6 +46,7 @@ const EventCard = (props) => {
EventCard.propTypes = {
id: PropTypes.string,
title: PropTypes.string,
venue: PropTypes.string,
startDate: PropTypes.string,
featuredImage: PropTypes.string,
socialEvent: PropTypes.objectOf(PropTypes.any),
Expand All @@ -54,6 +55,7 @@ EventCard.propTypes = {
EventCard.defaultProps = {
id: '',
title: '',
venue: '',
startDate: '',
socialEvent: {},
featuredImage: '',
Expand Down
18 changes: 0 additions & 18 deletions server/graphql_schemas/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,6 @@ def normalize_dates(end_date, start_date, today_date):
return {'status': False, 'message': 'Sorry, end date must be after start date'}
else:
return {'status': True, 'message': 'Validation successful'}

def validate_event_dates(input):
"""
Validate date fields
:param input:
"""

event_tz = input.get('start_date').tzinfo
today_date = datetime.datetime.now(event_tz)
start_date = input.get('start_date')
end_date = input.get('end_date')

if start_date < today_date or end_date < today_date:
return {'status': False, 'message': 'Sorry, you cannot enter a past date'}
elif end_date < start_date:
return {'status': False, 'message': 'Sorry, end date must be after start date'}
else:
return {'status': True, 'message': 'Validation successful'}

def not_valid_timezone(timezone):
return timezone not in pytz.all_timezones
Expand Down

0 comments on commit 268ba19

Please sign in to comment.