Skip to content

Commit 9766414

Browse files
committed
fix: resolve quality gate warnings
1 parent 69bd66a commit 9766414

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/components/header.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from "react";
33
import { ReactComponent as Brand } from "../assets/images/logo-dispute-resolver-white.svg";
44
import { LinkContainer } from "react-router-bootstrap";
55
import SmartContractWalletWarning from "./smartContractWalletWarning";
6+
import PropTypes from "prop-types";
67

78
class Header extends React.Component {
89
render() {
@@ -49,3 +50,10 @@ class Header extends React.Component {
4950
}
5051

5152
export default Header;
53+
54+
Header.propTypes = {
55+
viewOnly: PropTypes.bool.isRequired,
56+
route: PropTypes.object.isRequired,
57+
activeAddress: PropTypes.string.isRequired,
58+
web3Provider: PropTypes.object.isRequired,
59+
};

src/components/smartContractWalletWarning.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import { Alert } from "antd";
4+
import PropTypes from "prop-types";
45

56
const StyledAlert = styled(Alert)`
67
text-align: center;
@@ -58,6 +59,7 @@ export default class SmartContractWalletWarning extends React.Component {
5859
const code = await web3Provider.getCode(activeAddress);
5960
this.setState({ isSmartContractWallet: code !== "0x" });
6061
} catch (error) {
62+
console.error("Error getting code at wallet address", error);
6163
this.setState({ isSmartContractWallet: false });
6264
}
6365
};
@@ -69,7 +71,7 @@ export default class SmartContractWalletWarning extends React.Component {
6971

7072
render() {
7173
const { isSmartContractWallet, showWarning } = this.state;
72-
74+
7375
if (!showWarning || !isSmartContractWallet) {
7476
return null;
7577
}
@@ -97,3 +99,8 @@ export default class SmartContractWalletWarning extends React.Component {
9799
);
98100
}
99101
}
102+
103+
SmartContractWalletWarning.propTypes = {
104+
activeAddress: PropTypes.string.isRequired,
105+
web3Provider: PropTypes.object.isRequired,
106+
};

0 commit comments

Comments
 (0)