-
Notifications
You must be signed in to change notification settings - Fork 192
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: Add Swap Settings #1210
feat: Add Swap Settings #1210
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f2f1d28
to
be9cfd9
Compare
be9cfd9
to
65f7462
Compare
|
||
const [maxSlippage, _setMaxSlippage] = useState( | ||
experimental.maxSlippage || 3, | ||
); |
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.
don't want this in state do we? If the experimental prop changes, should that update here?
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.
The experimental prop won't change after the component is rendered.
It will set the initial maxSlippage
value. Any updates will be handled by LifeCycleStatus.slippageChange.maxSlippage
property
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.
And we update this value using setLifeCycleStatus
'
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.
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.
If we are only using this const to initialize lifecycle status, can it just be a const? or alternatively we could move the initiallifecycle status into a const?
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.
The experimental prop won't change after the component is rendered.
@cpcramer that sentence it's incorrect! We should always expect a prop can change, that's the all point of prop. :)
const maxSlippage = | ||
lifeCycleStatus.statusName !== 'error' | ||
? lifeCycleStatus.statusData.maxSlippage | ||
: 3; |
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.
If 3 is our default for everything, this should be in a share const
.
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.
Follow up on this in the next PR.
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.
I want to keep the ball moving, so I am going to merge this, and @cpcramer follow up with the notes in your next PR.
What changed? Why?
Add
SwapSettings
sub-component - we are not displaying it yet.Update
SwapSettingsSlippageInput
Add
maxSlippage
field tostatusData
in everyLifeCycleStatus
exceptError
.Notes to reviewers
How has it been tested?