Skip to content

Commit

Permalink
[MapNodeInfo] betting text rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Jul 22, 2024
1 parent 7972e24 commit 3caffc6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/map/MapNodeInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function MapNodeInfoMain (props) {
return (
<Card className='encointer-map-node-info' style={props.style || {}}>
<Card.Content className='info' onClick={onClickNode}>
<Card.Header>{nodeInfo.nodeName} <Icon name='chevron down' /></Card.Header>
<Card.Meta>{`${nodeInfo.chain || ''} v${nodeInfo.nodeVersion || ''}`}</Card.Meta>
<Card.Header>{nodeName(nodeInfo)} <Icon name='chevron down' /></Card.Header>
<Card.Meta>{chainInfo(nodeInfo)}</Card.Meta>
</Card.Content>
{
apiState === 'READY'
Expand Down Expand Up @@ -109,6 +109,14 @@ function MapNodeInfoMain (props) {
);
}

function nodeName (nodeInfo) {
return nodeInfo.nodeName !== undefined ? nodeInfo.nodeName : '...getting node name';
}

function chainInfo (nodeInfo) {
return nodeInfo.chain !== undefined ? `${nodeInfo.chain} v${nodeInfo.nodeVersion}` : '';
}

export default function MapNodeInfo (props) {
return <MapNodeInfoMain {...props} />;
}

0 comments on commit 3caffc6

Please sign in to comment.