-
Notifications
You must be signed in to change notification settings - Fork 113
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
Adds subcomponents to AdvancedTradeForm #241
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). mango-ui-v3 – ./🔍 Inspect: https://vercel.com/blockworks-foundation/mango-ui-v3/HnFFVvEmYHpn1Sh2UCNoE49sVvQj mango-ui-v3-devnet – ./🔍 Inspect: https://vercel.com/blockworks-foundation/mango-ui-v3-devnet/2e9VWVLcpDSiYo2YX8FmNcLN4jFd |
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖
|
Page | Size (compressed) |
---|---|
global |
744.24 KB (🟡 +487 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
…nto kieran/advanced-trade-form-refactor
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.
Looks okay to me. There are a few things resolved in main that would need to be updated.
– "Post & Slide" is now "Slide"
– Checking "Post & Slide" and submitting throws a "Missing price" error
– "Post & Slide" shouldn't show on market orders
@@ -722,13 +701,6 @@ export default function AdvancedTradeForm({ | |||
} | |||
} | |||
|
|||
// const showReduceOnly = (basePosition: number) => { |
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 think this is wired up on main but it's probably a better UX to not show the reduce only checkbox when a user has no position to reduce
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.
Okay I can leave in these comments, with this change the aim wasn't to add new logic that needs to be tested, but just refactoring the code structure.
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.
No worries
// (basePosition < 0 && side === 'buy') | ||
// ) | ||
// } | ||
|
||
/* |
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.
Same thing here. Not sure why sizeTooLarge is set to false. Good to save users from submitting a transaction if size is too large
@saml33 Thanks for your comments, |
@kierangillen All good. Was messing around with the branch and prob didn't have the latest changes. |
AdvancedTradeForm
component. This PR breaks the render into more manageable subcomponents. It also moves the checkbox boolean states into one object to reduce re-renders for faster updates and to simplify any potential consistency issues.