kopia lustrzana https://github.com/bugout-dev/moonstream
Cleaning up unused code.
rodzic
d7b3b2065b
commit
4468c56e11
|
@ -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 />
|
||||
|
||||
<span className="hljs-keyword">{"let"}</span> {"userAddress ="}{" "}
|
||||
<span className="hljs-built_in">{"window"}</span>
|
||||
{".ethereum.selectedAddress;"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"let"}</span> activeOpening ={" "}
|
||||
<span className="hljs-keyword">{"await"}</span>{" "}
|
||||
{"checkUsersActiveLootboxOpeningStatus(userAddress);"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"if"}</span> (activeOpening !={" "}
|
||||
<span className="hljs-literal">null</span>
|
||||
{") {"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-built_in">{"console"}</span>
|
||||
{".log"}(
|
||||
<span className="hljs-string">
|
||||
"User already has active opening"
|
||||
</span>
|
||||
{");"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"return"}</span>; <br />
|
||||
|
||||
{"}"}
|
||||
<br />
|
||||
|
||||
<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 />
|
||||
|
||||
<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 />
|
||||
|
||||
<span className="hljs-keyword">{"let"}</span> {"userAddress ="}{" "}
|
||||
<span className="hljs-built_in">{"window"}</span>
|
||||
{".ethereum.selectedAddress;"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"let"}</span> activeOpening ={" "}
|
||||
<span className="hljs-keyword">{"await"}</span>{" "}
|
||||
{"checkUsersActiveLootboxOpeningStatus(userAddress);"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"if"}</span> (activeOpening !={" "}
|
||||
<span className="hljs-literal">null</span>
|
||||
{") {"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-built_in">{"console"}</span>
|
||||
{".log"}(
|
||||
<span className="hljs-string">
|
||||
"User already has active opening"
|
||||
</span>
|
||||
{");"}
|
||||
<br />
|
||||
|
||||
<span className="hljs-keyword">{"return"}</span>; <br />
|
||||
|
||||
{"}"}
|
||||
<br />
|
||||
|
||||
<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 />
|
||||
|
||||
<span className="hljs-keyword">await</span>{" "}
|
||||
openOrdinaryLootbox(lootboxId, count);
|
||||
<br />
|
||||
{"}"}
|
||||
</code>
|
||||
</pre>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Ładowanie…
Reference in New Issue