Skip to content
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

feat(LLM): multibuy 1.5 [LIVE-1710] #90

Merged
merged 12 commits into from
Jun 15, 2022
Merged

feat(LLM): multibuy 1.5 [LIVE-1710] #90

merged 12 commits into from
Jun 15, 2022

Conversation

Justkant
Copy link
Contributor

@Justkant Justkant commented May 19, 2022

❓ Context

Implemented Multibuy-1.5 flow rebased on v3

✅ Checklist

📸 Demo

Screen.Recording.2022-05-11.at.15.55.35.mov

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

fix: navigation to exchange buy and sell
fix swap modal onClose bug
fix payment provider name case

fix: flow errors and migrate NftImage to ts

fix: Exchange select account page not updating after adding an account
@vercel
Copy link

vercel bot commented May 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Jun 15, 2022 at 8:59AM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:59AM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:59AM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Jun 15, 2022 at 8:59AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented May 19, 2022

🦋 Changeset detected

Latest commit: 49cea26

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
live-mobile Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added mobile Has changes in LLM translations Translation files have been touched labels May 19, 2022
@github-actions
Copy link

github-actions bot commented May 19, 2022

@Justkant

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

Copy link
Contributor

@gre gre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

someone else have to continue the review as I didn't checked the business logic but just feedbacks from a high level perspective.

apps/ledger-live-mobile/android/settings.gradle Outdated Show resolved Hide resolved

export default function GooglePay({ height = 12, width = 32 }: Props) {
return (
<Svg viewBox="0 0 32 12" width={width} height={height}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Svg can be complex for overall performance. We should aim to do one of these:

  • keep using svg but memo that component
  • use an asset instead. static image instead of component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, is there a reason we don't use https://react-svgr.com/ ?
With it we can generate components with memo from svg files and it supports RN

avoids conflicts with others and simplify the review
Copy link
Contributor

@gre gre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good overall

my general feedback is that there are way too much unnecessary ifs that are being done. Something feels wrong, do we validate the "route" that gets in? We shouldn't allow our app to have branching everywhere if we have mandatory route passed in our screens. we should be instead validating them on the "navigate to" side.

accountId: account.id,
// mode: "buy",
parentId: parentAccount && parentAccount.id,
defaultCurrencyId: currency && currency.id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct me if i'm wrong but it looks like we use

  const currency = getAccountCurrency(account);

above and according to that function, currency CAN NOT be falsy.
that said according to props, account can be falsy, in that case, I think getAccountCurrency will crash, so there is something weird to fix somewhere: either make sure the account is never falsy, or make a condition on the getAccountCurrency too 🤔

params: {
defaultTicker:
currency &&
currency.ticker &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ticker can't be falsy 🤔

const fiatCurrency = useSelector(counterValueCurrencySelector);

const filteredProviders = filterRampCatalogEntries(rampCatalog.value[type], {
cryptoCurrencies: currency.id ? [currency.id] : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both tokencurrency and cryptocurrency have an .id so this if can be simplified

trade={trade}
/>
<WebPlatformPlayer
onClose={() => {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to pass a empty callback?


const accounts = useSelector(accountsSelector);

const availableAccounts = useMemo(
() => (currency ? getAccountTuplesForCurrency(currency, accounts) : []),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the route, it's not possible for currency to be falsy

Copy link
Contributor

@gre gre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting it as approve, because not a blocker, but general quality to be improved in future

@valpinkman valpinkman added this to the Ledger Live Mobile 3.3.x milestone Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants