Cleaning up unused code.

pull/638/head
Kellan Wampler 2022-07-14 09:30:40 -04:00
rodzic d7b3b2065b
commit 4468c56e11
2 zmienionych plików z 54 dodań i 74 usunięć

Wyświetl plik

@ -19,82 +19,63 @@ const ExampleCode = () => {
disableForced4SpacesIndentedSublists: true,
ghCodeBlocks: true,
});
const code = `
\`\`\`js
async function startRandomLootboxOpening(lootboxId) {
let userAddress = window.ethereum.selectedAddress;
\tlet activeOpening = await checkUsersActiveLootboxOpeningStatus(userAddress);
if (activeOpening != null) {
console.log("User already has active opening");
return;
}
const count = 1; // you can open only 1 random lootbox at a time
await openOrdinaryLootbox(lootboxId, count);
}
\`\`\`
`;
let formattedCode = converter.makeHtml(code);
console.log(formattedCode);
const HtmlCode = () => {
return (
<>
<pre className="js language-js">
<code className="hljs js language-js">
<span className="hljs-keyword">{"async"}</span>{" "}
<span className="hljs-function">
<span className="hljs-keyword">function</span>{" "}
<span className="hljs-title">startRandomLootboxOpening</span>
{"("}
<span className="hljs-params">lootboxId</span>
{")"}{" "}
</span>
{"{"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"let"}</span> {"userAddress ="}{" "}
<span className="hljs-built_in">{"window"}</span>
{".ethereum.selectedAddress;"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"let"}</span> activeOpening ={" "}
<span className="hljs-keyword">{"await"}</span>{" "}
{"checkUsersActiveLootboxOpeningStatus(userAddress);"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"if"}</span> (activeOpening !={" "}
<span className="hljs-literal">null</span>
{") {"}
<br />
&nbsp; &nbsp; &nbsp; &nbsp;
<span className="hljs-built_in">{"console"}</span>
{".log"}(
<span className="hljs-string">
&quot;User already has active opening&quot;
</span>
{");"}
<br />
&nbsp; &nbsp; &nbsp; &nbsp;
<span className="hljs-keyword">{"return"}</span>; <br />
&nbsp; &nbsp;
{"}"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">const</span> count ={" "}
<span className="hljs-number">1</span>;{" "}
<span className="hljs-comment">
{"// you can open only 1 random lootbox at a time"}
</span>
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">await</span>{" "}
openOrdinaryLootbox(lootboxId, count);
<br />
{"}"}
</code>
</pre>
</>
<pre className="js language-js">
<code className="hljs js language-js">
<span className="hljs-keyword">{"async"}</span>{" "}
<span className="hljs-function">
<span className="hljs-keyword">function</span>{" "}
<span className="hljs-title">startRandomLootboxOpening</span>
{"("}
<span className="hljs-params">lootboxId</span>
{")"}{" "}
</span>
{"{"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"let"}</span> {"userAddress ="}{" "}
<span className="hljs-built_in">{"window"}</span>
{".ethereum.selectedAddress;"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"let"}</span> activeOpening ={" "}
<span className="hljs-keyword">{"await"}</span>{" "}
{"checkUsersActiveLootboxOpeningStatus(userAddress);"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">{"if"}</span> (activeOpening !={" "}
<span className="hljs-literal">null</span>
{") {"}
<br />
&nbsp; &nbsp; &nbsp; &nbsp;
<span className="hljs-built_in">{"console"}</span>
{".log"}(
<span className="hljs-string">
&quot;User already has active opening&quot;
</span>
{");"}
<br />
&nbsp; &nbsp; &nbsp; &nbsp;
<span className="hljs-keyword">{"return"}</span>; <br />
&nbsp; &nbsp;
{"}"}
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">const</span> count ={" "}
<span className="hljs-number">1</span>;{" "}
<span className="hljs-comment">
{"// you can open only 1 random lootbox at a time"}
</span>
<br />
&nbsp; &nbsp;
<span className="hljs-keyword">await</span>{" "}
openOrdinaryLootbox(lootboxId, count);
<br />
{"}"}
</code>
</pre>
);
};

Wyświetl plik

@ -10,7 +10,6 @@ export const MODAL_TYPES = {
UPLOAD_ABI: 8,
NEW_DASHBOARD_FLOW: 9,
MOBILE_INPUT_FIELD: 10,
EXAMPLE_CODE: 11,
};
export const DRAWER_TYPES = {