-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backend: add isHidden property in exchange deals #3178
backend: add isHidden property in exchange deals #3178
Conversation
494b613
to
243a321
Compare
label = 'buy.exchange.creditCard'; | ||
break; | ||
// case 'sofort': | ||
// case 'bancontact': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to add icons for sofort and bancontact 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't show them at the moment, lets rethink the badges first before spending time on icons etc.
{isDarkMode ? <Bank /> : <BankDark />} | ||
{t('buy.exchange.bankTransfer')} | ||
</span> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep the return style.
when reading the code, I find it much easier to read also see next comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, I just thought that with other payment methods, it would duplicate too much code, but since we are not adding any other method that's absolutely fine.
return ( | ||
<span className={style.paymentMethodName}> | ||
{icon} | ||
{label && t(label)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost the entire codebase uses t('keyname'
so it is easy to find again.
but see my other comment, then this variable isn't needed anyway.
label = 'buy.exchange.creditCard'; | ||
break; | ||
// case 'sofort': | ||
// case 'bancontact': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't show them at the moment, lets rethink the badges first before spending time on icons etc.
This allows to hide specific deals in the frontend deals list. e.g. when the exchange offers several payment methods with different fees. The deals are still used to show all the payments and fees in the info box.
243a321
to
d41595b
Compare
@thisconnect updated, PTAL 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (mostly looked at the backend, but the frontend looks good to me as well)
@@ -236,7 +239,7 @@ func GetExchangeDeals(account accounts.Interface, regionCode string, action Exch | |||
bestDealIndex := 0 | |||
for i, deal := range deals { | |||
oldBestDeal := deals[bestDealIndex] | |||
if deal.Fee < oldBestDeal.Fee { | |||
if !deal.IsHidden && deal.Fee < oldBestDeal.Fee { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[out of scope for this PR] I still think that if we keep the "best" badge we need to decide how to deal with multiple deals offering the same fee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!! tested LGTM
This allows to hide specific deals in the frontend deals list. e.g. when the exchange offers several payment methods with different fees. The deals are still used to show all the payments and fees in the info box.