-
Notifications
You must be signed in to change notification settings - Fork 102
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
refactor: extract TradeConfirmation component from LimitOrdersConfirmModal #2564
Conversation
… fix/2429-1 # Conflicts: # src/common/pure/CurrencyAmountPreview/index.tsx # src/modules/limitOrders/pure/LimitOrdersConfirm/index.tsx # src/modules/limitOrders/pure/LimitOrdersConfirm/styled.tsx
… fix/2429-1 # Conflicts: # src/common/hooks/useRateInfoParams.ts # src/common/pure/CurrencyAmountPreview/index.tsx # src/common/pure/RateInfo/index.tsx # src/modules/limitOrders/containers/LimitOrdersConfirmModal/index.tsx # src/modules/limitOrders/pure/LimitOrdersConfirm/index.cosmos.tsx # src/modules/limitOrders/pure/LimitOrdersConfirm/index.tsx # src/modules/limitOrders/utils/buildPriceFromCurrencyAmounts.ts
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
import { CurrencyLogo } from 'common/pure/CurrencyLogo' | ||
import { TokenSymbol } from 'common/pure/TokenSymbol' | ||
|
||
import * as styledEl from './styled' | ||
|
||
export interface CurrencySelectButtonProps { | ||
currency?: Currency | ||
currency?: Nullish<Currency> |
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.
do you still need the question-mark in the prop?
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.
Yes. Optional !== undefined
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.
fine with me, different is subtle, the point is if we want to make it optional.
Currency is even in the name of the component, and the 2 uses provide the prop
currency={disabled ? undefined : currency || undefined} |
<CurrencySelectButton readonlyMode={true} loading={false} currency={token} /> |
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.
Aaaah, got your point. Will refactor it in the next PR.
Thank you!
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.
Great changes! just reviewed the code, i didn't test the app itself
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
Summary
Fixes #2429
Refactored
LimitOrdersConfirmModal
in order to create a genericTradeConfirmation
component that can be used in any trade widget.Unfortunately, in the changes we can't see that the component is just refactored version of
LimitOrdersConfirmModal
. But, in the first commit you can see that it just was moved usinggit mv
.TradeConfirmation
looks like this:Essentially, it's just a representation of sell + buy amounts with an arbitrary content at the bottom.
Changes