Commit fdf70b1e authored by Max Alekseenko's avatar Max Alekseenko

remove usd_threshold prop

parent d2e39b36
...@@ -14,7 +14,6 @@ const config: Feature<{ ...@@ -14,7 +14,6 @@ const config: Feature<{
logoUrl?: string; logoUrl?: string;
url: string; url: string;
dappId?: string; dappId?: string;
usdThreshold: number;
}> = (() => { }> = (() => {
if (value) { if (value) {
return Object.freeze({ return Object.freeze({
...@@ -24,7 +23,6 @@ const config: Feature<{ ...@@ -24,7 +23,6 @@ const config: Feature<{
logoUrl: value.logo, logoUrl: value.logo,
url: value.url_template.replace('{chainId}', chain.id || ''), url: value.url_template.replace('{chainId}', chain.id || ''),
dappId: marketplace.isEnabled ? value.dapp_id : undefined, dappId: marketplace.isEnabled ? value.dapp_id : undefined,
usdThreshold: value.usd_threshold,
}); });
} }
......
...@@ -39,7 +39,7 @@ NEXT_PUBLIC_MARKETPLACE_SUGGEST_IDEAS_FORM=https://airtable.com/appiy5yijZpMMSKj ...@@ -39,7 +39,7 @@ NEXT_PUBLIC_MARKETPLACE_SUGGEST_IDEAS_FORM=https://airtable.com/appiy5yijZpMMSKj
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=https://metadata.services.blockscout.com NEXT_PUBLIC_METADATA_SERVICE_API_HOST=https://metadata.services.blockscout.com
NEXT_PUBLIC_METASUITES_ENABLED=true NEXT_PUBLIC_METASUITES_ENABLED=true
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG={'name': 'zerion', 'dapp_id': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview?utm_source=blockscout&utm_medium=address', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'} NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG={'name': 'zerion', 'dapp_id': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview?utm_source=blockscout&utm_medium=address', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'}
NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'dapp_id': 'smol-refuel', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&utm_medium=address&disableBridges=true', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png', 'usd_threshold': 10} NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'dapp_id': 'smol-refuel', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&utm_medium=address&disableBridges=true', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png'}
NEXT_PUBLIC_NAME_SERVICE_API_HOST=https://bens.services.blockscout.com NEXT_PUBLIC_NAME_SERVICE_API_HOST=https://bens.services.blockscout.com
NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES=['/apps'] NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES=['/apps']
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18 NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
......
...@@ -650,7 +650,6 @@ const schema = yup ...@@ -650,7 +650,6 @@ const schema = yup
url_template: yup.string().required(), url_template: yup.string().required(),
logo: yup.string(), logo: yup.string(),
dapp_id: yup.string(), dapp_id: yup.string(),
usd_threshold: yup.number().required(),
}); });
return isUndefined || valueSchema.isValidSync(data); return isUndefined || valueSchema.isValidSync(data);
......
...@@ -78,4 +78,4 @@ NEXT_PUBLIC_WEB3_WALLETS=['coinbase','metamask','token_pocket'] ...@@ -78,4 +78,4 @@ NEXT_PUBLIC_WEB3_WALLETS=['coinbase','metamask','token_pocket']
NEXT_PUBLIC_VALIDATORS_CHAIN_TYPE=stability NEXT_PUBLIC_VALIDATORS_CHAIN_TYPE=stability
NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swap','icon':'swap','dappId':'uniswap'},{'text':'Payment link','icon':'payment_link','url':'https://example.com'}] NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swap','icon':'swap','dappId':'uniswap'},{'text':'Payment link','icon':'payment_link','url':'https://example.com'}]
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG={'name': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'} NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG={'name': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'}
NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'dapp_id': 'smol-refuel', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&utm_medium=address&disableBridges=true', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png', 'usd_threshold': 10} NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'dapp_id': 'smol-refuel', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&utm_medium=address&disableBridges=true', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png'}
...@@ -708,11 +708,11 @@ If the feature is enabled, a Multichain balance button will be displayed on the ...@@ -708,11 +708,11 @@ If the feature is enabled, a Multichain balance button will be displayed on the
### Get gas button ### Get gas button
If the feature is enabled, a Get gas button will be displayed on the address page, which will take you to the gas refuel application in the marketplace or to an external site. If the feature is enabled, a Get gas button will be displayed in the top bar, which will take you to the gas refuel application in the marketplace or to an external site.
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version | | Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
| --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- |
| NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG | `{ name: string; url_template: string; dapp_id?: string; logo?: string, usd_threshold: number }` | Get gas button config. See [below](#get-gas-button-configuration-properties) | - | - | `{ name: 'Need gas?', dapp_id: 'smol-refuel', url_template: 'https://smolrefuel.com/?outboundChain={chainId}', logo: 'https://example.com/icon.png', usd_threshold: 10 }` | v1.33.0+ | | NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG | `{ name: string; url_template: string; dapp_id?: string; logo?: string }` | Get gas button config. See [below](#get-gas-button-configuration-properties) | - | - | `{ name: 'Need gas?', dapp_id: 'smol-refuel', url_template: 'https://smolrefuel.com/?outboundChain={chainId}', logo: 'https://example.com/icon.png' }` | v1.33.0+ |
&nbsp; &nbsp;
...@@ -724,7 +724,6 @@ If the feature is enabled, a Get gas button will be displayed on the address pag ...@@ -724,7 +724,6 @@ If the feature is enabled, a Get gas button will be displayed on the address pag
| url_template | `string` | Url template, may contain `{chainId}` variable | Required | - | `https://smolrefuel.com/?outboundChain={chainId}` | | url_template | `string` | Url template, may contain `{chainId}` variable | Required | - | `https://smolrefuel.com/?outboundChain={chainId}` |
| dapp_id | `string` | Set for open a Blockscout dapp page instead of opening external app page | - | - | `smol-refuel` | | dapp_id | `string` | Set for open a Blockscout dapp page instead of opening external app page | - | - | `smol-refuel` |
| logo | `string` | Gas refuel application logo url | - | - | `https://example.com/icon.png` | | logo | `string` | Gas refuel application logo url | - | - | `https://example.com/icon.png` |
| usd_threshold | `number` | Native token balance value in USD below which the button will be displayed | - | `1` | `10` |
&nbsp; &nbsp;
......
...@@ -3,5 +3,4 @@ export type GasRefuelProviderConfig = { ...@@ -3,5 +3,4 @@ export type GasRefuelProviderConfig = {
dapp_id?: string; dapp_id?: string;
url_template: string; url_template: string;
logo?: string; logo?: string;
usd_threshold: number;
}; };
...@@ -11,17 +11,12 @@ import TextSeparator from 'ui/shared/TextSeparator'; ...@@ -11,17 +11,12 @@ import TextSeparator from 'ui/shared/TextSeparator';
const getGasFeature = config.features.getGasButton; const getGasFeature = config.features.getGasButton;
interface Props { const GetGasButton = () => {
usdValue?: string;
isContract?: boolean;
}
const GetGasButton = ({ usdValue, isContract }: Props) => {
const onGetGasClick = React.useCallback(() => { const onGetGasClick = React.useCallback(() => {
mixpanel.logEvent(mixpanel.EventTypes.BUTTON_CLICK, { Content: 'Get gas', Source: 'address' }); mixpanel.logEvent(mixpanel.EventTypes.BUTTON_CLICK, { Content: 'Get gas', Source: 'address' });
}, []); }, []);
if (getGasFeature.isEnabled && !isContract && usdValue && Number(usdValue) < getGasFeature.usdThreshold) { if (getGasFeature.isEnabled) {
try { try {
const dappId = getGasFeature.dappId; const dappId = getGasFeature.dappId;
const urlObj = new URL(getGasFeature.url); const urlObj = new URL(getGasFeature.url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment