bug fixes

This commit is contained in:
sairaj mote 2022-04-03 20:38:25 +05:30
parent 371c4c5bcd
commit c93f1bf65e
4 changed files with 24 additions and 19 deletions

View File

@ -682,16 +682,23 @@ sm-checkbox {
} }
#asset_page { #asset_page {
display: grid; display: flex;
flex-direction: column;
height: 100%; height: 100%;
} }
#asset_page__nav { #asset_page__nav {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 1rem 0; padding: 1rem 0;
} }
#asset_page__nav .icon-only { #asset_page__nav .icon-only {
margin-left: -0.7rem; margin-left: -0.7rem;
} }
#asset_page__nav strip-select {
align-self: center;
}
#trade_form { #trade_form {
height: 100%; height: 100%;
@ -1046,11 +1053,6 @@ sm-checkbox {
display: none !important; display: none !important;
} }
#asset_page {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr);
}
.listed-asset { .listed-asset {
border-radius: 0; border-radius: 0;
border-bottom: solid thin rgba(var(--text-color), 0.1); border-bottom: solid thin rgba(var(--text-color), 0.1);

File diff suppressed because one or more lines are too long

View File

@ -649,14 +649,21 @@ sm-checkbox {
height: 100%; height: 100%;
} }
#asset_page { #asset_page {
display: grid; display: flex;
flex-direction: column;
height: 100%; height: 100%;
} }
#asset_page__nav { #asset_page__nav {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 1rem 0; padding: 1rem 0;
.icon-only { .icon-only {
margin-left: -0.7rem; margin-left: -0.7rem;
} }
strip-select {
align-self: center;
}
} }
#trade_form { #trade_form {
height: 100%; height: 100%;
@ -970,10 +977,6 @@ sm-checkbox {
.hide-on-mobile { .hide-on-mobile {
display: none !important; display: none !important;
} }
#asset_page {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr);
}
.listed-asset { .listed-asset {
border-radius: 0; border-radius: 0;
border-bottom: solid thin rgba(var(--text-color), 0.1); border-bottom: solid thin rgba(var(--text-color), 0.1);

View File

@ -99,7 +99,7 @@
<ul id="listed_assets" class="user-content hide"></ul> <ul id="listed_assets" class="user-content hide"></ul>
</div> </div>
<div id="asset_page" class="hide-on-mobile"> <div id="asset_page" class="hide-on-mobile">
<nav id="asset_page__nav" class="flex align-center space-between hide-on-desktop"> <nav id="asset_page__nav" class="hide-on-desktop">
<a href="#/exchange" class="button icon-only"> <a href="#/exchange" class="button icon-only">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" <svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
width="24px" fill="#000000"> width="24px" fill="#000000">
@ -133,7 +133,7 @@
<strip-option value="sell">Sell</strip-option> <strip-option value="sell">Sell</strip-option>
</strip-select> </strip-select>
</div> </div>
<sm-input id="get_price" placeholder="Max price (₹)" type="number" step="0.01" required <sm-input id="get_price" placeholder="Max price (₹)" type="number" step="0.0001" required
animate> animate>
</sm-input> </sm-input>
<sm-input id="get_quantity" placeholder="Quantity" type="number" step="0.0001" required <sm-input id="get_quantity" placeholder="Quantity" type="number" step="0.0001" required
@ -1014,7 +1014,7 @@
}, },
], ],
{ {
duration: 150, duration: 300,
easing: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)' easing: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)'
}).onfinish = () => { }).onfinish = () => {
getRef('pages_container').style.overflowY = ""; getRef('pages_container').style.overflowY = "";
@ -1497,10 +1497,10 @@
const selectedAsset = pagesData.params.asset const selectedAsset = pagesData.params.asset
if (tradeType === 'buy') { if (tradeType === 'buy') {
console.log(parseFloat((fraction * allTokens['rupee'].net).toFixed(4)), parseFloat(((allTokens['rupee'].net * fraction) / unitValue).toFixed(4))) console.log(parseFloat((fraction * allTokens['rupee'].net).toFixed(4)), parseFloat(((allTokens['rupee'].net * fraction) / unitValue).toFixed(4)))
getRef('get_total').value = parseFloat((fraction * allTokens['rupee'].net).toFixed(4)) getRef('get_total').value = parseFloat((fraction * allTokens['rupee'].net).toFixed(2))
getRef('get_quantity').value = parseFloat(((allTokens['rupee'].net * fraction) / unitValue).toFixed(4)) getRef('get_quantity').value = parseFloat(((allTokens['rupee'].net * fraction) / unitValue).toFixed(4))
} else { } else {
getRef('get_total').value = parseFloat((fraction * allTokens[selectedAsset].net * floGlobals.exchangeRates[selectedAsset]).toFixed(4)) getRef('get_total').value = parseFloat((fraction * allTokens[selectedAsset].net * floGlobals.exchangeRates[selectedAsset]).toFixed(2))
getRef('get_quantity').value = parseFloat((allTokens[selectedAsset].net * fraction).toFixed(4)) getRef('get_quantity').value = parseFloat((allTokens[selectedAsset].net * fraction).toFixed(4))
} }
@ -1510,11 +1510,11 @@
const unitValue = parseFloat(getRef('get_price').value) || floGlobals.exchangeRates[pagesData.params.asset] const unitValue = parseFloat(getRef('get_price').value) || floGlobals.exchangeRates[pagesData.params.asset]
const quantity = parseFloat(getRef('get_quantity').value) || 0 const quantity = parseFloat(getRef('get_quantity').value) || 0
getRef('get_total').value = parseFloat((quantity * unitValue).toFixed(4)) || 0 getRef('get_total').value = parseFloat((quantity * unitValue).toFixed(2)) || 0
}) })
getRef('get_quantity').addEventListener('keyup', e => { getRef('get_quantity').addEventListener('keyup', e => {
const unitValue = parseFloat(getRef('get_price').value) const unitValue = parseFloat(getRef('get_price').value)
getRef('get_total').value = parseFloat((parseFloat(e.target.value) * unitValue).toFixed(4)) || 0 getRef('get_total').value = parseFloat((parseFloat(e.target.value) * unitValue).toFixed(2)) || 0
}) })
getRef('get_total').addEventListener('keyup', e => { getRef('get_total').addEventListener('keyup', e => {
const unitValue = parseFloat(getRef('get_price').value) const unitValue = parseFloat(getRef('get_price').value)