Skip to content

Commit 9ea905d

Browse files
authored
feat(ui): DOMA-11427 added tabBarExtraContent styles and story (#6030)
1 parent 22692e6 commit 9ea905d

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

apps/condo/domains/billing/components/BillingPageContent/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const StyledPageWrapper = styled(PageWrapper)`
2020
height: 100%;
2121
},
2222
& .condo-tabs-nav, & .condo-tabs-nav-wrap {
23-
height: 48px;
23+
min-height: 48px;
2424
},
2525
`
2626

packages/ui/src/components/Tabs/style.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353

5454
& > .condo-tabs-nav,
5555
& > div > .condo-tabs-nav {
56+
flex-wrap: wrap;
57+
gap: @condo-global-spacing-24;
58+
5659
.condo-tabs-nav-wrap::before {
5760
width: @condo-global-spacing-40;
5861
box-shadow:

packages/ui/src/components/Tabs/tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export type TabsProps = Pick<DefaultTabsProps,
2323
'activeKey' |
2424
'destroyInactiveTabPane' |
2525
'onChange' |
26-
'tabBarExtraContent' |
2726
'centered'> & {
2827
items?: Array<TabItem>
28+
tabBarExtraContent?: React.ReactNode
2929
}
3030

3131
export const Tabs: React.FC<TabsProps> = (props) => {

packages/ui/src/stories/Tabs.stories.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22

33
import { FileText } from '@open-condo/icons'
4-
import { Tabs, Typography } from '@open-condo/ui/src'
4+
import { Tabs, Typography, Radio, RadioGroup } from '@open-condo/ui/src'
55
import type { TabItem } from '@open-condo/ui/src'
66

77
import type { Meta, StoryObj } from '@storybook/react'
@@ -11,6 +11,13 @@ export default {
1111
component: Tabs,
1212
args: {
1313
centered: false,
14+
tabBarExtraContent: false,
15+
},
16+
argTypes: {
17+
tabBarExtraContent: {
18+
control: 'boolean',
19+
description: 'Toggle to show/hide tabBarExtraContent',
20+
},
1421
},
1522
} as Meta<typeof Tabs>
1623

@@ -43,8 +50,31 @@ const simpleItems: Array<TabItem> = [
4350
},
4451
]
4552

53+
const Template: StoryObj<typeof Tabs>['render'] = (args) => {
54+
const { tabBarExtraContent, items } = args
55+
56+
const extraContent = tabBarExtraContent ? (
57+
<RadioGroup optionType='button' defaultValue='on'>
58+
<Radio key='on' value='on' label='On' />
59+
<Radio key='off' value='off' label='Off' />
60+
</RadioGroup>
61+
) : null
62+
63+
return <Tabs items={items} tabBarExtraContent={extraContent} />
64+
}
65+
4666
export const Simple: StoryObj<typeof Tabs> = {
67+
render: Template,
4768
args: {
69+
tabBarExtraContent: false,
4870
items: simpleItems,
4971
},
5072
}
73+
74+
export const WithExtraContent: StoryObj<typeof Tabs> = {
75+
render: Template,
76+
args: {
77+
tabBarExtraContent: true,
78+
items: [simpleItems[0], simpleItems[1]],
79+
},
80+
}

0 commit comments

Comments
 (0)