optional logo in quick-dapp

pull/5281/head
drafish 1 month ago committed by Aniket
parent 7c3dad6cfd
commit 1580731d31
  1. 9
      apps/quick-dapp/src/actions/index.ts
  2. 1
      apps/remix-dapp/src/assets/instance.json
  3. 2
      apps/remix-dapp/src/components/DappTop/index.tsx
  4. 4
      apps/remix-dapp/src/components/Home/mobile.tsx
  5. 4
      apps/remix-dapp/src/components/Home/pc.tsx

@ -171,6 +171,7 @@ export const deploy = async (payload: any, callback: any) => {
...instance, ...instance,
shortname: payload.shortname, shortname: payload.shortname,
shareTo: payload.shareTo, shareTo: payload.shareTo,
showLogo: !!logo,
}) })
const files: Record<string, string> = { const files: Record<string, string> = {
@ -192,7 +193,9 @@ export const deploy = async (payload: any, callback: any) => {
files[`dir/${path}`] = resp.data; files[`dir/${path}`] = resp.data;
} }
files['dir/assets/logo.png'] = logo if (logo) {
files['dir/assets/logo.png'] = logo
}
files['dir/CORS'] = '*' files['dir/CORS'] = '*'
files['dir/index.html'] = files['dir/index.html'].replace( files['dir/index.html'] = files['dir/index.html'].replace(
'assets/css/themes/remix-dark_tvx1s2.css', 'assets/css/themes/remix-dark_tvx1s2.css',
@ -341,7 +344,7 @@ export const initInstance = async ({
} }
: { A: ids }; : { 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({ await dispatch({
type: 'SET_INSTANCE', type: 'SET_INSTANCE',
@ -353,7 +356,7 @@ export const initInstance = async ({
natSpec, natSpec,
solcVersion: getVersion(solcVersion), solcVersion: getVersion(solcVersion),
...lowLevel, ...lowLevel,
logo: logo.data, // logo: logo.data,
}, },
}); });
}; };

@ -492,6 +492,7 @@
], ],
"noTerminal": false, "noTerminal": false,
"verified": true, "verified": true,
"showLogo": true,
"solcVersion": { "solcVersion": {
"version": "0.8.26", "version": "0.8.26",
"canReceive": true "canReceive": true

@ -30,7 +30,7 @@ const DappTop: React.FC = () => {
const shareTitle = encodeURIComponent('Hello everyone, this is my dapp!'); const shareTitle = encodeURIComponent('Hello everyone, this is my dapp!');
return ( return (
<div className="col-10 p-3 bg-light w-auto d-flex justify-content-between"> <div className={`${instance.logo ? 'col-10' : 'col-12'} p-3 bg-light w-auto d-flex justify-content-between`}>
<div> <div>
{title && <h1 data-id="dappTitle">{title}</h1>} {title && <h1 data-id="dappTitle">{title}</h1>}
{details && <span data-id="dappInstructions">{details}</span>} {details && <span data-id="dappInstructions">{details}</span>}

@ -18,9 +18,9 @@ const MobilePage: React.FC = () => {
} col-xl-9 col-lg-8 col-md-7 pr-0`} } col-xl-9 col-lg-8 col-md-7 pr-0`}
> >
<div className="mx-3 my-2 row"> <div className="mx-3 my-2 row">
<div className="col-2 text-center px-0 d-flex align-items-center"> {instance.showLogo && <div className="col-2 text-center px-0 d-flex align-items-center">
<img src="/assets/logo.png" style={{ width: 55, height: 55 }} /> <img src="/assets/logo.png" style={{ width: 55, height: 55 }} />
</div> </div>}
<DappTop /> <DappTop />
</div> </div>
<UniversalDappUI /> <UniversalDappUI />

@ -24,9 +24,9 @@ const PCPage: React.FC = () => {
> >
<div className="col-xl-9 col-lg-8 col-md-7 d-inline-block pr-0"> <div className="col-xl-9 col-lg-8 col-md-7 d-inline-block pr-0">
<div className="mx-3 my-2 row"> <div className="mx-3 my-2 row">
<div className="col-2 text-center"> {instance.showLogo && <div className="col-2 text-center">
<img src="/assets/logo.png" style={{ width: 95, height: 95 }} /> <img src="/assets/logo.png" style={{ width: 95, height: 95 }} />
</div> </div>}
<DappTop /> <DappTop />
</div> </div>
<UniversalDappUI /> <UniversalDappUI />

Loading…
Cancel
Save