Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #267 from deriv-com/hasan/live-market-card-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-deriv authored Dec 15, 2023
2 parents 47f6eb9 + b2b419b commit 0b7244f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
18 changes: 13 additions & 5 deletions libs/components/src/lib/card/live-market/buy-sell.buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { Text, TradeButton } from '@deriv/quill-design';
import { MarketStatus } from '../types';

export type BuySellButtonsProps = {
status: MarketStatus;
spread: string;
textClass: string;
onClickBuyButton?: () => void;
onClickSellButton?: () => void;
};

export const BuySellButtons = ({
status,
spread,
textClass,
}: {
status: MarketStatus;
spread: string;
textClass: string;
}) => {
onClickBuyButton,
onClickSellButton,
}: BuySellButtonsProps) => {
return (
<div className="flex flex-col gap-gap-md">
<div className="flex flex-row gap-gap-md">
Expand All @@ -26,6 +32,7 @@ export const BuySellButtons = ({
variant="secondary"
disabled={status === 'closed'}
className="flex-1"
onClick={onClickBuyButton}
>
Buy
</TradeButton>
Expand All @@ -34,6 +41,7 @@ export const BuySellButtons = ({
variant="secondary"
disabled={status === 'closed'}
className="flex-1"
onClick={onClickSellButton}
>
Sell
</TradeButton>
Expand Down
4 changes: 4 additions & 0 deletions libs/components/src/lib/card/live-market/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const LiveMarketCard: React.FC<LiveMarketCardProps> = ({
bidPrice,
askPrice,
spread,
onClickBuyButton,
onClickSellButton,
}) => {
const textClassName =
status === 'closed'
Expand Down Expand Up @@ -101,6 +103,8 @@ export const LiveMarketCard: React.FC<LiveMarketCardProps> = ({
status={status}
spread={spread}
textClass={textClassName}
onClickBuyButton={onClickBuyButton}
onClickSellButton={onClickSellButton}
/>
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions libs/components/src/lib/card/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ export interface LiveMarketContent {
bidPrice: string;
askPrice: string;
spread: string;
onClickBuyButton?: () => void;
onClickSellButton?: () => void;
}

0 comments on commit 0b7244f

Please sign in to comment.