Browse Source

change positioning

feature/new-gateway-modal
PhilReact 9 months ago
parent
commit
912b0adddc
  1. 50
      src/pages/Store/Store/Store.tsx

50
src/pages/Store/Store/Store.tsx

@ -189,6 +189,32 @@ export const Store = () => {
: currentViewedStore : currentViewedStore
}, [username, user?.name, currentStore, currentViewedStore]) }, [username, user?.name, currentStore, currentViewedStore])
const calculateARRRExchangeRate = async()=> {
try {
const url = '/crosschain/price/PIRATECHAIN?maxtrades=10&inverse=true'
const info = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
const responseDataStore = await info.text();
const ratio = +responseDataStore /100000000
if(isNaN(ratio)) throw new Error('Cannot get exchange rate')
setExchangeRate(ratio)
} catch (error) {
dispatch(setPreferredCoin(CoinFilter.qort))
dispatch(
setNotification({
alertType: "error",
msg: "Cannot get exchange rate- reverted to QORT",
})
);
}
}
const switchCoin = async ()=> { const switchCoin = async ()=> {
dispatch(setIsLoadingGlobal(true)); dispatch(setIsLoadingGlobal(true));
@ -623,31 +649,7 @@ export const Store = () => {
const calculateARRRExchangeRate = async()=> {
try {
const url = '/crosschain/price/PIRATECHAIN?maxtrades=10&inverse=true'
const info = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
const responseDataStore = await info.text();
const ratio = +responseDataStore /100000000
if(isNaN(ratio)) throw new Error('Cannot get exchange rate')
setExchangeRate(ratio)
} catch (error) {
dispatch(setPreferredCoin(CoinFilter.qort))
dispatch(
setNotification({
alertType: "error",
msg: "Cannot get exchange rate- reverted to QORT",
})
);
}
}
return ( return (

Loading…
Cancel
Save