Skip to content

Commit 474416b

Browse files
author
Kubit
committed
Change text prop to NavigationRow component
Now text component is not mandatory
1 parent 95db14e commit 474416b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/components/navigationRow/navigationRowStandAlone.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ const NavigationRowStandaloneComponent = (
5353
)}
5454
</IconAndIconHighlightedContainerStyled>
5555
<TextSectionStyled styles={props.styles}>
56-
<Text
57-
component={TextComponentType.SPAN}
58-
customTypography={props.styles.text}
59-
dataTestId={`${dataTestId}Text`}
60-
{...props.text}
61-
>
62-
{props.text.content}
63-
</Text>
56+
{props.text && (
57+
<Text
58+
component={TextComponentType.SPAN}
59+
customTypography={props.styles.text}
60+
dataTestId={`${dataTestId}Text`}
61+
{...props.text}
62+
>
63+
{props.text.content}
64+
</Text>
65+
)}
6466
<Text
6567
component={TextComponentType.SPAN}
6668
customTypography={props.styles.description}
@@ -70,6 +72,7 @@ const NavigationRowStandaloneComponent = (
7072
{props.description?.content}
7173
</Text>
7274
</TextSectionStyled>
75+
7376
<ElementOrIcon
7477
customIconStyles={props.styles.arrowIcon}
7578
dataTestId={`${dataTestId}ArrowIcon`}

src/components/navigationRow/types/navigationRow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type NavigationRowIconHighlightedType = Omit<IIconHighlighted, 'variant'
2121

2222
export interface INavigationRowStandAlone {
2323
styles: NavigationRowStylesPropsType;
24-
text: NavigationRowTextAndDescriptionType;
24+
text?: NavigationRowTextAndDescriptionType;
2525
description?: NavigationRowTextAndDescriptionType;
2626
// icons
2727
arrowIcon: IElementOrIcon;

0 commit comments

Comments
 (0)