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

Ahmed/chore add quill UI #6

Merged
merged 11 commits into from
Jan 4, 2025

Conversation

ahmed-deriv
Copy link
Collaborator

@ahmed-deriv ahmed-deriv commented Jan 3, 2025

Summary by Sourcery

New Features:

  • Introduce a new trading panel UI with controls for duration, stake, and trade type selection.

@ashkan-deriv
Copy link

@sourcery-ai review

Copy link

sourcery-ai bot commented Jan 3, 2025

Reviewer's Guide by Sourcery

This pull request implements a new trading UI using Quill UI components. It replaces the old DerivTrading component with a new implementation that includes a trading panel for setting trade parameters and a chart for displaying market data. The update also includes UI changes to the overall layout and styling.

Class diagram for the trading components structure

classDiagram
    class ChartProps {
        +string symbol
        +boolean chartStatus
        +boolean showChart
        +onChartStatusChange(status: boolean)
        +onSymbolChange(symbol: string)
    }

    class ChartSettings {
        +boolean assetInformation
        +boolean countdown
        +boolean isHighestLowestMarkerEnabled
        +string language
        +string position
        +string theme
    }

    class TradingPanelProps {
        +number duration
        +number stake
        +boolean allowEquals
        +DurationTabValue selectedDurationTab
        +StakeTabValue selectedStakeTab
        +onDurationChange(value: string)
        +onStakeChange(value: string)
        +onAllowEqualsChange(e: Event)
        +onDurationTabChange(tab: DurationTabValue)
        +onStakeTabChange(tab: StakeTabValue)
    }

    class TabProps~T~ {
        +Array~TabItem~ tabs
        +T activeTab
        +onChange(value: T)
    }

    TradingPanelProps ..> TabProps
    Chart ..> ChartSettings
    Chart ..> ChartProps
Loading

File-Level Changes

Change Details Files
Implement Trading Panel UI
  • Created a new TradingPanel component with UI elements for setting trade parameters such as duration, stake, and trade type.
  • Added styling for the TradingPanel component.
  • Integrated TradingPanel into DerivTrading component.
  • Defined types for TradingPanel props and related data structures.
src/components/TradingComponents/TradingPanel/TradingPanel.tsx
src/components/TradingComponents/TradingPanel/TradingPanel.scss
src/features/DerivTrading.tsx
src/components/TradingComponents/types.ts
Implement Chart UI
  • Created a new Chart component using SmartChart from deriv-charts.
  • Added styling for the Chart component.
  • Integrated Chart into DerivTrading component.
  • Defined types for Chart props and related data structures.
src/components/TradingComponents/Chart/Chart.tsx
src/components/TradingComponents/Chart/Chart.scss
src/features/DerivTrading.tsx
src/components/TradingComponents/types.ts
Update App and DerivTrading Components
  • Updated App component to use Quill UI ThemeProvider and remove old header and styling.
  • Refactored DerivTrading component to use new Chart and TradingPanel components.
  • Updated TradingPage to render the new DerivTrading component.
  • Removed old DerivTrading component and related styling.
src/App.tsx
src/features/DerivTrading.tsx
src/pages/trading/index.tsx
src/components/TradingComponents/DerivTrading.tsx
Add Quill UI and Icons
  • Added Quill UI and Icons packages to project dependencies.
  • Used Quill UI components in App.tsx for theming and layout.
  • Used Quill UI components in TradingPanel for UI elements.
  • Used Quill Icons in TradingPanel for trade type icons.
package.json
package-lock.json
src/App.tsx
src/components/TradingComponents/TradingPanel/TradingPanel.tsx
Add Tab Component
  • Created a new Tab component for switching between different trade options.
  • Added styling for the Tab component.
  • Created an index file to export the Tab component.
  • Integrated Tab component into TradingPanel.
  • Defined types for Tab props.
src/components/TradingComponents/Tab/Tab.tsx
src/components/TradingComponents/Tab/Tab.scss
src/components/TradingComponents/Tab/index.ts
src/components/TradingComponents/TradingPanel/TradingPanel.tsx
src/components/TradingComponents/types.ts
Update Deriv API Service
  • Minor updates to DerivAPIService, possibly related to handling API requests.
src/services/deriv-api.service.ts
Add New Files and Remove Old Files
  • Added new assets and type definitions.
  • Removed old styling and component files related to the previous implementation.
src/assets/accumulator-icon.svg
src/App.scss
src/components/LoadingSpinner/LoadingSpinner.scss
src/components/LoadingSpinner/LoadingSpinner.tsx
src/components/TradingComponets/DerivTrading.scss
src/types/svg.d.ts

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

@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 @ahmed-deriv - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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.

@mayuran-deriv mayuran-deriv merged commit 08852c0 into deriv-com:master Jan 4, 2025
1 check 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.

3 participants