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
c41fef88
Unverified
Commit
c41fef88
authored
Aug 01, 2023
by
Igor Stuev
Committed by
GitHub
Aug 01, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1051 from blockscout/withdrawals-curr
beacon network currency symbol
parents
6a2ec0e0
db17f615
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
5 deletions
+19
-5
.env.template
.env.template
+1
-0
config.ts
configs/app/config.ts
+1
-0
ENVS.md
docs/ENVS.md
+1
-0
envs.ts
types/envs.ts
+12
-2
Withdrawals.tsx
ui/pages/Withdrawals.tsx
+2
-1
WithdrawalsListItem.tsx
ui/withdrawals/WithdrawalsListItem.tsx
+1
-1
WithdrawalsTable.tsx
ui/withdrawals/WithdrawalsTable.tsx
+1
-1
No files found.
.env.template
View file @
c41fef88
...
...
@@ -77,3 +77,4 @@ NEXT_PUBLIC_L2_WITHDRAWAL_URL=__PLACEHOLDER_FOR_NEXT_PUBLIC_L2_WITHDRAWAL_URL__
# beacon chain config
NEXT_PUBLIC_HAS_BEACON_CHAIN=__PLACEHOLDER_FOR_NEXT_PUBLIC_HAS_BEACON_CHAIN__
NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL=__PLACEHOLDER_FOR_NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL__
configs/app/config.ts
View file @
c41fef88
...
...
@@ -161,6 +161,7 @@ const config = Object.freeze({
},
beaconChain
:
{
hasBeaconChain
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_HAS_BEACON_CHAIN
)
===
'
true
'
,
currencySymbol
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL
)
||
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL
),
},
statsApi
:
{
endpoint
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_STATS_API_HOST
),
...
...
docs/ENVS.md
View file @
c41fef88
...
...
@@ -170,3 +170,4 @@ In order to enable "My Account" feature you have to configure following set of v
| Variable | Type| Description | Is required | Default value | Example value |
| --- | --- | --- | --- | --- | --- |
| NEXT_PUBLIC_HAS_BEACON_CHAIN |
`boolean`
| Set to true for networks with the beacon chain | - | - |
`true`
|
| NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL |
`string`
| Beacon network currency symbol | - | NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL |
`ETH`
|
types/envs.ts
View file @
c41fef88
...
...
@@ -16,7 +16,6 @@ export type NextPublicEnvs = {
NEXT_PUBLIC_NETWORK_EXPLORERS
?:
string
;
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE
?:
'
validation
'
|
'
mining
'
;
NEXT_PUBLIC_IS_TESTNET
?:
'
true
'
|
''
;
NEXT_PUBLIC_HAS_BEACON_CHAIN
?:
'
true
'
|
''
;
// UI config
NEXT_PUBLIC_FEATURED_NETWORKS
?:
string
;
...
...
@@ -73,7 +72,8 @@ export type NextPublicEnvs = {
}
&
NextPublicEnvsAccount
&
NextPublicEnvsMarketplace
&
NextPublicEnvsRollup
;
&
NextPublicEnvsRollup
&
NextPublicEnvsBeacon
;
type
NextPublicEnvsAccount
=
{
...
...
@@ -110,3 +110,13 @@ type NextPublicEnvsRollup =
NEXT_PUBLIC_L1_BASE_URL
?:
undefined
;
NEXT_PUBLIC_L2_WITHDRAWAL_URL
?:
undefined
;
}
type
NextPublicEnvsBeacon
=
{
NEXT_PUBLIC_HAS_BEACON_CHAIN
:
'
true
'
;
NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL
?:
string
;
}
|
{
NEXT_PUBLIC_HAS_BEACON_CHAIN
?:
undefined
;
NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL
?:
undefined
;
}
ui/pages/Withdrawals.tsx
View file @
c41fef88
...
...
@@ -2,6 +2,7 @@ import { Flex, Hide, Show, Skeleton, Text } from '@chakra-ui/react';
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
...
...
@@ -67,7 +68,7 @@ const Withdrawals = () => {
const
{
valueStr
}
=
getCurrencyValue
({
value
:
countersQuery
.
data
.
withdrawal_sum
});
return
(
<
Text
mb=
{
{
base
:
6
,
lg
:
pagination
.
isVisible
?
0
:
6
}
}
lineHeight=
{
{
base
:
'
24px
'
,
lg
:
'
32px
'
}
}
>
{
BigNumber
(
countersQuery
.
data
.
withdrawal_count
).
toFormat
()
}
withdrawals processed and
{
valueStr
}
ETH
withdrawn
{
BigNumber
(
countersQuery
.
data
.
withdrawal_count
).
toFormat
()
}
withdrawals processed and
{
valueStr
}
{
appConfig
.
beaconChain
.
currencySymbol
}
withdrawn
</
Text
>
);
})();
...
...
ui/withdrawals/WithdrawalsListItem.tsx
View file @
c41fef88
...
...
@@ -85,7 +85,7 @@ const WithdrawalsListItem = ({ item, isLoading, view }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Value
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
CurrencyValue
value=
{
item
.
amount
}
currency=
{
appConfig
.
network
.
currency
.
s
ymbol
}
isLoading=
{
isLoading
}
/>
<
CurrencyValue
value=
{
item
.
amount
}
currency=
{
appConfig
.
beaconChain
.
currencyS
ymbol
}
isLoading=
{
isLoading
}
/>
</
ListItemMobileGrid
.
Value
>
</>
)
}
...
...
ui/withdrawals/WithdrawalsTable.tsx
View file @
c41fef88
...
...
@@ -34,7 +34,7 @@ const WithdrawalsTable = ({ items, isLoading, top, view = 'list' }: Props) => {
{
view
!==
'
block
'
&&
<
Th
w=
"25%"
>
Block
</
Th
>
}
{
view
!==
'
address
'
&&
<
Th
w=
"25%"
>
To
</
Th
>
}
{
view
!==
'
block
'
&&
<
Th
w=
"25%"
>
Age
</
Th
>
}
<
Th
w=
"25%"
>
{
`Value ${ appConfig.
network.currency.s
ymbol }`
}
</
Th
>
<
Th
w=
"25%"
>
{
`Value ${ appConfig.
beaconChain.currencyS
ymbol }`
}
</
Th
>
</
Tr
>
</
Thead
>
<
Tbody
>
...
...
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