Show N/A when field is empty

This commit is contained in:
Berkeley Martinez
2015-10-11 20:25:09 -07:00
parent f7d7e538a2
commit e4e87fd1a1

View File

@ -2,6 +2,10 @@ import React, { PropTypes } from 'react';
import { Row, Thumbnail, Panel, Well } from 'react-bootstrap'; import { Row, Thumbnail, Panel, Well } from 'react-bootstrap';
import moment from 'moment'; import moment from 'moment';
const defaultImage =
'https://pbs.twimg.com/' +
'profile_images/562385977390272512/AK29YaTf_400x400.png';
const thumbnailStyle = { const thumbnailStyle = {
backgroundColor: 'white', backgroundColor: 'white',
maxHeight: '100px', maxHeight: '100px',
@ -47,12 +51,13 @@ export default React.createClass({
<Row> <Row>
<Well> <Well>
<Thumbnail <Thumbnail
alt={ company + 'company logo' } alt={ logo ? company + 'company logo' : 'stock image' }
src={ logo } src={ logo || defaultImage }
style={ thumbnailStyle } /> style={ thumbnailStyle } />
<Panel> <Panel>
Position: { position } Position: { position || 'N/A' }
Location: { city }, { state } <br />
Location: { city || '' }, { state || 'N/A' }
<br /> <br />
Contact: { email || phone || 'N/A' } Contact: { email || phone || 'N/A' }
<br /> <br />