From 1580731d31da2501e58fb7197efd5f6a0cbf2b45 Mon Sep 17 00:00:00 2001 From: drafish Date: Tue, 22 Oct 2024 10:46:46 +0800 Subject: [PATCH] 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 &&
-
+
}