Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: markers keybase avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera committed Oct 30, 2019
1 parent 82c847a commit 218a598
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default makeStyles(theme => ({
card: {
background: getColor('grey2')(theme),
maxHeight: 290,
overflow: 'hidden',
height: '100%',
border: `1px solid ${getColor('grey5')(theme)}`,
position: 'relative',
Expand Down
5 changes: 1 addition & 4 deletions src/v2/components/Validators/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ const ValidatorsDetail = ({match}: {match: Match}) => {

const {
nodePubkey,
gossip,
commission,
identity = {},
coordinates,
stakedSol,
stakedSolPercent,
calcUptime,
} = node;

const markers = [{gossip, coordinates, name: nodePubkey}];
const specs = [
{
label: 'Address',
Expand Down Expand Up @@ -174,7 +171,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{map(renderSpec)(specs)}
</ul>
<div className={classes.map}>
<ValidatorsMap markers={markers} />
<ValidatorsMap markers={[node]} />
</div>
</div>
</Container>
Expand Down
14 changes: 7 additions & 7 deletions src/v2/components/ValidatorsMap/Marker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import React from 'react';
import MapTooltip from 'v2/components/UI/MapTooltip';
import Avatar from 'v2/components/UI/Avatar';

import ValidatorName from 'v2/components//UI/ValidatorName';

import useStyles from './styles';

const Marker = ({scale, marker}: {scale: number, marker: any}) => {
const classes = useStyles();
const transformScale = scale < 4 ? scale / 4 : 1;
const {
nodePubkey,
identity,
identity = {},
calcCommission,
calcUptime,
stakedSol,
Expand All @@ -25,8 +25,8 @@ const Marker = ({scale, marker}: {scale: number, marker: any}) => {
<div className={classes.inner}>
<ValidatorName
pubkey={nodePubkey}
name={identity ? identity.name : ''}
avatar={identity ? identity.avatarUrl : ''}
name={identity.name}
avatar={identity.avatarUrl}
/>
<div className={classes.info}>
<div>
Expand All @@ -48,9 +48,9 @@ const Marker = ({scale, marker}: {scale: number, marker: any}) => {
<Avatar
width={40}
height={40}
avatarUrl={marker.avatarUrl}
name={marker.name}
pubkey={marker.pubkey}
avatarUrl={identity.avatarUrl}
name={identity.name}
pubkey={nodePubkey}
/>
</div>
</MapTooltip>
Expand Down
4 changes: 2 additions & 2 deletions src/v2/components/ValidatorsMap/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import GoogleMap from 'google-map-react';
import {get, map} from 'lodash/fp';
import {get, map, uniqueId} from 'lodash/fp';
import {observer} from 'mobx-react-lite';
import React, {useState} from 'react';

Expand Down Expand Up @@ -104,7 +104,7 @@ const renderMarkers = zoom =>
map(marker => {
return (
<Marker
key={get('nodePubkey')(marker)}
key={uniqueId('marker')}
lng={get('coordinates[0]')(marker)}
lat={get('coordinates[1]')(marker)}
scale={zoom}
Expand Down

0 comments on commit 218a598

Please sign in to comment.