@broxus/js-core
Version:
MobX-based JavaScript Core library
47 lines (46 loc) • 2.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.inheritTextStyle = exports.errorTextStyle = exports.warningTextStyle = exports.successTextStyle = exports.errorLabelStyle = exports.warningLabelStyle = exports.successLabelStyle = exports.baseLabelStyle = exports.errorColor = exports.warningColor = exports.successColor = void 0;
exports.labelStyle = labelStyle;
exports.getScanLink = getScanLink;
const types_1 = require("./types");
exports.successColor = '#3e8c3e';
exports.warningColor = '#fab254';
exports.errorColor = '#d33131';
function labelStyle(color = 'inherit') {
return `
background-color: ${color}50;
border-left: 3px solid ${color};
border-radius: 2px;
display: inline;
font-size: 1em;
font-weight: bold;
line-height: 1rem;
padding: 3px 4px 0 4px`;
}
function getScanLink(address, networkId) {
if (networkId === types_1.TvmChains.VenomTestnet.toString()) {
return `https://testnet.venomscan.com/accounts/${address}`;
}
if (networkId === types_1.TvmChains.VenomMainnet.toString()) {
return `https://venomscan.com/accounts/${address}`;
}
if (networkId === types_1.TvmChains.HamsterMainnet.toString()) {
return `https://hamsterscan.io/accounts/${address}`;
}
if (networkId === types_1.TvmChains.HumoMainnet.toString()) {
return `https://humoscan.com/accounts/${address}`;
}
if (networkId === types_1.TvmChains.TychoTestnet.toString()) {
return `https://testnet.tychoprotocol.com/accounts/${address}`;
}
return `https://everscan.io/accounts/${address}`;
}
exports.baseLabelStyle = labelStyle('#767676');
exports.successLabelStyle = labelStyle(exports.successColor);
exports.warningLabelStyle = labelStyle(exports.warningColor);
exports.errorLabelStyle = labelStyle(exports.errorColor);
exports.successTextStyle = `color: ${exports.successColor}; display: inline; font-weight: 400; font-family: monospace;`;
exports.warningTextStyle = `color: ${exports.warningColor}; display: inline; font-weight: 400; font-family: monospace;`;
exports.errorTextStyle = `color: ${exports.errorColor}; display: inline; font-weight: 400; font-family: monospace;`;
exports.inheritTextStyle = 'color: inherit; display: inline; font-weight: 400; font-family: monospace;';