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

Commit

Permalink
Merge branch 'main' into Jia/update-block-title-max-width
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-deriv authored Dec 20, 2023
2 parents ca6f7f0 + da4ca9e commit 17d5163
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 21 deletions.
2 changes: 2 additions & 0 deletions libs/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.53.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.52.0...blocks-0.53.0) (2023-12-20)

## [0.52.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.51.0...blocks-0.52.0) (2023-12-18)


Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deriv-com/blocks",
"version": "0.52.0",
"version": "0.53.0",
"main": "./index.js",
"exports": {
".": {
Expand Down
8 changes: 4 additions & 4 deletions libs/blocks/src/lib/live-market/tab/tab.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const Default: Story = {
disclaimer="*Prices are used for currency conversion and are published for reference only. Prices shown on our website are indicative and for reference only."
link={{ href: '/', content: 'More forex' }}
tabs={[
{ children: 'Forex' },
{ children: 'Derived Indices' },
{ children: 'Etfs' },
{ content: 'Forex' },
{ content: 'Derived Indices' },
{ content: 'Etfs' },
]}
>
<CardSlider
Expand All @@ -50,7 +50,7 @@ export const Default: Story = {
{
id: 1,
instrumentIcon: <MarketForexGbpusdIcon />,
instrument: 'GBP/USD',
instrument: 'EUR/USD DFX 10 Index',
changePercentage: '+0.11%',
status: 'down',
bidPrice: '1.24112',
Expand Down
6 changes: 1 addition & 5 deletions libs/blocks/src/lib/platform/tab/tab.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ export const Default: Story = {
header="Header here"
description="desciption here description here"
className="bg-background-primary-base"
tabs={[
{ children: 'All' },
{ children: 'CFDs' },
{ children: 'Options' },
]}
tabs={[{ content: 'All' }, { content: 'CFDs' }, { content: 'Options' }]}
>
<CardsContainer
cols="three"
Expand Down
2 changes: 2 additions & 0 deletions libs/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.33.0](https://github.com/deriv-com/deriv-com-v2/compare/components-0.32.0...components-0.33.0) (2023-12-20)

## [0.32.0](https://github.com/deriv-com/deriv-com-v2/compare/components-0.31.0...components-0.32.0) (2023-12-20)


Expand Down
2 changes: 1 addition & 1 deletion libs/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deriv-com/components",
"version": "0.32.0",
"version": "0.33.0",
"main": "./index.js",
"exports": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions libs/components/src/lib/card/live-market/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export const LiveMarketCard: React.FC<LiveMarketCardProps> = ({
className={qtMerge(
'flex flex-col',
'rounded-xl',
'h-[262px] w-[286px]',
'h-[284px] w-[296px]',
'bg-background-primary-container',
'p-general-xl',
'gap-gap-xl',
className,
)}
>
<div className="flex h-[52px] flex-row gap-gap-sm">
<div className="flex h-[52px] shrink-0 grow flex-row gap-gap-sm">
<div className="flex flex-1 flex-row gap-gap-md">
<div className={clsx(status === 'closed' && 'opacity-600')}>
{instrumentIcon}
Expand Down
18 changes: 13 additions & 5 deletions libs/components/src/lib/tab/base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import {
cloneElement,
isValidElement,
} from 'react';
import { Tab } from '@deriv/quill-design';
import { Tab, qtJoin } from '@deriv/quill-design';

type TabTrigger = Omit<ComponentProps<typeof Tab.Trigger>, 'children'> & {
content: ReactNode;
};

export interface TabProps {
tabs: ComponentProps<typeof Tab.Trigger>[];
tabs: TabTrigger[];
className?: string;
children: ReactNode;
}
Expand All @@ -17,9 +21,13 @@ export const TabBase = ({ tabs, children, className }: TabProps) => {
return (
<Tab.Container className={className}>
<Tab.List>
{tabs.map(({ children, ...rest }, i) => (
<Tab.Trigger {...rest} key={i}>
{children}
{tabs.map(({ content, className, ...rest }, i) => (
<Tab.Trigger
className={qtJoin('whitespace-nowrap', className)}
{...rest}
key={i}
>
{content}
</Tab.Trigger>
))}
</Tab.List>
Expand Down
6 changes: 3 additions & 3 deletions libs/components/src/lib/tab/base/tab.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const Default: Story = {
return (
<Tab.Base
tabs={[
{ children: 'Home' },
{ children: 'Profile' },
{ children: 'Contact' },
{ content: 'Home' },
{ content: 'Profile' },
{ content: 'Contact' },
]}
>
<div>Home Tab</div>
Expand Down

0 comments on commit 17d5163

Please sign in to comment.