Skip to content
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

Contract Detail Desktop View and UI Fixes #42

Merged
merged 7 commits into from
Feb 19, 2025
Merged

Conversation

ahmadtaimoor-deriv
Copy link
Contributor

@ahmadtaimoor-deriv ahmadtaimoor-deriv commented Feb 19, 2025

Summary by Sourcery

This pull request includes UI improvements, specifically focusing on the main layout and the MarketInfo component. The layout changes enhance responsiveness, especially in landscape mode, by using a grid-based system. The MarketInfo component's appearance has been refined with a cleaner color scheme.

Enhancements:

  • Improves the layout of the main application, especially for landscape mode, by using a grid-based system for better responsiveness and organization of sidebars.
  • Updates the MarketInfo component to use a gray background and more subtle text colors for a cleaner look.

Copy link

sourcery-ai bot commented Feb 19, 2025

Reviewer's Guide by Sourcery

This pull request includes UI fixes and improvements across multiple components. The MainLayout was refactored to use CSS grid for better layout management. The MarketInfo component was updated with improved styling, especially for mobile devices. The PositionsSidebar component was refactored to remove unnecessary conditional rendering and improve styling.

Updated class diagram for MainLayout

classDiagram
  class MainLayout {
    +children: ReactNode
    +isSidebarOpen: boolean
    +setSidebarOpen: function
    +setMenuOpen: function
    +isMenuOpen: boolean
  }
  note for MainLayout "Refactored to use CSS grid for better layout management"
Loading

Updated class diagram for MarketInfo

classDiagram
  class MarketInfo {
    +title: string
    +subtitle: string
    +selectedMarket: Market
    +onClick: function
    +isMobile: boolean
  }
  note for MarketInfo "Updated styling, especially for mobile devices"
Loading

Updated class diagram for PositionsSidebar

classDiagram
  class PositionsSidebar {
    -isOpen: boolean
    +onClose: function
  }
  note for PositionsSidebar "Refactored to remove unnecessary conditional rendering and improve styling"
Loading

File-Level Changes

Change Details Files
Modified the MainLayout component to use CSS grid for layout management, improving responsiveness and flexibility.
  • Replaced the flexbox-based layout with a CSS grid layout.
  • Adjusted the grid template columns based on the isLandscape and isSidebarOpen states.
  • Removed conditional rendering of MenuSidebar and placed it within the grid.
  • Removed width and margin adjustments based on sidebar and menu states.
  • Added transition to grid template columns for smoother layout changes.
src/layouts/MainLayout/MainLayout.tsx
Updated the MarketInfo component to improve its appearance and styling, especially on mobile devices.
  • Modified the mobile version to use inline-flex and added margins.
  • Added rounded corners to the mobile version.
  • Updated the background color of the mobile version.
  • Changed the default background color for the non-mobile version.
  • Updated text colors for title and subtitle.
  • Added a gray background to the non-mobile version.
src/components/MarketInfo/MarketInfo.tsx
Refactored the PositionsSidebar component to remove unnecessary conditional rendering and improve styling.
  • Removed the isOpen prop from the component's props.
  • Removed conditional class names related to the isOpen prop.
  • Adjusted padding and margins for better spacing.
  • Removed absolute positioning and transform properties.
  • Removed z-index property.
src/components/PositionsSidebar/PositionsSidebar.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

github-actions bot commented Feb 19, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ahmadtaimoor-deriv - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The grid-template-columns style in MainLayout.tsx might benefit from using the fr unit instead of pixels for better responsiveness.
  • Consider extracting the class names in MarketInfo.tsx into constants for better maintainability.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

cloudflare-workers-and-pages bot commented Feb 19, 2025

Deploying champion-trader with  Cloudflare Pages  Cloudflare Pages

Latest commit: 622b9e1
Status:🚫  Build failed.

View logs

@ahmadtaimoor-deriv ahmadtaimoor-deriv changed the title F UI fixes Contract Detail Desktop View and UI Fixes Feb 19, 2025
@ahmadtaimoor-deriv ahmadtaimoor-deriv merged commit 27310e7 into master Feb 19, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant