Skip to content

Commit

Permalink
sq
Browse files Browse the repository at this point in the history
  • Loading branch information
daovist committed Jul 11, 2018
1 parent 47065fb commit 93de36b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
20 changes: 15 additions & 5 deletions src/renderer/component/common/busy-indicator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ type Props = {
message: ?string,
};

const BusyIndicator = (props: Props) => (
<span className="busy-indicator">
{props.message} <span className="busy-indicator__loader" />
</span>
);
class BusyIndicator extends React.PureComponent<Props> {
static defaultProps = {
message: '',
};

render() {
const { message } = this.props;

return (
<span className="busy-indicator">
{message} <span className="busy-indicator__loader" />
</span>
);
}
}

export default BusyIndicator;
8 changes: 3 additions & 5 deletions src/renderer/page/channel/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ChannelPage extends React.PureComponent<Props> {
this.props.navigate('/show', newParams);
}

paginate(e, totalPages: number) {
paginate(e: SyntheticKeyboardEvent<*>, totalPages: number) {
// Change page if enter was pressed, and the given page is between
// the first and the last.
const pageFromInput = Number(e.target.value);
Expand All @@ -71,18 +71,16 @@ class ChannelPage extends React.PureComponent<Props> {
const contentList =
claimsInChannel && claimsInChannel.length ? (
<FileList sortByHeight hideFilter fileInfos={claimsInChannel} />
) : !fetching ? (
<span className="empty">{__('No content found.')}</span>
) : (
null
!fetching && <span className="empty">{__('No content found.')}</span>
);

return (
<Page notContained>
<section className="card__channel-info card__channel-info--large">
<h1>
{name}
{fetching ? <BusyIndicator /> : null}
{fetching && <BusyIndicator />}
</h1>
<div className="card__actions card__actions--no-margin">
<SubscribeButton uri={permanentUrl} channelName={name} />
Expand Down

0 comments on commit 93de36b

Please sign in to comment.