diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-06-14 22:29:40 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-06-17 17:48:04 +0200 |
commit | 9a641a5a0e7a8d45bf6d3b8e4bfdc269def2dc06 (patch) | |
tree | e61b37ed8d8c5a8446cf656600c90c85ccdc983c /app/javascript/flavours/glitch/components | |
parent | 65a9b788fc4fc9cf57cee8e8a7cae5dca8f97a5e (diff) |
[Glitch] Add hints about incomplete remote content to web UI
Port 3e9dc4044bb7e1ef6131fbd6430ed85b3cc2fcfa to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/scrollable_list.js | 5 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/components/timeline_hint.js | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/scrollable_list.js b/app/javascript/flavours/glitch/components/scrollable_list.js index c022290a4..fae0a7393 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.js +++ b/app/javascript/flavours/glitch/components/scrollable_list.js @@ -32,6 +32,7 @@ export default class ScrollableList extends PureComponent { hasMore: PropTypes.bool, numPending: PropTypes.number, prepend: PropTypes.node, + append: PropTypes.node, alwaysPrepend: PropTypes.bool, emptyMessage: PropTypes.node, children: PropTypes.node, @@ -272,7 +273,7 @@ export default class ScrollableList extends PureComponent { } render () { - const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props; + const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props; const { fullscreen } = this.state; const childrenCount = React.Children.count(children); @@ -319,6 +320,8 @@ export default class ScrollableList extends PureComponent { ))} {loadMore} + + {!hasMore && append} </div> </div> ); diff --git a/app/javascript/flavours/glitch/components/timeline_hint.js b/app/javascript/flavours/glitch/components/timeline_hint.js new file mode 100644 index 000000000..fb55a62cc --- /dev/null +++ b/app/javascript/flavours/glitch/components/timeline_hint.js @@ -0,0 +1,18 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { FormattedMessage } from 'react-intl'; + +const TimelineHint = ({ resource, url }) => ( + <div className='timeline-hint'> + <strong><FormattedMessage id='timeline_hint.remote_resource_not_displayed' defaultMessage='{resource} from other servers are not displayed.' values={{ resource }} /></strong> + <br /> + <a href={url} target='_blank'><FormattedMessage id='account.browse_more_on_origin_server' defaultMessage='Browse more on the original profile' /></a> + </div> +); + +TimelineHint.propTypes = { + resource: PropTypes.node.isRequired, + url: PropTypes.string.isRequired, +}; + +export default TimelineHint; |