Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
fdbf1dec
Commit
fdbf1dec
authored
Jul 22, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace chain id at init
parent
0f84e8dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
getGasButton.ts
configs/app/features/getGasButton.ts
+3
-2
AddressBalance.tsx
ui/address/details/AddressBalance.tsx
+1
-4
No files found.
configs/app/features/getGasButton.ts
View file @
fdbf1dec
import
type
{
Feature
}
from
'
./types
'
;
import
type
{
Feature
}
from
'
./types
'
;
import
type
{
GasRefuelProviderConfig
}
from
'
types/client/gasRefuelProviderConfig
'
;
import
type
{
GasRefuelProviderConfig
}
from
'
types/client/gasRefuelProviderConfig
'
;
import
chain
from
'
../chain
'
;
import
{
getEnvValue
,
parseEnvJson
}
from
'
../utils
'
;
import
{
getEnvValue
,
parseEnvJson
}
from
'
../utils
'
;
import
marketplace
from
'
./marketplace
'
;
import
marketplace
from
'
./marketplace
'
;
...
@@ -11,7 +12,7 @@ const title = 'Get gas button';
...
@@ -11,7 +12,7 @@ const title = 'Get gas button';
const
config
:
Feature
<
{
const
config
:
Feature
<
{
name
:
string
;
name
:
string
;
logoUrl
?:
string
;
logoUrl
?:
string
;
url
Template
:
string
;
url
:
string
;
dappId
?:
string
;
dappId
?:
string
;
usdThreshold
:
number
;
usdThreshold
:
number
;
}
>
=
(()
=>
{
}
>
=
(()
=>
{
...
@@ -21,7 +22,7 @@ const config: Feature<{
...
@@ -21,7 +22,7 @@ const config: Feature<{
isEnabled
:
true
,
isEnabled
:
true
,
name
:
value
.
name
,
name
:
value
.
name
,
logoUrl
:
value
.
logo
,
logoUrl
:
value
.
logo
,
url
Template
:
value
.
url_template
,
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
||
1
,
usdThreshold
:
value
.
usd_threshold
||
1
,
});
});
...
...
ui/address/details/AddressBalance.tsx
View file @
fdbf1dec
...
@@ -21,8 +21,6 @@ import LinkInternal from 'ui/shared/links/LinkInternal';
...
@@ -21,8 +21,6 @@ import LinkInternal from 'ui/shared/links/LinkInternal';
import
NativeTokenIcon
from
'
ui/shared/NativeTokenIcon
'
;
import
NativeTokenIcon
from
'
ui/shared/NativeTokenIcon
'
;
import
TextSeparator
from
'
ui/shared/TextSeparator
'
;
import
TextSeparator
from
'
ui/shared/TextSeparator
'
;
const
TEMPLATE_CHAIN_ID
=
'
{chainId}
'
;
const
getGasFeature
=
config
.
features
.
getGasButton
;
const
getGasFeature
=
config
.
features
.
getGasButton
;
interface
Props
{
interface
Props
{
...
@@ -109,8 +107,7 @@ const AddressBalance = ({ data, isLoading }: Props) => {
...
@@ -109,8 +107,7 @@ const AddressBalance = ({ data, isLoading }: Props) => {
};
};
try
{
try
{
const
getGasUrlString
=
getGasFeature
.
urlTemplate
.
replace
(
TEMPLATE_CHAIN_ID
,
config
.
chain
.
id
||
''
);
const
getGasUrl
=
new
URL
(
getGasFeature
.
url
);
const
getGasUrl
=
new
URL
(
getGasUrlString
);
getGasUrl
.
searchParams
.
append
(
'
utm_source
'
,
'
blockscout
'
);
getGasUrl
.
searchParams
.
append
(
'
utm_source
'
,
'
blockscout
'
);
getGasUrl
.
searchParams
.
append
(
'
utm_medium
'
,
'
address
'
);
getGasUrl
.
searchParams
.
append
(
'
utm_medium
'
,
'
address
'
);
const
dappId
=
getGasFeature
.
dappId
;
const
dappId
=
getGasFeature
.
dappId
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment