Skip to content

Commit

Permalink
feat(entity-info): prevent render if there is nothing to show (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored and Houssein Djirdeh committed Aug 7, 2017
1 parent 6462489 commit e03084e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/entity-info.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ const navigateToCompany = (company, orgs, navigation) => {
};

export const EntityInfo = ({ entity, orgs, language, navigation }: Props) => {
const checksKeys = ['company', 'location', 'email', 'blog'];

if (!checksKeys.filter(key => !!entity[key]).length) {
return null;
}

return (
<SectionList title={translate('common.info', language)}>
{!!entity.company &&
Expand Down

0 comments on commit e03084e

Please sign in to comment.