This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add transaction confirm fields for filecoin
- Loading branch information
1 parent
6467a2b
commit 2e0cd4e
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/renderer/families/filecoin/TransactionConfirmFields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// @flow | ||
|
||
import invariant from "invariant"; | ||
import React from "react"; | ||
import TransactionConfirmField from "~/renderer/components/TransactionConfirm/TransactionConfirmField"; | ||
import Text from "~/renderer/components/Text"; | ||
import { DeviceTransactionField } from "@ledgerhq/live-common/lib/transaction"; | ||
|
||
|
||
const addressStyle = { | ||
wordBreak: "break-all", | ||
textAlign: "right", | ||
maxWidth: "70%", | ||
}; | ||
|
||
const FilecoinField = ({ transaction, field }: { transaction: Transaction, field: DeviceTransactionField }) => { | ||
invariant(transaction.family === "filecoin", "filecoin transaction"); | ||
|
||
return ( | ||
<TransactionConfirmField label={field.label}> | ||
<Text style={addressStyle} ml={1} ff="Inter|Medium" color="palette.text.shade80" fontSize={3}> | ||
{field.value} | ||
</Text> | ||
</TransactionConfirmField> | ||
); | ||
}; | ||
|
||
const fieldComponents = { | ||
"filecoin.gasFeeCap": FilecoinField, | ||
"filecoin.gasPremium": FilecoinField, | ||
"filecoin.gasLimit": FilecoinField, | ||
"filecoin.method": FilecoinField, | ||
}; | ||
|
||
export default { | ||
fieldComponents, | ||
}; |