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

chore(dashboard-page): Landing page should show valuable information #153

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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 client/assets/components/_eventNotFound.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.no-events {
grid-column: event-gallery-start/event-gallery-end;
&__container {
height: 100%;
width: 100%;
display: grid;
justify-content: center;
align-content: center;
grid-template-columns: auto;
grid-template-rows: repeat(3, auto);
text-align: center;
margin-top: 20%;
color: #365edb;
font-family: inherit;
}
Expand Down
7 changes: 6 additions & 1 deletion client/components/EventNotFound.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';

const EventNotFound = (props) => {
const {
statusMessage, mainMessage,
statusMessage, mainMessage, subMessage,
} = props;
return (

Expand All @@ -16,6 +16,9 @@ const EventNotFound = (props) => {
<h3 className="no-events__main-message">
{mainMessage}
</h3>
<p>
{subMessage}
</p>
</div>
</div>
);
Expand All @@ -25,11 +28,13 @@ const EventNotFound = (props) => {
EventNotFound.propTypes = {
mainMessage: PropTypes.string,
statusMessage: PropTypes.string,
subMessage: PropTypes.string,
};

EventNotFound.defaultProps = {
mainMessage: '',
statusMessage: '',
subMessage: '',
};


Expand Down
20 changes: 14 additions & 6 deletions client/pages/Event/EventsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ class EventsPage extends React.Component {
{listOfEventCard}
</div>);
}
return <EventNotFound statusMessage="404" mainMessage="Events not found" />;
return (<EventNotFound
mainMessage="No events available at the moment"
subMessage="Click on the + button below to create an event"
/>);
}

render() {
const { categoryList } = this.state;
const { events } = this.props;
const catList = Array.isArray(categoryList) ? categoryList.map(item => ({
id: item.node.id,
title: item.node.name,
Expand All @@ -168,11 +172,15 @@ class EventsPage extends React.Component {
<Calendar dateSelected={this.getFilteredEvents} />
</div>
{this.renderEventGallery()}
<div className="event__footer">
<button onClick={this.loadMoreEvents} type="button" className="btn-blue event__load-more-button">
Load more
</button>
</div>
{
events.length > 0
? (<div className="event__footer">
<button onClick={this.loadMoreEvents} type="button" className="btn-blue event__load-more-button">
Load more
</button>
</div>)
: null
}
</div>
);
}
Expand Down