1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Changed update nickname popover to remove proptype errors

This commit is contained in:
Zachary Belford 2022-06-02 11:05:41 -07:00
parent 3665c3718d
commit 29d87343fa
No known key found for this signature in database
GPG Key ID: CC6C9E5B7B8D6059
4 changed files with 6 additions and 9 deletions

View File

@ -124,12 +124,12 @@ AdvancedGasControls.propTypes = {
gasEstimateType: PropTypes.oneOf(Object.values(GAS_ESTIMATE_TYPES)), gasEstimateType: PropTypes.oneOf(Object.values(GAS_ESTIMATE_TYPES)),
setMaxPriorityFee: PropTypes.func, setMaxPriorityFee: PropTypes.func,
setMaxFee: PropTypes.func, setMaxFee: PropTypes.func,
maxPriorityFee: PropTypes.number, maxPriorityFee: PropTypes.string,
maxFee: PropTypes.number, maxFee: PropTypes.string,
onManualChange: PropTypes.func, onManualChange: PropTypes.func,
gasLimit: PropTypes.number, gasLimit: PropTypes.number,
setGasLimit: PropTypes.func, setGasLimit: PropTypes.func,
gasPrice: PropTypes.number, gasPrice: PropTypes.string,
setGasPrice: PropTypes.func, setGasPrice: PropTypes.func,
maxPriorityFeeFiat: PropTypes.string, maxPriorityFeeFiat: PropTypes.string,
maxFeeFiat: PropTypes.string, maxFeeFiat: PropTypes.string,

View File

@ -43,7 +43,7 @@ const NicknamePopovers = ({ address, onClose }) => {
<UpdateNicknamePopover <UpdateNicknamePopover
address={address} address={address}
nickname={recipientNickname || null} nickname={recipientNickname || null}
memo={addressBookEntryObject?.memo} memo={addressBookEntryObject?.memo || null}
onClose={() => setPopoverToDisplay(SHOW_NICKNAME_POPOVER)} onClose={() => setPopoverToDisplay(SHOW_NICKNAME_POPOVER)}
onAdd={(recipient, nickname, memo) => onAdd={(recipient, nickname, memo) =>
dispatch(addToAddressBook(recipient, nickname, memo)) dispatch(addToAddressBook(recipient, nickname, memo))

View File

@ -20,8 +20,8 @@ export default function UpdateNicknamePopover({
}) { }) {
const t = useContext(I18nContext); const t = useContext(I18nContext);
const [nicknameInput, setNicknameInput] = useState(nickname); const [nicknameInput, setNicknameInput] = useState(nickname === null ? "" : nickname);
const [memoInput, setMemoInput] = useState(memo); const [memoInput, setMemoInput] = useState(memo === null ? "" : memo);
const handleNicknameChange = (event) => { const handleNicknameChange = (event) => {
setNicknameInput(event.target.value); setNicknameInput(event.target.value);

View File

@ -21,9 +21,6 @@ const AssetOptions = ({
); );
const [assetOptionsOpen, setAssetOptionsOpen] = useState(false); const [assetOptionsOpen, setAssetOptionsOpen] = useState(false);
if (props.onRemove === undefined) { props.onRemove = noop; }
if (props.onViewTokenDetails === undefined) { props.onViewTokenDetails = noop; }
return ( return (
<> <>
<button <button