Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
add transaction confirm fields for filecoin
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Feb 24, 2022
1 parent 6467a2b commit 2e0cd4e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/renderer/families/filecoin/TransactionConfirmFields.js
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,
};

0 comments on commit 2e0cd4e

Please sign in to comment.