Restyling Load More button.

This commit is contained in:
David Jay
2017-02-13 13:22:50 -05:00
parent 4fedb7f31e
commit 5b2f52a283
2 changed files with 37 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import React from 'react';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from 'coral-framework/translations.json';
import Button from 'coral-ui';
const lang = new I18n(translations);
const loadMoreComments = (id, comments, loadMore) => {
if (!comments.length) {
return;
}
loadMore({
limit: 10,
cursor: comments[comments.length - 1].created_at,
asset_id: id,
sort: 'REVERSE_CHRONOLOGICAL'
});
};
const LoadMore = ({id, comments, loadMore}) => comments.length > 5 ?
<Button
className='coral-load-more'
onClick={() => loadMoreComments(id, comments, loadMore)}>
{
lang.t('loadMore')
}
</Button>
: null;
export default LoadMore;
@@ -304,3 +304,9 @@ hr {
.close-comments-alert i.material-icons {
font-size: 16px !important;
}
/* Load More */
.coral-load-more {
width: 100%;
}