File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
src/components/functionalitiesModule Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ const FunctionalitiesModuleStandAloneComponent = (
23
23
const mergeList = ( ) : ListOptionsOptionType [ ] => {
24
24
return (
25
25
props . sections ?. reduce ( ( prev : ListOptionsOptionType [ ] , current ) => {
26
- return [ ...prev , ...current . options ] ;
26
+ const currentOptions = current . options ? current . options : [ ] ;
27
+ return [ ...prev , ...currentOptions ] ;
27
28
} , [ ] ) ?? [ ]
28
29
) ;
29
30
} ;
@@ -61,7 +62,7 @@ const FunctionalitiesModuleStandAloneComponent = (
61
62
content = { section . optionsContent }
62
63
dataTestId = { `${ props . dataTestId } ListOptions` }
63
64
optionVariant = { props . styles . listOptions . optionVariant }
64
- options = { section . options }
65
+ options = { section . options || [ ] }
65
66
selectedValue = { props . selectedValue }
66
67
title = { { component : TextComponentType . H6 , ...section . optionsTitle } }
67
68
type = { ListOptionsType . NAVIGATION }
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ export const SECTIONS: FunctionalitiesModuleSectionType[] = [
8
8
content : 'Tab 1' ,
9
9
} ,
10
10
options : [
11
- {
12
- label : 'option 0 (disabled)' ,
13
- disabled : true ,
14
- value : '0' ,
15
- } ,
11
+ // {
12
+ // label: 'option 0 (disabled)',
13
+ // disabled: true,
14
+ // value: '0',
15
+ // },
16
16
] ,
17
17
} ,
18
18
{
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export type FunctionalitiesModuleActionBottomSheetType = Omit<
21
21
22
22
export type FunctionalitiesModuleSectionType = {
23
23
tab : PrimaryTabTabType ;
24
- options : Omit < ListOptionsOptionType , 'highlighted' > [ ] ;
24
+ options ? : Omit < ListOptionsOptionType , 'highlighted' > [ ] ;
25
25
optionsTitle ?: ListOptionsTitleType ;
26
26
optionsContent ?: ReactNode ;
27
27
} ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const getDefaultTabSeleted = (
5
5
sections ?: FunctionalitiesModuleSectionType [ ]
6
6
) : number => {
7
7
const tab = sections ?. findIndex ( section =>
8
- section . options . some ( option => option . value === selectedValue )
8
+ section . options ? .some ( option => option . value === selectedValue )
9
9
) ;
10
10
return tab && tab >= 0 ? tab : 0 ;
11
11
} ;
You can’t perform that action at this time.
0 commit comments