Extracted servers list group from home component to a reusable component

This commit is contained in:
Alejandro Celaya
2020-03-08 11:16:57 +01:00
parent 6395e4e00b
commit 99042c0979
12 changed files with 138 additions and 92 deletions

View File

@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
import * as PropTypes from 'prop-types';
import { serverType } from '../servers/prop-types';
import MutedMessage from '../utils/MutedMessage';
import Message from '../utils/Message';
import NotFound from './NotFound';
import './MenuLayout.scss';
@@ -28,19 +28,19 @@ const MenuLayout = (TagsList, ShortUrls, AsideMenu, CreateShortUrl, ShortUrlVisi
useEffect(() => setShowSidebar(false), [ location ]);
if (!selectedServer) {
return <MutedMessage loading />;
return <Message loading />;
}
if (selectedServer.serverNotFound) {
return <MutedMessage>Could not find a server with id <b>&quot;{serverId}&quot;</b> in this host.</MutedMessage>;
return <Message type="error">Could not find this Shlink server in this host.</Message>;
}
if (selectedServer.serverNotReachable) {
return (
<MutedMessage>
Oops! Could not connect to Shlink server with ID <b>&quot;{serverId}&quot;</b>. Make sure you have internet
connection, the server is properly configured and it is on-line.
</MutedMessage>
<Message type="error">
<p>Oops! Could not connect to this Shlink server.</p>
Make sure you have internet connection, and the server is properly configured and on-line.
</Message>
);
}