Added TimelineQueueButtonHeader component, styles

button at top of feeds to show "click to load more"
This commit is contained in:
mgabdev 2019-07-10 23:54:19 -04:00
parent f10878ceaa
commit 6ad747a609
2 changed files with 60 additions and 0 deletions

@ -0,0 +1,38 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { shortNumberFormat } from '../utils/numbers';
export default class TimelineQueueButtonHeader extends React.PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
count: PropTypes.number,
itemType: PropTypes.string,
};
static defaultProps = {
count: 0,
itemType: 'item',
};
render () {
const { count, itemType, onClick } = this.props;
if (count <= 0) return null;
return (
<div className='timeline-queue-header'>
<a className='timeline-queue-header__btn' onClick={onClick}>
<FormattedMessage
id='timeline_queue.label'
defaultMessage='Click to see {count} new {type}'
values={{
count: shortNumberFormat(count),
type: count == 1 ? itemType : `${itemType}s`,
}}
/>
</a>
</div>
);
}
}

@ -5103,3 +5103,25 @@ noscript {
}
}
}
.timeline-queue-header {
display: block;
width: 100%;
height: 52px;
position: relative;
background-color: darken($ui-base-color, 8%);
border-bottom: 1px solid;
border-top: 1px solid;
border-color: darken($ui-base-color, 4%);
&__btn {
display: block;
width: 100%;
height: 100%;
text-align: center;
line-height: 52px;
font-size: 14px;
cursor: pointer;
color: $secondary-text-color;
}
}