mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Linting fixups
This commit is contained in:
parent
93ee67eb01
commit
8b09f84502
@ -20,8 +20,10 @@ export default function UpdateNicknamePopover({
|
|||||||
}) {
|
}) {
|
||||||
const t = useContext(I18nContext);
|
const t = useContext(I18nContext);
|
||||||
|
|
||||||
const [nicknameInput, setNicknameInput] = useState(nickname === null ? "" : nickname);
|
const [nicknameInput, setNicknameInput] = useState(
|
||||||
const [memoInput, setMemoInput] = useState(memo === null ? "" : memo);
|
nickname === null ? '' : nickname,
|
||||||
|
);
|
||||||
|
const [memoInput, setMemoInput] = useState(memo === null ? '' : memo);
|
||||||
|
|
||||||
const handleNicknameChange = (event) => {
|
const handleNicknameChange = (event) => {
|
||||||
setNicknameInput(event.target.value);
|
setNicknameInput(event.target.value);
|
||||||
|
@ -85,26 +85,39 @@ const AssetOptions = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isntFunc = (p) => {
|
||||||
|
return typeof p !== 'function';
|
||||||
|
};
|
||||||
|
|
||||||
AssetOptions.propTypes = {
|
AssetOptions.propTypes = {
|
||||||
isEthNetwork: PropTypes.bool,
|
isEthNetwork: PropTypes.bool,
|
||||||
isNativeAsset: PropTypes.bool,
|
isNativeAsset: PropTypes.bool,
|
||||||
onClickBlockExplorer: PropTypes.func.isRequired,
|
onClickBlockExplorer: PropTypes.func.isRequired,
|
||||||
onViewAccountDetails: PropTypes.func.isRequired,
|
onViewAccountDetails: PropTypes.func.isRequired,
|
||||||
onRemove: (props, propName, componentName) => {
|
onRemove: (props) => {
|
||||||
if (props.isNativeAsset === false && typeof(props.onRemove) !== "function") {
|
if (props.isNativeAsset === false && isntFunc(props.onRemove)) {
|
||||||
throw new Error("When isNativeAsset is true, onRemove is a required prop");
|
throw new Error(
|
||||||
|
'When isNativeAsset is true, onRemove is a required prop',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onViewTokenDetails: (props, propName, componentName) => {
|
onViewTokenDetails: (props) => {
|
||||||
if (props.isNativeAsset === false && typeof(props.onViewTokenDetails) !== "function") {
|
if (props.isNativeAsset === false && isntFunc(props.onViewTokenDetails)) {
|
||||||
throw new Error("When isNativeAsset is true, onViewTokenDetails is a required prop");
|
throw new Error(
|
||||||
|
'When isNativeAsset is true, onViewTokenDetails is a required prop',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tokenSymbol: (props, propName, componentName) => {
|
tokenSymbol: (props) => {
|
||||||
if (props.isNativeAsset === false && typeof(props.tokenSymbol) !== "string") {
|
if (
|
||||||
throw new Error("When isNativeAsset is true, tokenSymbol is a required prop");
|
props.isNativeAsset === false &&
|
||||||
}
|
typeof props.tokenSymbol !== 'string'
|
||||||
|
) {
|
||||||
|
throw new Error(
|
||||||
|
'When isNativeAsset is true, tokenSymbol is a required prop',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AssetOptions;
|
export default AssetOptions;
|
||||||
|
@ -123,10 +123,13 @@ export default class Home extends PureComponent {
|
|||||||
showRecoveryPhraseReminder: PropTypes.bool.isRequired,
|
showRecoveryPhraseReminder: PropTypes.bool.isRequired,
|
||||||
setRecoveryPhraseReminderHasBeenShown: PropTypes.func.isRequired,
|
setRecoveryPhraseReminderHasBeenShown: PropTypes.func.isRequired,
|
||||||
setRecoveryPhraseReminderLastShown: PropTypes.func.isRequired,
|
setRecoveryPhraseReminderLastShown: PropTypes.func.isRequired,
|
||||||
seedPhraseBackedUp: (props, propName, componentName) => {
|
seedPhraseBackedUp: (props) => {
|
||||||
if (props.seedPhraseBackedUp !== null && typeof(props.seedPhraseBackedUp) !== "boolean") {
|
if (
|
||||||
|
props.seedPhraseBackedUp !== null &&
|
||||||
|
typeof props.seedPhraseBackedUp !== 'boolean'
|
||||||
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`seedPhraseBackedUp is required to be null or boolean. Received ${props.seedPhraseBackedUp}`
|
`seedPhraseBackedUp is required to be null or boolean. Received ${props.seedPhraseBackedUp}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user