Skip to content

Commit

Permalink
gas fee in activity popup
Browse files Browse the repository at this point in the history
Co-authored-by: MarkNerdi996 <[email protected]>
  • Loading branch information
nicole-obrien and MarkNerdi996 committed Aug 30, 2023
1 parent 9ff24f9 commit 27656df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
export let activity: Activity
$: expirationTime = getFormattedTimeStamp(activity?.asyncData?.expirationDate)
$: claimedTime = getFormattedTimeStamp(activity?.asyncData?.claimedDate)
$: hasStorageDeposit =
activity?.storageDeposit || (activity?.storageDeposit === 0 && activity?.giftedStorageDeposit === 0)
$: gasLimit = activity?.parsedLayer2Metadata?.gasLimit
$: expirationTime = activity?.asyncData?.expirationDate
? getFormattedTimeStamp(activity?.asyncData?.expirationDate)
: undefined
$: claimedTime = activity?.asyncData?.claimedDate
? getFormattedTimeStamp(activity?.asyncData?.claimedDate)
: undefined
$: hasStorageDeposit = activity?.storageDeposit
$: gasFee = activity?.parsedLayer2Metadata?.gasLimit || activity?.gasUsed
$: formattedTransactionTime = getFormattedTimeStamp(activity.time)
$: formattedTimelockDate = activity.asyncData ? getFormattedTimeStamp(activity.asyncData?.timelockDate) : undefined
$: formattedStorageDeposit = formatTokenAmountPrecise(activity.storageDeposit ?? 0, getBaseToken())
$: formattedGasLimit = formatTokenAmountPrecise(Number(gasLimit ?? 0), getBaseToken())
$: formattedGasUsed = formatTokenAmountPrecise(Number(activity.gasUsed ?? 0), getBaseToken())
$: formattedGasFee = formatTokenAmountPrecise(Number(gasFee ?? 0), getBaseToken())
let items: IItem[] = []
Expand Down Expand Up @@ -59,17 +61,10 @@
tooltip: localize(`tooltips.transactionDetails.${_activity?.direction}.storageDeposit`),
})
}
if (_activity?.gasUsed) {
if (gasFee) {
items.push({
key: localize('general.gasUsed'),
value: formattedGasUsed,
})
}
if (gasLimit) {
items.push({
key: localize('general.gasLimit'),
value: formattedGasLimit,
tooltip: localize(`tooltips.transactionDetails.${_activity?.direction}.gasLimit`),
key: localize('general.gasFee'),
value: formattedGasFee,
})
}
if (expirationTime) {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@
"transactionTime": "Transaction time",
"surplus": "Surplus",
"storageDeposit": "Storage deposit",
"gasUsed": "Gas used",
"gasFee": "Gas fee",
"giftedStorageDeposit": "Gifted storage deposit",
"storageDepositPerNft": "Storage deposit per NFT",
"totalStorageDeposit": "Total storage deposit",
Expand Down

0 comments on commit 27656df

Please sign in to comment.