Skip to content

Commit

Permalink
Run format
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnex committed Oct 3, 2024
1 parent 0a75347 commit 3bd4b92
Show file tree
Hide file tree
Showing 8 changed files with 440 additions and 395 deletions.
5 changes: 3 additions & 2 deletions public/trials.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const otMeta = document.createElement('meta');
otMeta.httpEquiv = 'origin-trial';
otMeta.content = 'Ayfl4fp/WFo5HSyGVliYl2bnpkL3Pa+wm2xyHbpTP5V0kHgpba2f8WZz0lOJnr0dDRk6PIpkOl4NIfhEyJSq7wUAAACYeyJvcmlnaW4iOiJodHRwczovL3d3dy5zdG9pY3dhbGxldC5jb206NDQzIiwiZmVhdHVyZSI6IkRpc2FibGVUaGlyZFBhcnR5U3RvcmFnZVBhcnRpdGlvbmluZyIsImV4cGlyeSI6MTcyNTQwNzk5OSwiaXNTdWJkb21haW4iOnRydWUsImlzVGhpcmRQYXJ0eSI6dHJ1ZX0=';
document.head.append(otMeta);
otMeta.content =
'Ayfl4fp/WFo5HSyGVliYl2bnpkL3Pa+wm2xyHbpTP5V0kHgpba2f8WZz0lOJnr0dDRk6PIpkOl4NIfhEyJSq7wUAAACYeyJvcmlnaW4iOiJodHRwczovL3d3dy5zdG9pY3dhbGxldC5jb206NDQzIiwiZmVhdHVyZSI6IkRpc2FibGVUaGlyZFBhcnR5U3RvcmFnZVBhcnRpdGlvbmluZyIsImV4cGlyeSI6MTcyNTQwNzk5OSwiaXNTdWJkb21haW4iOnRydWUsImlzVGhpcmRQYXJ0eSI6dHJ1ZX0=';
document.head.append(otMeta);
4 changes: 2 additions & 2 deletions src/components/Detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ const Detail = props => {
// }

if (index == 99 && canister == 'kss7i-hqaaa-aaaah-qbvmq-cai')
detailPage = 'interactive_nfts_or_videos';
detailPage = 'interactive_nfts_or_videos';

if (index >= 9 && index <= 19 && canister == 'yy7m6-daaaa-aaaag-qciqa-cai')
detailPage = 'interactive_nfts_or_videos';

Expand Down
20 changes: 10 additions & 10 deletions src/components/UserCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,18 @@ export default function UserCollection(props) {
break;
case 'favorites':
// var r = await extjs
// .connect('https://icp0.io/', props.identity)
// .canister('6z5wo-yqaaa-aaaah-qcsfa-cai')
// .liked();
// .connect('https://icp0.io/', props.identity)
// .canister('6z5wo-yqaaa-aaaah-qcsfa-cai')
// .liked();
// data = r.filter((a, i) => r.indexOf(a) == i);
// data = data.map(a => ({
// id: a,
// token: a,
// price: 0,
// time: 0,
// owner: false,
// canister: extjs.decodeTokenId(a).canister,
// listing: null,
// id: a,
// token: a,
// price: 0,
// time: 0,
// owner: false,
// canister: extjs.decodeTokenId(a).canister,
// listing: null,
// }));
break;
case 'offers-made':
Expand Down
133 changes: 78 additions & 55 deletions src/components/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,64 +276,87 @@ export default function Wallet(props) {
<ListItemText primary="Logout" />
</MenuItem>
</Menu>
<ListItem style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center' }}>
<Typography style={{ width: '100%', textAlign: 'center' }}>
<PriceICP
volume={true}
loader={balance === false || (loadedAccount === 0 && loading === true)}
price={
balance === false
? false
: Number(balance) + (voltBalances && loadedAccount === 0 ? voltBalances[0] : 0)
}
/>
<br />
</Typography>

{/* Move the hr outside of Typography */}
{loadedAccount === 0 && balance !== false && loading === false && voltPrincipal ? (
<>
<hr style={{ width: '100%', borderBottom: '1px solid grey' }} />

<Typography style={{ width: '100%', textAlign: 'center' }}>
<ListItem
style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Typography style={{width: '100%', textAlign: 'center'}}>
<PriceICP
bold={false}
volume={true}
text={
balance === false ? (
<ToniqIcon
className="toniq-icon-fit-icon"
style={{ height: '14px', width: '14px' }}
icon={LoaderAnimated24Icon}
/>
) : undefined
}
price={balance}
>
Wallet
</PriceICP>
<br />
<PriceICP bold={false} volume={true} loader={voltBalances === false} price={voltBalances[0] - voltBalances[2]}>
Volt
</PriceICP>
volume={true}
loader={
balance === false || (loadedAccount === 0 && loading === true)
}
price={
balance === false
? false
: Number(balance) +
(voltBalances && loadedAccount === 0
? voltBalances[0]
: 0)
}
/>
<br />
{voltBalances && voltBalances[2] > 0 ? (
<>
<PriceICP bold={false} volume={true} price={voltBalances[2]}>
Locked
</PriceICP>
<br />
</>
) : (
''
)}
</Typography>
</>
) : (
''
)}
</ListItem>
</Typography>

{/* Move the hr outside of Typography */}
{loadedAccount === 0 &&
balance !== false &&
loading === false &&
voltPrincipal ? (
<>
<hr style={{width: '100%', borderBottom: '1px solid grey'}} />

<Typography style={{width: '100%', textAlign: 'center'}}>
<PriceICP
bold={false}
volume={true}
text={
balance === false ? (
<ToniqIcon
className="toniq-icon-fit-icon"
style={{height: '14px', width: '14px'}}
icon={LoaderAnimated24Icon}
/>
) : undefined
}
price={balance}
>
Wallet
</PriceICP>
<br />
<PriceICP
bold={false}
volume={true}
loader={voltBalances === false}
price={voltBalances[0] - voltBalances[2]}
>
Volt
</PriceICP>
<br />
{voltBalances && voltBalances[2] > 0 ? (
<>
<PriceICP
bold={false}
volume={true}
price={voltBalances[2]}
>
Locked
</PriceICP>
<br />
</>
) : (
''
)}
</Typography>
</>
) : (
''
)}
</ListItem>

{loading == false && loadedAccount === 0 ? (
<ListItem>
Expand Down
8 changes: 4 additions & 4 deletions src/ic/extjs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global BigInt */
import {Actor, HttpAgent} from '@dfinity/agent';
import {Principal} from '@dfinity/principal';
import { IDL } from '@dfinity/candid';
import {IDL} from '@dfinity/candid';
import {
LEDGER_CANISTER_ID,
GOVERNANCE_CANISTER_ID,
Expand Down Expand Up @@ -153,7 +153,7 @@ for (const a in tokensToLoad) {
}
function isQueryCall(idlFactory, methodName) {
// Parse the IDL using the provided factory function
const idl = idlFactory({ IDL });
const idl = idlFactory({IDL});

// Retrieve the method definition by its name
const method = idl._fields.find(([name]) => name === methodName);
Expand All @@ -177,7 +177,7 @@ function createLoggingActor(actor, idl) {
// Check if the property is a function (i.e., a method call)
if (typeof origMethod === 'function') {
return async function (...args) {
const iqc = isQueryCall(idl, propKey);//propKey.startsWith("query");
const iqc = isQueryCall(idl, propKey); //propKey.startsWith("query");
//console.log(`Standard Actor: Calling ${iqc} method: ${propKey}`, 'with arguments:', args);
const result = await origMethod.apply(target, args);
//console.log(`Result from ${iqc} method: ${propKey}`, result);
Expand All @@ -187,7 +187,7 @@ function createLoggingActor(actor, idl) {

// If not a function, just return the original property
return origMethod;
}
},
});
}
class VirtualActor {
Expand Down
Loading

0 comments on commit 3bd4b92

Please sign in to comment.