diff --git a/.gitignore b/.gitignore index db1d4a1cc7..5456fc601e 100644 --- a/.gitignore +++ b/.gitignore @@ -128,4 +128,5 @@ ui-lib/lib ui-lib/storybook-static/* # IDE -.vscode/* \ No newline at end of file +.vscode/* +.idea \ No newline at end of file diff --git a/src/live-common-set-supported-currencies.js b/src/live-common-set-supported-currencies.js index 3834e8b964..ee0552f08f 100644 --- a/src/live-common-set-supported-currencies.js +++ b/src/live-common-set-supported-currencies.js @@ -41,4 +41,5 @@ setSupportedCurrencies([ "ethereum_ropsten", "ethereum_goerli", "cosmos_testnet", + "filecoin", ]); diff --git a/src/renderer/drawers/OperationDetails/index.js b/src/renderer/drawers/OperationDetails/index.js index 2d5069c9d5..dee5a82453 100644 --- a/src/renderer/drawers/OperationDetails/index.js +++ b/src/renderer/drawers/OperationDetails/index.js @@ -641,16 +641,19 @@ type OperationDetailsExtraProps = { }; const OperationDetailsExtra = ({ extra }: OperationDetailsExtraProps) => { - return Object.entries(extra).map(([key, value]) => ( - - - - - - {value} - - - )); + return Object.entries(extra).map(([key, value]) => { + if( typeof value == "object" || typeof value == "function") return null; + return ( + + + + + + {value} + + + ); + }); }; const More = styled(Text).attrs(p => ({ diff --git a/src/renderer/families/filecoin/TransactionConfirmFields.js b/src/renderer/families/filecoin/TransactionConfirmFields.js new file mode 100644 index 0000000000..345fee0db6 --- /dev/null +++ b/src/renderer/families/filecoin/TransactionConfirmFields.js @@ -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 ( + + + {field.value} + + + ); +}; + +const fieldComponents = { + "filecoin.gasFeeCap": FilecoinField, + "filecoin.gasPremium": FilecoinField, + "filecoin.gasLimit": FilecoinField, + "filecoin.method": FilecoinField, +}; + +export default { + fieldComponents, +};