some indent fix
This commit is contained in:
@@ -7,7 +7,7 @@ type TValidatorUrl = string;
|
||||
|
||||
export const ValidatorSelector: React.FC<{ onChangeValidatorSelection: (validator: TValidatorUrl) => void }> = ({
|
||||
onChangeValidatorSelection,
|
||||
}) => {
|
||||
}) => {
|
||||
const [validators, setValidators] = useState<string[] | null>();
|
||||
const [selectedValidator, setSelectedValidator] = useState<TValidatorUrl>('');
|
||||
|
||||
@@ -17,34 +17,34 @@ export const ValidatorSelector: React.FC<{ onChangeValidatorSelection: (validato
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
if(network) {
|
||||
const validator = await validatorUrls(network);
|
||||
setValidators(validator?.urls);
|
||||
if (network) {
|
||||
const validator = await validatorUrls(network);
|
||||
setValidators(validator?.urls);
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
onChangeValidatorSelection(selectedValidator);
|
||||
}, [selectedValidator]);
|
||||
|
||||
return (
|
||||
<Select
|
||||
labelId="validatorSelect_label"
|
||||
id="validatorSelect"
|
||||
value={selectedValidator}
|
||||
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>
|
||||
)};
|
||||
|
||||
<Select
|
||||
labelId="validatorSelect_label"
|
||||
id="validatorSelect"
|
||||
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>
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user