mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* new ENV and page placeholder * display list data * comment out SearchInput * add counters * add tag to address page * tests * refactoring * fix ts * change ENVs for demo * fix ENVs validator * [skip ci] remove hash * review fixes
30 lines
781 B
TypeScript
30 lines
781 B
TypeScript
import type { Feature } from './types';
|
|
import { VALIDATORS_CHAIN_TYPE } from 'types/client/validators';
|
|
import type { ValidatorsChainType } from 'types/client/validators';
|
|
|
|
import { getEnvValue } from '../utils';
|
|
|
|
const chainType = ((): ValidatorsChainType | undefined => {
|
|
const envValue = getEnvValue('NEXT_PUBLIC_VALIDATORS_CHAIN_TYPE') as ValidatorsChainType | undefined;
|
|
return envValue && VALIDATORS_CHAIN_TYPE.includes(envValue) ? envValue : undefined;
|
|
})();
|
|
|
|
const title = 'Validators list';
|
|
|
|
const config: Feature<{ chainType: ValidatorsChainType }> = (() => {
|
|
if (chainType) {
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: true,
|
|
chainType,
|
|
});
|
|
}
|
|
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: false,
|
|
});
|
|
})();
|
|
|
|
export default config;
|