From 1580731d31da2501e58fb7197efd5f6a0cbf2b45 Mon Sep 17 00:00:00 2001 From: drafish Date: Tue, 22 Oct 2024 10:46:46 +0800 Subject: [PATCH 01/22] optional logo in quick-dapp --- apps/quick-dapp/src/actions/index.ts | 9 ++++++--- apps/remix-dapp/src/assets/instance.json | 1 + apps/remix-dapp/src/components/DappTop/index.tsx | 2 +- apps/remix-dapp/src/components/Home/mobile.tsx | 4 ++-- apps/remix-dapp/src/components/Home/pc.tsx | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/quick-dapp/src/actions/index.ts b/apps/quick-dapp/src/actions/index.ts index fbcda6ac4d..e395016fef 100644 --- a/apps/quick-dapp/src/actions/index.ts +++ b/apps/quick-dapp/src/actions/index.ts @@ -171,6 +171,7 @@ export const deploy = async (payload: any, callback: any) => { ...instance, shortname: payload.shortname, shareTo: payload.shareTo, + showLogo: !!logo, }) const files: Record = { @@ -192,7 +193,9 @@ export const deploy = async (payload: any, callback: any) => { files[`dir/${path}`] = resp.data; } - files['dir/assets/logo.png'] = logo + if (logo) { + files['dir/assets/logo.png'] = logo + } files['dir/CORS'] = '*' files['dir/index.html'] = files['dir/index.html'].replace( 'assets/css/themes/remix-dark_tvx1s2.css', @@ -341,7 +344,7 @@ export const initInstance = async ({ } : { A: ids }; - const logo = await axios.get('https://dev.remix-dapp.pages.dev/logo.png', { responseType: 'arraybuffer' }) + // const logo = await axios.get('https://dev.remix-dapp.pages.dev/logo.png', { responseType: 'arraybuffer' }) await dispatch({ type: 'SET_INSTANCE', @@ -353,7 +356,7 @@ export const initInstance = async ({ natSpec, solcVersion: getVersion(solcVersion), ...lowLevel, - logo: logo.data, + // logo: logo.data, }, }); }; diff --git a/apps/remix-dapp/src/assets/instance.json b/apps/remix-dapp/src/assets/instance.json index 99490e7383..1a00a48bed 100644 --- a/apps/remix-dapp/src/assets/instance.json +++ b/apps/remix-dapp/src/assets/instance.json @@ -492,6 +492,7 @@ ], "noTerminal": false, "verified": true, + "showLogo": true, "solcVersion": { "version": "0.8.26", "canReceive": true diff --git a/apps/remix-dapp/src/components/DappTop/index.tsx b/apps/remix-dapp/src/components/DappTop/index.tsx index 672c1c4e82..4fbdd61f2e 100644 --- a/apps/remix-dapp/src/components/DappTop/index.tsx +++ b/apps/remix-dapp/src/components/DappTop/index.tsx @@ -30,7 +30,7 @@ const DappTop: React.FC = () => { const shareTitle = encodeURIComponent('Hello everyone, this is my dapp!'); return ( -
+
{title &&

{title}

} {details && {details}} diff --git a/apps/remix-dapp/src/components/Home/mobile.tsx b/apps/remix-dapp/src/components/Home/mobile.tsx index 96e569c78a..7d099cf52f 100644 --- a/apps/remix-dapp/src/components/Home/mobile.tsx +++ b/apps/remix-dapp/src/components/Home/mobile.tsx @@ -18,9 +18,9 @@ const MobilePage: React.FC = () => { } col-xl-9 col-lg-8 col-md-7 pr-0`} >
-
+ {instance.showLogo &&
-
+
}
diff --git a/apps/remix-dapp/src/components/Home/pc.tsx b/apps/remix-dapp/src/components/Home/pc.tsx index 0cb31f3d02..d5f2425a77 100644 --- a/apps/remix-dapp/src/components/Home/pc.tsx +++ b/apps/remix-dapp/src/components/Home/pc.tsx @@ -24,9 +24,9 @@ const PCPage: React.FC = () => { >
-
+ {instance.showLogo &&
-
+
}
From 5b3421bf6fc4661b46612300bf44f30495b9c09e Mon Sep 17 00:00:00 2001 From: drafish Date: Tue, 22 Oct 2024 13:40:30 +0800 Subject: [PATCH 02/22] add delete logo button in quick-dapp --- .../src/components/ImageUpload/index.tsx | 53 +++++++++++++++---- .../src/components/DappTop/index.tsx | 2 +- .../src/app/tabs/locales/en/quickDapp.json | 4 +- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/apps/quick-dapp/src/components/ImageUpload/index.tsx b/apps/quick-dapp/src/components/ImageUpload/index.tsx index 74deb54a74..f4a2a20f29 100644 --- a/apps/quick-dapp/src/components/ImageUpload/index.tsx +++ b/apps/quick-dapp/src/components/ImageUpload/index.tsx @@ -31,18 +31,49 @@ const ImageUpload = () => { return (
- - + + )} +
) } diff --git a/apps/remix-dapp/src/components/DappTop/index.tsx b/apps/remix-dapp/src/components/DappTop/index.tsx index 4fbdd61f2e..1838e65361 100644 --- a/apps/remix-dapp/src/components/DappTop/index.tsx +++ b/apps/remix-dapp/src/components/DappTop/index.tsx @@ -30,7 +30,7 @@ const DappTop: React.FC = () => { const shareTitle = encodeURIComponent('Hello everyone, this is my dapp!'); return ( -
+
{title &&

{title}

} {details && {details}} diff --git a/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json b/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json index 1a7164f261..78e32b6b34 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json @@ -32,7 +32,9 @@ "quickDapp.text4": "Deployed successfully!", "quickDapp.text5": "Click the link below to view your dapp", "quickDapp.text6": "Teardown successfully!", - "quickDapp.uploadLogoTooltip": "Click here to change logo", + "quickDapp.addLogoTooltip": "Click here to add a logo", + "quickDapp.updateLogoTooltip": "Click here to update the logo", + "quickDapp.deleteLogoTooltip": "Click here to delete the logo", "quickDapp.dappTitle": "Dapp Title", "quickDapp.dappInstructions": "Dapp Instructions", "quickDapp.functionTitle": "Title of function", From 02e3711f44b23d842c030d1114a23cccac65666a Mon Sep 17 00:00:00 2001 From: drafish Date: Fri, 1 Nov 2024 14:03:20 +0800 Subject: [PATCH 03/22] update ImageUpload in quick-dapp --- .../src/components/ImageUpload/index.tsx | 76 +++++++++---------- .../src/app/tabs/locales/en/quickDapp.json | 1 - 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/apps/quick-dapp/src/components/ImageUpload/index.tsx b/apps/quick-dapp/src/components/ImageUpload/index.tsx index f4a2a20f29..09fbd9baf5 100644 --- a/apps/quick-dapp/src/components/ImageUpload/index.tsx +++ b/apps/quick-dapp/src/components/ImageUpload/index.tsx @@ -29,51 +29,47 @@ const ImageUpload = () => { } return ( -
+
-
) } diff --git a/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json b/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json index 78e32b6b34..a25ad3bd73 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/quickDapp.json @@ -33,7 +33,6 @@ "quickDapp.text5": "Click the link below to view your dapp", "quickDapp.text6": "Teardown successfully!", "quickDapp.addLogoTooltip": "Click here to add a logo", - "quickDapp.updateLogoTooltip": "Click here to update the logo", "quickDapp.deleteLogoTooltip": "Click here to delete the logo", "quickDapp.dappTitle": "Dapp Title", "quickDapp.dappInstructions": "Dapp Instructions", From e148ece8772a173bc3bfc34c3cead3480aa37e20 Mon Sep 17 00:00:00 2001 From: drafish Date: Fri, 1 Nov 2024 14:04:17 +0800 Subject: [PATCH 04/22] update button size in quick-dapp --- apps/quick-dapp/src/components/DeployPanel/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/quick-dapp/src/components/DeployPanel/index.tsx b/apps/quick-dapp/src/components/DeployPanel/index.tsx index 48a774a9bd..3e08dd72fc 100644 --- a/apps/quick-dapp/src/components/DeployPanel/index.tsx +++ b/apps/quick-dapp/src/components/DeployPanel/index.tsx @@ -51,6 +51,8 @@ function DeployPanel(): JSX.Element {

QuickDapp