({
color: getColor('main')(theme),
marginRight: 20,
flexShrink: 0,
- '&::before': {
- content: '""',
- display: 'inline-block',
- verticalAlign: 'middle',
- width: 33,
- height: 33,
- background: getColor('main')(theme),
- borderRadius: '50%',
- marginRight: 22,
+ display: 'flex',
+ alignItems: 'center',
+ '& div:first-child': {
+ marginRight: 15,
},
},
bar: {
diff --git a/src/v2/components/TourDeSol/Table/index.jsx b/src/v2/components/TourDeSol/Table/index.jsx
index 5fc0ba10..cfcd6374 100644
--- a/src/v2/components/TourDeSol/Table/index.jsx
+++ b/src/v2/components/TourDeSol/Table/index.jsx
@@ -18,6 +18,7 @@ import {Link} from 'react-router-dom';
import {map} from 'lodash/fp';
import NodesStore from 'v2/stores/nodes';
import getUptime from 'v2/utils/getUptime';
+import Avatar from 'v2/components/UI/Avatar';
import HelpLink from '../../HelpLink';
import useStyles from './styles';
@@ -30,38 +31,37 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
const renderRow = row => {
const uptime = getUptime(row);
+ const {identity = {}, nodePubkey, stake} = row;
return (
-
+
1
-
-
- {row.nodePubkey}
+
+
+ {identity.name || nodePubkey}
- {row.stake}
+ {stake}
{uptime}%
);
};
const renderCard = card => {
const uptime = getUptime(card);
+ const {identity = {}, nodePubkey, stake} = card;
return (
-
-
{card.nodePubkey}
+
+
{identity.name || nodePubkey}
Stake
- {card.stake}
+ {stake}
Uptime
diff --git a/src/v2/components/TourDeSol/Table/styles.js b/src/v2/components/TourDeSol/Table/styles.js
index ea75a43e..ea0aae26 100644
--- a/src/v2/components/TourDeSol/Table/styles.js
+++ b/src/v2/components/TourDeSol/Table/styles.js
@@ -60,15 +60,10 @@ export default makeStyles(theme => ({
alignItems: 'center',
color: getColor('main')(theme),
textDecoration: 'none',
- '& span': {
- width: 33,
- height: 33,
- flexShrink: 0,
- background: getColor('main')(theme),
- borderRadius: '50%',
- marginRight: 22,
- },
'& div': {
+ '&:first-child': {
+ marginRight: 22,
+ },
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
overflow: 'hidden',
diff --git a/src/v2/components/UI/Avatar/index.jsx b/src/v2/components/UI/Avatar/index.jsx
new file mode 100644
index 00000000..6922e2ff
--- /dev/null
+++ b/src/v2/components/UI/Avatar/index.jsx
@@ -0,0 +1,31 @@
+// @flow
+import React from 'react';
+import BaseAvatar from '@material-ui/core/Avatar';
+import theme from 'v2/theme';
+import getColor from 'v2/utils/getColor';
+
+const Avatar = ({
+ avatarUrl = '',
+ name = '',
+ width = 33,
+ height = 33,
+}: {
+ avatarUrl: string,
+ name: string,
+}) => {
+ const initials = name.charAt(0);
+ const avatarStyle = {
+ backgroundColor: getColor('main')(theme),
+ color: getColor('white')(theme),
+ width,
+ height,
+ };
+
+ return (
+
+ {!avatarUrl && initials}
+
+ );
+};
+
+export default Avatar;
diff --git a/src/v2/components/Validators/Detail/index.jsx b/src/v2/components/Validators/Detail/index.jsx
index 30b850ec..5e2c248b 100644
--- a/src/v2/components/Validators/Detail/index.jsx
+++ b/src/v2/components/Validators/Detail/index.jsx
@@ -3,7 +3,7 @@ import {Container, useTheme} from '@material-ui/core';
import {observer} from 'mobx-react-lite';
import useMediaQuery from '@material-ui/core/useMediaQuery/useMediaQuery';
import React, {useEffect} from 'react';
-import {map, find, compose, mergeWith} from 'lodash/fp';
+import {map, find} from 'lodash/fp';
import {Match} from 'react-router-dom';
import {CopyToClipboard} from 'react-copy-to-clipboard';
import {
@@ -20,6 +20,8 @@ import theme, {mapStyle, markerStyle} from 'v2/theme';
import MapTooltip from 'v2/components/UI/MapTooltip';
import HelpLink from 'v2/components/HelpLink';
import getColor from 'v2/utils/getColor';
+import Button from 'v2/components/UI/Button';
+import Avatar from 'v2/components/UI/Avatar';
import {ReactComponent as CopyIcon} from '../../../assets/icons/copy.svg';
import Mixpanel from '../../../mixpanel';
@@ -36,9 +38,7 @@ const markerCircleStyle = {
};
const ValidatorsDetail = ({match}: {match: Match}) => {
- const {
- cluster: {voting, cluster},
- } = NodesStore;
+ const {validators} = NodesStore;
const classes = useStyles();
const theme = useTheme();
@@ -49,16 +49,13 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
Mixpanel.track(`Clicked Validator ${params.id}`);
}, [params.id]);
- const currentNode = find({pubkey: params.id})(cluster);
- if (!currentNode) {
+ const node = find({nodePubkey: params.id})(validators);
+
+ if (!node) {
return Loading...
;
}
- const node = compose(
- mergeWith(currentNode, {
- coordinates: [currentNode.lng, currentNode.lat],
- }),
- find({nodePubkey: params.id}),
- )(voting);
+
+ const {nodePubkey, gossip, stake, commission, identity = {}} = node;
const renderMarker = () => (
@@ -66,8 +63,8 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
classes={{tooltip: classes.tooltip}}
title={() => (
<>
- NODE: {node.nodePubkey}
- Gossip: {node.gossip}
+ NODE: {nodePubkey}
+ Gossip: {gossip}
>
)}
>
@@ -80,17 +77,17 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'Website',
hint: '',
- value: 'TODO',
+ value: identity.website || '',
},
{
label: 'Voting power',
hint: '',
- value: `${node.stake}`,
+ value: stake,
},
{
label: 'Address',
hint: '',
- value: `${node.pubkey}`,
+ value: nodePubkey,
},
{
label: 'Missed blocks',
@@ -100,17 +97,17 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'keybase',
hint: '',
- value: 'TODO',
+ value: identity.keybaseUsername || '',
},
{
label: 'commission',
hint: '',
- value: `${node.commission}%`,
+ value: `${commission}%`,
},
{
label: 'details',
hint: '',
- value: 'TODO',
+ value: identity.details || '',
},
{
label: 'Amount of delegated sol',
@@ -147,15 +144,26 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{!isMobile && (
-
- {node.nodePubkey}
-
+
+ {identity.name || nodePubkey}
+
)}
+
+
+