optional logo in quick-dapp

pull/5281/head
drafish 1 month ago committed by Aniket
parent 7c3dad6cfd
commit 1580731d31
  1. 7
      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,
shortname: payload.shortname,
shareTo: payload.shareTo,
showLogo: !!logo,
})
const files: Record<string, string> = {
@ -192,7 +193,9 @@ export const deploy = async (payload: any, callback: any) => {
files[`dir/${path}`] = resp.data;
}
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,
},
});
};

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

@ -30,7 +30,7 @@ const DappTop: React.FC = () => {
const shareTitle = encodeURIComponent('Hello everyone, this is my dapp!');
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>
{title && <h1 data-id="dappTitle">{title}</h1>}
{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`}
>
<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 }} />
</div>
</div>}
<DappTop />
</div>
<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="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 }} />
</div>
</div>}
<DappTop />
</div>
<UniversalDappUI />

Loading…
Cancel
Save