Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit b4fa7dc

Browse files
Suisin/Fixed Overflow Contract in Mobile View (#7197)
* Fixed Overflow Contract in Mobile View * Rerun * Updated Scss * Update font-size * Updated media screen for css * Update css after contract won * Order .attr to the correct placement * Remove space in litera string Co-authored-by: Matin shafiei <[email protected]>
1 parent 43e47ca commit b4fa7dc

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/javascript/app/pages/trade/purchase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ const Purchase = (() => {
173173

174174
const potential_profit_value = payout_value ? formatMoney(currency, payout_value - cost_value) : undefined;
175175

176-
CommonFunctions.elementInnerHtml(cost, `${localize('Total Cost')} <p>${formatMoney(currency, cost_value)}</p>`);
176+
CommonFunctions.elementInnerHtml(cost, `${localize('Total Cost')} <p id="contract_purchase_cost--amount">${formatMoney(currency, cost_value)}</p>`);
177177
if (isLookback(contract_type)) {
178-
CommonFunctions.elementInnerHtml(payout, `${localize('Potential Payout')} <p>${formula}</p>`);
178+
CommonFunctions.elementInnerHtml(payout, `${localize('Potential Payout')} <p id="contract_purchase_payout--amount">${formula}</p>`);
179179
profit.setVisibility(0);
180180
} else {
181181
profit.setVisibility(1);
182-
CommonFunctions.elementInnerHtml(payout, `${localize('Potential Payout')} <p>${formatMoney(currency, payout_value)}</p>`);
183-
CommonFunctions.elementInnerHtml(profit, `${localize('Potential Profit')} <p>${potential_profit_value}</p>`);
182+
CommonFunctions.elementInnerHtml(payout, `${localize('Potential Payout')} <p id="contract_purchase_payout--amount">${formatMoney(currency, payout_value)}</p>`);
183+
CommonFunctions.elementInnerHtml(profit, `${localize('Potential Profit')} <p id="contract_purchase_profit--amount">${potential_profit_value}</p>`);
184184
}
185185

186186
updateValues.updateContractBalance(receipt.balance_after);

src/javascript/app/pages/trade/update_values.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ const updatePurchaseStatus = (final_price, pnl, profit, localized_contract_statu
99
const $profit = $('#contract_purchase_profit');
1010
const currency = Client.get('currency');
1111

12-
$payout.html($('<div/>', { text: localize('Buy price') }).append($('<p/>', { html: formatMoney(currency, Math.abs(pnl)) })));
13-
$cost.html($('<div/>', { text: localize('Final price') }).append($('<p/>', { html: formatMoney(currency, final_price) })));
12+
$payout.html($('<div/>', { text: localize('Buy price') }).append($('<p/>', { html: formatMoney(currency, Math.abs(pnl)) }).attr('id','contract_purchase_payout--amount')));
13+
$cost.html($('<div/>', { text: localize('Final price') }).append($('<p/>', { html: formatMoney(currency, final_price) }).attr('id','contract_purchase_cost--amount')));
1414
if (!final_price) {
15-
$profit.html($('<div/>', { text: localize('Loss') }).append($('<p/>', { html: formatMoney(currency, pnl) })));
15+
$profit.html($('<div/>', { text: localize('Loss') }).append($('<p/>', { html: formatMoney(currency, pnl) }).attr('id','contract_purchase_loss--amount')));
1616
} else {
17-
$profit.html($('<div/>', { text: localize('Profit') }).append($('<p/>', { html: formatMoney(currency, profit) })));
17+
$profit.html($('<div/>', { text: localize('Profit') }).append($('<p/>', { html: formatMoney(currency, profit) }).attr('id','contract_purchase_profit--amount')));
1818
updateContractBalance(Client.get('balance'));
1919
}
2020
};

src/sass/app/trade.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,13 @@
537537
background-color: rgba(204, 0, 0, 0.1);
538538
}
539539
}
540+
#contract_purchase_cost, #contract_purchase_payout, #contract_purchase_profit, #contract_purchase_loss {
541+
@media screen and (max-width: 375px) {
542+
&--amount {
543+
font-size: 4vw;
544+
}
545+
}
546+
}
540547
#contract_purchase_payout {
541548
border-right: 1px solid $COLOR_GRAY;
542549
}

0 commit comments

Comments
 (0)