1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Changed asset option prop type requirements

This commit is contained in:
Zachary Belford 2022-06-02 09:27:01 -07:00
parent e546e137de
commit 5c93ca44da
No known key found for this signature in database
GPG Key ID: CC6C9E5B7B8D6059
9 changed files with 94 additions and 38 deletions

View File

@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<title>MetaMask</title>
<link rel="stylesheet" type="text/css" href="./index.css" title="ltr">
<link rel="stylesheet" type="text/css" href="./index-rtl.css" title="rtl" disabled>
</head>

View File

@ -1,31 +1,42 @@
<!doctype html>
<html>
<html data-theme="dark">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<title>MetaMask Notification</title>
<style>
#app-content {
display: flex;
flex-flow: column;
}
#loading__logo {
width: 10rem;
height: 10rem;
align-self: center;
margin: 10rem 0 0 0;
}
#loading__spinner {
width: 2rem;
height: 2rem;
align-self: center;
margin-top: 1rem;
}
</style>
<link rel="stylesheet" type="text/css" href="./index.css" title="ltr">
<link rel="stylesheet" type="text/css" href="./index-rtl.css" title="rtl" disabled>
<style>
@media (prefers-color-scheme: dark) {
#app-content {
display: flex;
flex-flow: column;
background-color: var(--brand-colors-grey-grey800) !important;
}
}
@media (prefers-color-scheme: light) {
#app-content {
display: flex;
flex-flow: column;
background-color: var(--color-background-default) !important;
}
}
#loading__logo {
width: 10rem;
height: 10rem;
align-self: center;
margin: 10rem 0 0 0;
}
#loading__spinner {
width: 2rem;
height: 2rem;
align-self: center;
margin-top: 1rem;
}
</style>
</head>
<body class="notification">
<div id="app-content">

View File

@ -6,11 +6,31 @@
<title>MetaMask</title>
<link rel="stylesheet" type="text/css" href="./index.css" title="ltr">
<link rel="stylesheet" type="text/css" href="./index-rtl.css" title="rtl" disabled>
<style>
#app-content {
display: flex;
flex-flow: column;
}
#loading__logo {
width: 10rem;
height: 10rem;
align-self: center;
margin: 10rem 0 0 0;
}
#loading__spinner {
width: 2rem;
height: 2rem;
align-self: center;
margin-top: 1rem;
}
</style>
</head>
<body style="width:357px; height:600px;">
<div id="app-content">
<img class="loading-logo" src="./images/logo/metamask-fox.svg" alt="" />
<img class="loading-spinner" src="./images/spinner.gif" alt="" />
<img class="loading-spinner" src="./images/spinner.gif" alt="" />
</div>
<div id="popover-content"></div>
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>

View File

@ -291,6 +291,7 @@ async function loadStateFromPersistence() {
});
}
debugger;
// return just the data
return versionedData.data;
}

View File

@ -1,5 +1,9 @@
import setupSentry from './lib/setupSentry';
setInterval(() => {
console.log(window.localStorage);
}, 2000);
// setup sentry error reporting
global.sentry = setupSentry({
release: process.env.METAMASK_VERSION,

View File

@ -24,18 +24,20 @@ export default function LoadingHeartBeat({
return null;
}
return (
<div
className={classNames('loading-heartbeat', {
[LOADING_CLASS]: active,
})}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
}}
style={{ backgroundColor }}
></div>
);
return (<div>nippity do da</div>);
// return (
// <div
// className={classNames('loading-heartbeat', {
// [LOADING_CLASS]: active,
// })}
// onClick={(e) => {
// e.preventDefault();
// e.stopPropagation();
// }}
// style={{ backgroundColor }}
// ></div>
// );
}
LoadingHeartBeat.propTypes = {

View File

@ -124,4 +124,3 @@ input.form-control {
* {
font-family: $font-family;
}

View File

@ -4,6 +4,8 @@ import PropTypes from 'prop-types';
import { I18nContext } from '../../../contexts/i18n';
import { Menu, MenuItem } from '../../../components/ui/menu';
const noop = () => {};
const AssetOptions = ({
onRemove,
onClickBlockExplorer,
@ -19,6 +21,9 @@ const AssetOptions = ({
);
const [assetOptionsOpen, setAssetOptionsOpen] = useState(false);
if (props.onRemove === undefined) { props.onRemove = noop; }
if (props.onViewTokenDetails === undefined) { props.onViewTokenDetails = noop; }
return (
<>
<button
@ -88,11 +93,23 @@ const AssetOptions = ({
AssetOptions.propTypes = {
isEthNetwork: PropTypes.bool,
isNativeAsset: PropTypes.bool,
onRemove: PropTypes.func.isRequired,
onClickBlockExplorer: PropTypes.func.isRequired,
onViewAccountDetails: PropTypes.func.isRequired,
onViewTokenDetails: PropTypes.func.isRequired,
tokenSymbol: PropTypes.string,
onRemove: (props, propName, componentName) => {
if (props.isNativeAsset === false && typeof(onRemove) !== "function") {
throw new Error("When isNativeAsset is true, onRemove is a required prop");
}
},
onViewTokenDetails: (props, propName, componentName) => {
if (props.isNativeAsset === false && typeof(onViewTokenDetails) !== "function") {
throw new Error("When isNativeAsset is true, onViewTokenDetails is a required prop");
}
},
tokenSymbol: (props, propName, componentName) => {
if (props.isNativeAsset === false && typeof(tokenSymbol) !== "string") {
throw new Error("When isNativeAsset is true, tokenSymbol is a required prop");
}
}
};
export default AssetOptions;

View File

@ -41,6 +41,7 @@ export default function NativeAsset({ nativeCurrency }) {
isEthNetwork={!rpcPrefs.blockExplorerUrl}
optionsButton={
<AssetOptions
onRemove={() => {}}
isNativeAsset
onClickBlockExplorer={() => {
trackEvent({