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

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera authored and sunnygleason committed Aug 16, 2019
1 parent ac52de9 commit f5d7d60
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/v2/assets/icons/bicycle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const NodesMap = () => {
},
style: {
width: '100%',
height: 'auto',
},
center: [0, 20],
};
Expand Down
2 changes: 1 addition & 1 deletion src/v2/components/Dashboard/NetworkOverview/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default makeStyles(theme => ({
},
card: {
height: 306,
'& > svg': {
'& svg': {
width: '100%',
height: 295,
minHeight: 290,
Expand Down
14 changes: 8 additions & 6 deletions src/v2/components/NavBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import EndpointSelector from '../EndpointSelector';
import {ReactComponent as dashboard} from './assets/dashboard.svg';
import {ReactComponent as transactions} from './assets/transactions.svg';
import {ReactComponent as validators} from './assets/validators.svg';
import {ReactComponent as tourDeSol} from './assets/tour-de-sol.svg';
import {ReactComponent as tourdesol} from './assets/tourdesol.svg';
import {ReactComponent as applications} from './assets/applications.svg';
import {ReactComponent as blocks} from './assets/blocks.svg';
import {ReactComponent as favorites} from './assets/favorites.svg';
Expand All @@ -30,7 +30,7 @@ const icons = {
dashboard,
transactions,
validators,
'tour-de-sol': tourDeSol,
tourdesol,
applications,
blocks,
favorites,
Expand All @@ -40,7 +40,7 @@ const navTracks = {
dashboard: 'Clicked Overview',
transactions: 'Clicked Transactions Page',
validators: 'Clicked Validators Page',
'tour-de-sol': 'Clicked TDS Page',
tourdesol: 'Clicked TDS Page',
applications: 'Clicked Applications page',
blocks: 'Clicked Blocks page',
favorites: 'Clicked Favorites page',
Expand Down Expand Up @@ -69,6 +69,8 @@ const NavBar = ({
},
{
link: 'tour-de-sol',
icon: 'tourdesol',
title: 'tour de sol',
},
{
link: 'transactions',
Expand All @@ -87,8 +89,8 @@ const NavBar = ({
disabled: true,
},
];
const renderLink = ({link, disabled}: {link: string, disabled?: boolean}) => {
const Icon = icons[link];
const renderLink = ({link, title, icon, disabled}: {link: string, title: string, icon: string, disabled?: boolean}) => {
const Icon = icons[icon || link];
const isDashboard = eq('dashboard', link);
const selected =
location.pathname.includes(link) ||
Expand All @@ -113,7 +115,7 @@ const NavBar = ({
</ListItemIcon>
<ListItemText
classes={{primary: classes.itemText, root: classes.itemTextRoot}}
primary={link}
primary={title || link}
/>
{disabled && <div className={classes.coming}>Coming Soon</div>}
</ListItem>
Expand Down
9 changes: 5 additions & 4 deletions src/v2/components/TourDeSol/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NodesStore from 'v2/stores/nodes';
import getUptime from 'v2/utils/getUptime';
import Avatar from 'v2/components/UI/Avatar';

import {LAMPORT_SOL_RATIO} from '../../../constants';
import HelpLink from '../../HelpLink';
import useStyles from './styles';

Expand All @@ -41,7 +42,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
<div>{identity.name || nodePubkey}</div>
</Link>
</TableCell>
<TableCell>{stake}</TableCell>
<TableCell>{(stake * LAMPORT_SOL_RATIO).toFixed(8)}</TableCell>
<TableCell>{uptime}%</TableCell>
</TableRow>
);
Expand All @@ -60,8 +61,8 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
</Link>
<Grid container>
<Grid item xs={4} zeroMinWidth>
<div className={classes.cardTitle}>Stake</div>
<div>{stake}</div>
<div className={classes.cardTitle}>Stakw</div>
<div>{(stake * LAMPORT_SOL_RATIO).toFixed(4)} </div>
</Grid>
<Grid item xs={4} zeroMinWidth>
<div className={classes.cardTitle}>Uptime</div>
Expand Down Expand Up @@ -91,7 +92,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
<TableRow>
<TableCell width={100}>Ranking</TableCell>
<TableCell width={230}>Name</TableCell>
<TableCell>Stake</TableCell>
<TableCell>Stake SOL</TableCell>
<TableCell width={110}>Uptime</TableCell>
</TableRow>
</TableHead>
Expand Down
3 changes: 2 additions & 1 deletion src/v2/components/Validators/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Avatar from 'v2/components/UI/Avatar';
import Mixpanel from 'v2/mixpanel';
import CopyBtn from 'v2/components/UI/CopyBtn';

import {LAMPORT_SOL_RATIO} from '../../../constants';
import useStyles from './styles';

const mapStyles = {
Expand Down Expand Up @@ -89,7 +90,7 @@ const ValidatorsDetail = ({match}: {match: Match}) => {
{
label: 'Voting power',
hint: '',
value: stake,
value: (stake * LAMPORT_SOL_RATIO).toFixed(8),
},
{
label: 'Website',
Expand Down
7 changes: 4 additions & 3 deletions src/v2/components/Validators/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NodesStore from 'v2/stores/nodes';
import getUptime from 'v2/utils/getUptime';
import Avatar from 'v2/components/UI/Avatar';

import {LAMPORT_SOL_RATIO} from '../../../constants';
import useStyles from './styles';

const ValidatorsTable = ({separate}: {separate: boolean}) => {
Expand All @@ -38,7 +39,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
<div>{identity.name || nodePubkey}</div>
</Link>
</TableCell>
<TableCell>{(stake && stake + ' Lamports') || 'N/A'}</TableCell>
<TableCell>{(stake && (stake * LAMPORT_SOL_RATIO).toFixed(8)) || 'N/A'}</TableCell>
<TableCell>{commission || 'N/A'}</TableCell>
<TableCell>{(uptime && uptime + '%') || 'Node Unavailable'}</TableCell>
</TableRow>
Expand All @@ -59,7 +60,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
<Grid container spacing={1}>
<Grid item xs={4} zeroMinWidth>
<div className={classes.cardTitle}>Stake</div>
<div>{(stake && stake + ' Lamports') || 'N/A'}</div>
<div>{(stake && (stake * LAMPORT_SOL_RATIO).toFixed(4)) || 'N/A'}</div>
</Grid>
<Grid item xs={4} zeroMinWidth>
<div className={classes.cardTitle}>Commission</div>
Expand Down Expand Up @@ -90,7 +91,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
<TableHead className={classes.head}>
<TableRow>
<TableCell align="center">Name/Moniker</TableCell>
<TableCell>Stake</TableCell>
<TableCell>Stake SOL</TableCell>
<TableCell>Commission</TableCell>
<TableCell>Uptime</TableCell>
</TableRow>
Expand Down
1 change: 1 addition & 0 deletions src/v2/constants.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const MIN_TERM_LEN = 3;
export const LAMPORT_SOL_RATIO = 0.0000000000582;

0 comments on commit f5d7d60

Please sign in to comment.