adding dummy urls on mainnet and some dropdown improvements

This commit is contained in:
gala1234
2022-03-31 10:01:46 +02:00
parent 26a067c14d
commit b8ee730561
2 changed files with 31 additions and 21 deletions
+6
View File
@@ -20,5 +20,11 @@ pub(crate) fn validators() -> Vec<ValidatorDetails> {
vec![ValidatorDetails::new(
"https://rpc.nyx.nodes.guru/",
Some("https://api.nyx.nodes.guru/"),
), ValidatorDetails::new(
"https://test2.nyx.nodes.guru/",
Some("https://test1.nyx.nodes.guru/"),
), ValidatorDetails::new(
"https://test2.nyx.nodes.guru/",
Some("https://test1.nyx.nodes.guru/"),
)]
}
+25 -21
View File
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from 'react';
import { ListItemText, MenuItem, Select, SelectChangeEvent, Typography, useMediaQuery } from '@mui/material';
import { FormControl, InputLabel, ListItemText, MenuItem, Select, SelectChangeEvent, Typography, useMediaQuery } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { ClientContext } from '../context/main';
import { validatorUrls } from '../utils';
@@ -32,25 +32,29 @@ export const ValidatorSelector: React.FC<{ onChangeValidatorSelection: (validato
}, [selectedValidator]);
return (
<Select
labelId="validatorSelect_label"
id="validatorSelect"
sx={{
width: matches ? 'auto' : 300
}}
value={selectedValidator || 'choose validator url'}
onChange={(e: SelectChangeEvent) => {
setSelectedValidator(e.target.value as TValidatorUrl);
}}
renderValue={(value) => <Typography sx={{ textTransform: 'capitalize' }}>{value}</Typography>}
>
{
validators && validators.map((validator) => (
<MenuItem value={validator} key={validator}>
<ListItemText>{validator}</ListItemText>
</MenuItem>
))
}
</Select>
<FormControl fullWidth>
<InputLabel id="validatorSelect_label">Choose a Validator</InputLabel>
<Select
labelId="validatorSelect_label"
id="validatorSelect"
sx={{
width: matches ? 'auto' : 300
}}
value={selectedValidator || ''}
label="Choose a Validator"
onChange={(e: SelectChangeEvent) => {
setSelectedValidator(e.target.value as TValidatorUrl);
}}
renderValue={(value) => <Typography sx={{ textTransform: 'capitalize' }}>{value}</Typography>}
>
{
validators && validators.map((validator) => (
<MenuItem value={validator} key={validator}>
<ListItemText>{validator}</ListItemText>
</MenuItem>
))
}
</Select>
</FormControl>
)
};