Added behavior to mark active server in servers dropdown

This commit is contained in:
Alejandro Celaya
2018-07-18 20:26:45 +02:00
parent fb407da3e8
commit e1049a74a2
6 changed files with 50 additions and 14 deletions

View File

@@ -71,6 +71,7 @@ class Row extends React.Component {
render() {
const { shortUrl, selectedServer } = this.props;
const selectedServerUrl = selectedServer ? selectedServer.url : '';
return (
<tr
@@ -81,8 +82,8 @@ class Row extends React.Component {
<Moment format="YYYY-MM-DD HH:mm" interval={0}>{shortUrl.dateCreated}</Moment>
</td>
<td className="short-urls-list__cell">
<a href={`${selectedServer.url}/${shortUrl.shortCode}`} target="_blank">
{`${selectedServer.url}/${shortUrl.shortCode}`}
<a href={`${selectedServerUrl}/${shortUrl.shortCode}`} target="_blank">
{`${selectedServerUrl}/${shortUrl.shortCode}`}
</a>
</td>
<td className="short-urls-list__cell">