Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenandrews committed Sep 6, 2024
1 parent 232d651 commit d8ad397
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/components/CollectionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default function CollectionDetails(props) {
.filter(a => collection.hasOwnProperty(a) && collection[a])
.map(a => {
return (
<h4 style={{marginTop: -20}}>
<h4 key={a} style={{marginTop: -20}}>
Creator royalty: {parseInt(1000 * collection[a]) / 10 - 1}%
</h4>
);
Expand Down
4 changes: 0 additions & 4 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,6 @@ export default function Navbar(props) {
}

const useStyles = makeStyles(theme => {
console.log({breakpoints: theme.breakpoints, sm: theme.breakpoints.up('sm')});

// ideally this value would get calculated at run time based on how wide the nav
// bar buttons are
const hamburgerBreakPixel = '1300px';
const displayIcpBreakPixel = '450px';
const searchHiddenBreakPixel = '750px';
Expand Down
115 changes: 53 additions & 62 deletions src/components/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,74 +276,65 @@ export default function Wallet(props) {
<ListItemText primary="Logout" />
</MenuItem>
</Menu>
<ListItem style={{display: 'flex', justifyContent: 'center'}}>
<Typography style={{width: '100%', textAlign: 'center'}}>
<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' }}>
<PriceICP
volume={true}
loader={
balance === false || (loadedAccount == 0 && loading === true)
}
price={
balance === false
? false
: Number(balance) +
(voltBalances && loadedAccount == 0 ? voltBalances[0] : 0)
}
></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 />
{loadedAccount === 0 &&
balance !== false &&
loading == false &&
voltPrincipal ? (
<>
<hr style={{width: '100%', borderBottom: '1px solid grey'}} />
<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 />
</>
) : (
''
)}
</>
<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>
</Typography>
</>
) : (
''
)}
</ListItem>


{loading == false && loadedAccount === 0 ? (
<ListItem>
<Button
Expand Down
35 changes: 16 additions & 19 deletions src/ic/stoic-identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,21 @@ function _removeFrame(id) {

function _postToPopup(data, resolve, reject) {
var thisIndex, existing = false;
if (data.endpoint == 'read_state') {
if (_stoicOpenConnection){
thisIndex = _stoicOpenConnection;
existing = true;
if (_stoicTimer) {
clearTimeout(_stoicTimer);
}
((listener) => {
_stoicTimer = setTimeout(() => {
if (_stoicOpenConnection == listener) {
_stoicTimer = false;
_stoicOpenConnection = false;
}
_removeFrame(listener);
}, 5000);
})(thisIndex);
}
};
if (_stoicOpenConnection){
thisIndex = _stoicOpenConnection;
existing = true;
if (_stoicTimer) {
clearTimeout(_stoicTimer);
_stoicTimer = false;
}
if (data.endpoint == 'call') {
//Keep it open?
} else {
_stoicTimer = setTimeout(() => {
_removeFrame(thisIndex);
}, 5000);
}
}
if (!thisIndex) {
thisIndex = _listenerIndex;
_listenerIndex += 1;
Expand All @@ -288,7 +285,7 @@ function _postToPopup(data, resolve, reject) {
const popup = window.open(
`${_stoicOrigin}/?stoicTunnel&transport=popup&lid=`+thisIndex,
"stoic_"+thisIndex,
"width=500,height=250,top=300,toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no"
"width=500,height=250,left=100,top=300,toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no"
);
if (!popup) {
return reject("Failed to open popup window. It may have been blocked by the browser.");
Expand Down
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ const clipboardCopy = text => {
if (!lastUpdate || Date.now() - lastUpdate > 10 * 60 * 1000) {
lastUpdate = Date.now();
var b = await api.canister('rkp4c-7iaaa-aaaaa-aaaca-cai').get_icp_xdr_conversion_rate();
var b2 = await fetch(
/*var b2 = await fetch(
'https://free.currconv.com/api/v7/convert?q=XDR_USD&compact=ultra&apiKey=df6440fc0578491bb13eb2088c4f60c7',
).then(r => r.json());
).then(r => r.json());*/
_rate =
Number(b.data.xdr_permyriad_per_icp / 10000n) *
(b2.hasOwnProperty('XDR_USD') ? b2.XDR_USD : 1.331578);
1.3491865;
}
return _rate;
},
Expand Down

0 comments on commit d8ad397

Please sign in to comment.