-
Notifications
You must be signed in to change notification settings - Fork 73
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
chore(orderbook): update orderbook to not be scrollable #846
chore(orderbook): update orderbook to not be scrollable #846
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8156672
to
fef31d4
Compare
a5676e4
to
bd4078e
Compare
|
||
// Handle resize, sync to state | ||
useEffect(() => { | ||
const resizeObserver = new ResizeObserver((entries) => { |
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.
one last thing - do we support IE? Looks like even latest internet explorer doesn't support this.
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.
Code looks good but please check with @jaredvu who was generally opposed to merging this last week iirc.
try #2 which is 100x simpler than my last thing I was trying cuz I think my brain was non functional the first round
Goal: To make the orderbook not scrollable (fixed height-ish) while still maintaining the reponsiveness of the screen sizing:
We still want the orderbook to grow when the height of the screen grows
We still want the whole page to fit on any (reasonably sized) screen without scrolling
We want the orderbook to be just large enough to show x rows, centered such that the price row is in the middle
Solution:
EDIT: used resizeObserver and things work way better now
Unrelated polish included in this PR
resizingWindow.mov
zoomInAndOut.mov
Things I did not do in this PR
Views
forms/TradeForm
views/CanvasOrderbook
maxRowsPerSide
torowsPerSide
Components
VerticalPanel
canvasOrderbook
tab and useresizeObserver
off of that to calculate the number of rows we can render without scrollingConstants/Types
constants/orderbook.ts
Hooks
hooks/useDrawOrderbook
useCallback
and fixed up theuseEffect
dependencieswindowResize
listener toresizeObserver
hooks/useCalculateOrderbookData
maxRowsPerSide
torowsPerSide