File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed
src/Shared/Components/TabGroup Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,23 @@ const Tab = ({
41
41
}
42
42
const { tabClassName, iconClassName, badgeClassName } = getClassNameBySize ( )
43
43
44
+ const getIconColorClass = ( ) => {
45
+ if ( iconType === 'fill' ) {
46
+ return `tab-group__tab__icon--fill ${ active ? 'fcb-5' : 'fcn-7' } `
47
+ }
48
+ if ( iconType === 'stroke' ) {
49
+ return `tab-group__tab__icon--stroke ${ active ? 'scb-5' : 'scn-7' } `
50
+ }
51
+
52
+ return ''
53
+ }
54
+
44
55
const getTabComponent = ( ) => {
45
56
const content = (
46
57
< >
47
58
{ showError && < ICErrorExclamation className = { `${ iconClassName } ` } /> }
48
- { ! showError && showWarning && < ICWarning className = { `${ iconClassName } tab-group__tab__warning-icon` } /> }
49
- { ! showError && ! showWarning && Icon && (
50
- < Icon
51
- className = { `${ iconClassName } ${ iconType === 'fill' ? 'tab-group__tab__icon--fill' : 'tab-group__tab__icon--stroke' } ${ ( active && ( iconType === 'fill' ? 'fcb-5' : 'scb-5' ) ) || ( iconType === 'fill' ? 'fcn-7' : 'scn-7' ) } ` }
52
- />
53
- ) }
59
+ { ! showError && showWarning && < ICWarning className = { `${ iconClassName } warning-icon-y7` } /> }
60
+ { ! showError && ! showWarning && Icon && < Icon className = { `${ iconClassName } ${ getIconColorClass ( ) } ` } /> }
54
61
{ label }
55
62
{ badge !== null && (
56
63
< div className = { `tab-group__tab__badge ${ badgeClassName } bcn-1 flex cn-7` } > { badge } </ div >
Original file line number Diff line number Diff line change 2
2
list-style : none ;
3
3
4
4
& __tab {
5
+ $parent-selector : &;
5
6
position : relative ;
6
7
7
8
& ::after {
23
24
& :hover {
24
25
color : var (--B500 );
25
26
26
- .tab-group__tab__icon {
27
+ #{ $parent-selector } __ icon {
27
28
& --stroke {
28
29
stroke : var (--B500 );
29
30
61
62
border-radius : 100% ;
62
63
}
63
64
64
- & __warning-icon {
65
- > g path :nth-of-type (2 ) {
66
- fill : var (--Y700 );
67
- }
68
- }
69
-
70
65
& __nav-link {
71
66
& .active {
72
67
color : var (--B500 );
73
68
font-weight : 600 ;
74
69
75
- > .tab-group__tab__icon --fill {
70
+ > #{ $parent-selector } __ icon --fill {
76
71
fill : var (--B500 );
77
72
78
73
path {
79
74
fill : var (--B500 );
80
75
}
81
76
}
82
77
83
- > .tab-group__tab__icon --stroke {
78
+ > #{ $parent-selector } __ icon --stroke {
84
79
stroke : var (--B500 );
85
80
86
81
path {
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export interface TabGroupProps {
104
104
/**
105
105
* Optional component to be rendered on the right side of the tab list.
106
106
*/
107
- rightComponent ?: React . ReactNode
107
+ rightComponent ?: React . ReactElement
108
108
/**
109
109
* Set to `true` to align the active tab's border with the bottom border of the parent container.
110
110
* @default false
You can’t perform that action at this time.
0 commit comments