Small style fixes (#4206)

* fix(components/media_modal): Center horizontally in Firefox

* fix(components/status_list): Do not remove load more button
This commit is contained in:
Sorin Davidoi 2017-07-14 22:31:25 +02:00 committed by Eugen Rochko
parent df81145b7c
commit 20111dd4d5
3 changed files with 10 additions and 6 deletions

View file

@ -6,11 +6,18 @@ export default class LoadMore extends React.PureComponent {
static propTypes = { static propTypes = {
onClick: PropTypes.func, onClick: PropTypes.func,
visible: PropTypes.bool,
}
static defaultProps = {
visible: true,
} }
render() { render() {
const { visible } = this.props;
return ( return (
<button className='load-more' onClick={this.props.onClick}> <button className='load-more' disabled={!visible} style={{ opacity: visible ? 1 : 0 }} onClick={this.props.onClick}>
<FormattedMessage id='status.load_more' defaultMessage='Load more' /> <FormattedMessage id='status.load_more' defaultMessage='Load more' />
</button> </button>
); );

View file

@ -101,13 +101,9 @@ export default class StatusList extends ImmutablePureComponent {
render () { render () {
const { statusIds, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props; const { statusIds, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props;
let loadMore = null; const loadMore = <LoadMore visible={!isLoading && statusIds.size > 0 && hasMore} onClick={this.handleLoadMore} />;
let scrollableArea = null; let scrollableArea = null;
if (!isLoading && statusIds.size > 0 && hasMore) {
loadMore = <LoadMore onClick={this.handleLoadMore} />;
}
if (isLoading || statusIds.size > 0 || !emptyMessage) { if (isLoading || statusIds.size > 0 || !emptyMessage) {
scrollableArea = ( scrollableArea = (
<div className='scrollable' ref={this.setRef}> <div className='scrollable' ref={this.setRef}>

View file

@ -1314,6 +1314,7 @@
.react-swipeable-view-container > * { .react-swipeable-view-container > * {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
height: 100%; height: 100%;
} }