mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-14 11:33:51 +00:00
Added proper loading status handling to short URLs list
This commit is contained in:
@@ -43,11 +43,15 @@ export class ShortUrlsList extends React.Component {
|
||||
}
|
||||
|
||||
renderShortUrls() {
|
||||
const { shortUrlsList, selectedServer } = this.props;
|
||||
if (isEmpty(shortUrlsList)) {
|
||||
const { shortUrlsList, selectedServer, loading } = this.props;
|
||||
if (loading) {
|
||||
return <tr><td colSpan="6" className="text-center">Loading...</td></tr>;
|
||||
}
|
||||
|
||||
if (! loading && isEmpty(shortUrlsList)) {
|
||||
return <tr><td colSpan="6" className="text-center">No results found</td></tr>;
|
||||
}
|
||||
|
||||
return shortUrlsList.map(shortUrl => (
|
||||
<Row shortUrl={shortUrl} selectedServer={selectedServer} key={shortUrl.shortCode} />
|
||||
));
|
||||
@@ -69,8 +73,9 @@ class Row extends React.Component {
|
||||
const { shortUrl, selectedServer } = this.props;
|
||||
|
||||
return (
|
||||
<tr onMouseEnter={() => this.setState({ displayMenu: true })}
|
||||
onMouseLeave={() => this.setState({ displayMenu: false })}
|
||||
<tr
|
||||
onMouseEnter={() => this.setState({ displayMenu: true })}
|
||||
onMouseLeave={() => this.setState({ displayMenu: false })}
|
||||
>
|
||||
<td className="nowrap short-urls-list__cell">
|
||||
<Moment format="YYYY-MM-DD HH:mm" interval={0}>{shortUrl.dateCreated}</Moment>
|
||||
|
||||
Reference in New Issue
Block a user