Skip to content

Commit

Permalink
Merge pull request #261 from numo-labs/destination-tile-fix
Browse files Browse the repository at this point in the history
Destination tile fix
  • Loading branch information
Jimmy Ruts authored Jun 10, 2016
2 parents 3c7d2ce + 88cb011 commit 8e8c1fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const basename = '/isearch/0.16/index.html';
export const basename = '/isearch/0.17/index.html';
7 changes: 5 additions & 2 deletions lib/destination-tile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ class DestinationTile extends Component {
const { image, title, text } = sections[0];
let previewTextArray = text.split('').slice(0, 292);
if (previewTextArray[previewTextArray.length - 1] === ' ') {
previewTextArray = previewTextArray.slice(0, previewTextArray.length - 1);
previewTextArray = previewTextArray.slice(0, previewTextArray.length - 1); // remove unecessary whitespace at the end of the string
}
const previewText = previewTextArray.slice(0, previewTextArray.length - 1).join('') + '...</div>';
if (previewTextArray.slice(0, 5).join('').indexOf('<div>') === -1) {
previewTextArray = ['<div>', ...previewTextArray]; // if the paragraph doesn't start with a <div> then add one so the html is valid
}
const previewText = previewTextArray.slice(0, previewTextArray.length - 1).join('') + '...</div>'; // close the string with a </div>
return (
<div className='destinationTileContainer'>
<div className='destinationImage' style={{backgroundImage: `url(${image})`}}>
Expand Down
1 change: 1 addition & 0 deletions lib/destination-tile/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
.mapVideoIconContainer {
text-align: center;
padding-top: 1.2em;
background-color: white;
}

.titleDestHotelContainer {
Expand Down
2 changes: 1 addition & 1 deletion src/components/search-results/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class SearchResults extends Component {
// see: https://github.com/numo-labs/isearch-ui/issues/257
if (((feedEnd && searchComplete) || (searchItems.length === 0 && searchComplete)) && relatedItems.length > 0) {
return (
[<div className='feed-end-message'>{message}</div>,
[<div key={'message'} className='feed-end-message'>{message}</div>,
<Masonry
elementType={'div'}
options={masonryOptions}
Expand Down

0 comments on commit 8e8c1fd

Please sign in to comment.