mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
17 lines
466 B
TypeScript
17 lines
466 B
TypeScript
import config from 'configs/app';
|
|
|
|
const currencySymbol = config.chain.currency.symbol || 'LUX';
|
|
|
|
/**
|
|
* Replaces occurrences of "ETH" (as a whole word) with the chain's native
|
|
* currency symbol. The stats API returns hardcoded "ETH" in titles,
|
|
* descriptions, and counter units.
|
|
*/
|
|
export default function replaceNativeCoinName(text: string): string {
|
|
if (currencySymbol === 'ETH') {
|
|
return text;
|
|
}
|
|
|
|
return text.replace(/\bETH\b/g, currencySymbol);
|
|
}
|