-
Notifications
You must be signed in to change notification settings - Fork 14
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
Farabi/fix landscape view issues #58
Conversation
Reviewer's Guide by SourceryThis pull request primarily replaces the No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
Deploying champion-trader with
|
Latest commit: |
6045cb4
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c9b9bfe2.champion-trader.pages.dev |
Branch Preview URL: | https://farabi-fix-landscape-view-is.champion-trader.pages.dev |
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.
Hey @farabi-deriv - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a consistent naming convention (e.g.,
isLandscape
vsisDesktop
) throughout the codebase for device orientation checks. - Verify that the removal of the desktop bottom sheet close test doesn't introduce regressions on other platforms.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This pull request includes several changes across multiple files, primarily focusing on replacing the
useDeviceDetection
hook with theuseOrientationStore
hook to determine the device's orientation. Additionally, some minor adjustments to layout and behavior based on orientation have been made.Replacing
useDeviceDetection
withuseOrientationStore
:src/components/BottomSheet/BottomSheet.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3]src/components/Duration/DurationController.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3] [4] [5] [6] [7]src/components/Duration/DurationField.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3] [4]src/components/Stake/StakeController.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3] [4] [5] [6] [7]src/components/Stake/StakeField.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3]src/components/TradeFields/TradeParamField.tsx
: ReplaceduseDeviceDetection
withuseOrientationStore
and updated references fromisDesktop
toisLandscape
. [1] [2] [3]Layout and behavior adjustments:
src/components/HowToTrade/HowToTrade.tsx
: Adjusted the bottom sheet height from90%
to80%
for mobile devices. [1] [2]src/components/SideNav/SideNav.tsx
: Changed the z-index value from100
to60
for the side navigation bar.Test updates:
src/components/BottomSheet/__tests__/BottomSheet.test.tsx
: Removed the test case for closing the bottom sheet on desktop since the detection logic has been updated.Summary by Sourcery
This pull request focuses on improving the application's adaptability to different device orientations. It replaces the
useDeviceDetection
hook withuseOrientationStore
to accurately detect landscape mode, and adjusts UI components accordingly. Additionally, it includes minor layout adjustments and a test update to reflect the changes.Enhancements:
useDeviceDetection
hook with theuseOrientationStore
hook to determine device orientation, improving accuracy and responsiveness to orientation changes.Tests: