From 7d12ab25fb347da36a48f10dde6f10cfac8dd03a Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 10 Oct 2022 19:50:41 +0530 Subject: [PATCH] fix opts --- .../src/lib/components/customButtonGroupAsArrows.tsx | 3 +-- .../home-tab/src/lib/components/homeTabGetStarted.tsx | 6 +++--- libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx | 8 ++++---- libs/remix-ws-templates/src/templates/ozerc1155/index.ts | 4 ++-- libs/remix-ws-templates/src/templates/ozerc20/index.ts | 4 ++-- libs/remix-ws-templates/src/templates/ozerc721/index.ts | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx index 7fabdbee12..09d624b6e0 100644 --- a/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/customButtonGroupAsArrows.tsx @@ -14,8 +14,7 @@ function CustomButtonGroupAsArrows ({ next, previous }) { - ) - } + ) } export default CustomButtonGroupAsArrows \ No newline at end of file diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index bf2dbd7f01..b64b70b11a 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -21,9 +21,9 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { const createWorkspace = async (templateName) => { await plugin.appManager.activatePlugin('filePanel') - const timeStump = Date.now - await plugin.call('filePanel', 'createWorkspace', templateName + "_" + timeStump, templateName) - await plugin.call('filePanel', 'setWorkspace', templateName + "_" + timeStump) + const timeStamp = Date.now() + await plugin.call('filePanel', 'createWorkspace', templateName + "_" + timeStamp, templateName) + await plugin.call('filePanel', 'setWorkspace', templateName + "_" + timeStamp) console.log("templateName ", templateName) plugin.verticalIcons.select('filePanel') _paq.push(['trackEvent', 'homeGetStarted', templateName]) diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index c675e3ad8e..3e37a98716 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -3,7 +3,6 @@ import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint import './remix-ui-home-tab.css' import { ThemeContext, themes } from './themeContext' import { RSSFeed } from './components/rssFeed' -import BasicLogo from 'libs/remix-ui/vertical-icons-panel/src/lib/components/BasicLogo' import HomeTabTitle from './components/homeTabTitle' import HomeTabFile from './components/homeTabFile' import HomeTabLearn from './components/homeTabLearn' @@ -70,10 +69,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => { } }, []) - - const maxHeight = Math.max(window.innerHeight - 150, 250) + 'px' - const elHeight = '4000px' return (
@@ -98,6 +94,10 @@ export default RemixUiHomeTab /* + + + const maxHeight = Math.max(window.innerHeight - 150, 250) + 'px' + const elHeight = '4000px'
diff --git a/libs/remix-ws-templates/src/templates/ozerc1155/index.ts b/libs/remix-ws-templates/src/templates/ozerc1155/index.ts index df6a349189..ce7313f0b1 100644 --- a/libs/remix-ws-templates/src/templates/ozerc1155/index.ts +++ b/libs/remix-ws-templates/src/templates/ozerc1155/index.ts @@ -8,7 +8,7 @@ export default async (opts) => { } const filesObj = { - 'contracts/MyToken.sol': erc1155.print({ ...erc1155.defaults, upgradeable: opts.upgradeable}), + 'contracts/MyToken.sol': erc1155.print({ ...erc1155.defaults, upgradeable: opts && opts.upgradeable ? opts.upgradeable : false}), // @ts-ignore 'scripts/deploy_with_ethers.ts': (await import('!!raw-loader!./scripts/deploy_with_ethers.ts')).default, // @ts-ignore @@ -21,6 +21,6 @@ export default async (opts) => { // If no options is selected, opts.upgradeable will be undefined // We do not show test file for upgradeable contract // @ts-ignore - if (opts.upgradeable === undefined || !opts.upgradeable) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default + if (!opts || opts.upgradeable === undefined || !opts.upgradeable) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default return filesObj } \ No newline at end of file diff --git a/libs/remix-ws-templates/src/templates/ozerc20/index.ts b/libs/remix-ws-templates/src/templates/ozerc20/index.ts index bf17c4ad60..6879620298 100644 --- a/libs/remix-ws-templates/src/templates/ozerc20/index.ts +++ b/libs/remix-ws-templates/src/templates/ozerc20/index.ts @@ -8,7 +8,7 @@ export default async (opts) => { } const filesObj = { - 'contracts/MyToken.sol': erc20.print({ ...erc20.defaults, upgradeable: opts.upgradeable}), + 'contracts/MyToken.sol': erc20.print({ ...erc20.defaults, upgradeable: opts && opts.upgradeable ? opts.upgradeable : false }), // @ts-ignore 'scripts/deploy_with_ethers.ts': (await import('!!raw-loader!./scripts/deploy_with_ethers.ts')).default, // @ts-ignore @@ -22,6 +22,6 @@ export default async (opts) => { // If no options is selected, opts.upgradeable will be undefined // We do not show test file for upgradeable contract // @ts-ignore - if (opts && (opts.upgradeable === undefined || !opts.upgradeable)) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default + if (!opts || opts.upgradeable === undefined || !opts.upgradeable) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default return filesObj } \ No newline at end of file diff --git a/libs/remix-ws-templates/src/templates/ozerc721/index.ts b/libs/remix-ws-templates/src/templates/ozerc721/index.ts index 12d4d2deb3..d7595e509b 100644 --- a/libs/remix-ws-templates/src/templates/ozerc721/index.ts +++ b/libs/remix-ws-templates/src/templates/ozerc721/index.ts @@ -8,7 +8,7 @@ export default async (opts) => { } const filesObj = { - 'contracts/MyToken.sol': erc721.print({ ...erc721.defaults, upgradeable: opts.upgradeable}), + 'contracts/MyToken.sol': erc721.print({ ...erc721.defaults, upgradeable: opts && opts.upgradeable ? opts.upgradeable : false }), // @ts-ignore 'scripts/deploy_with_ethers.ts': (await import('!!raw-loader!./scripts/deploy_with_ethers.ts')).default, // @ts-ignore @@ -22,6 +22,6 @@ export default async (opts) => { // If no options is selected, opts.upgradeable will be undefined // We do not show test file for upgradeable contract // @ts-ignore - if (opts.upgradeable === undefined || !opts.upgradeable) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default + if (!opts || opts.upgradeable === undefined || !opts.upgradeable) filesObj['tests/MyToken_test.sol'] = (await import('raw-loader!./tests/MyToken_test.sol')).default return filesObj } \ No newline at end of file