Skip to content

Commit

Permalink
add component
Browse files Browse the repository at this point in the history
  • Loading branch information
thebestmensch committed Dec 23, 2017
1 parent af14dfe commit 10729e2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/zilker/CardSection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import _ from 'lodash';

import EmptySearchResults from "../zilker/EmptySearchResults";
import GoalCardsGroup from "../zilker/GoalCardsGroup"
import ProjectCard from "../zilker/ProjectCard"

Expand All @@ -10,12 +11,16 @@ class CardSection extends Component {

render() {
const { cards, type } = this.props
const foundProjects = type === 'project' && cards && !!cards.length;

return (
<section className="coa-CardSection usa-section usa-grid coa-flex-container coa-flex-wrap">
<div className="row around-xs">
{
(type === "project") && cards.map((card) => {
!foundProjects && <EmptySearchResults />
}
{
foundProjects && cards.map((card) => {
return <ProjectCard {...card.node} />
})
}
Expand Down
22 changes: 22 additions & 0 deletions src/zilker/EmptySearchResults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { Component } from 'react';
import _ from 'lodash';

import Search from '../zilker/Search';

class EmptySearchResults extends Component {

render() {
const { cards, type } = this.props

return (
<section className="coa-EmptySearchResults">
<div>
No Results Found. Try another search or <a href="/projects">explore</a> current projects.
</div>
</section>
);
}

}

export default EmptySearchResults;

0 comments on commit 10729e2

Please sign in to comment.