Skip to content

Commit 1c983b7

Browse files
author
Kubit
committed
Delete prop content from Text component
1 parent 89e9c0d commit 1c983b7

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/components/snackbar/snackbarStandAlone.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,25 @@ const SnackbarStandAloneComponent = (
6363
</SnackbarLinkWrapper>
6464
);
6565

66-
const buildDescription = () =>
67-
props.description?.content &&
68-
(props.styles?.description?.font_variant || props.description.variant) && (
69-
<SnackbarDescriptionWrapper styles={props.styles}>
70-
<Text
71-
component={TextComponentType.PARAGRAPH}
72-
customTypography={props.styles?.description}
73-
dataTestId={`${props.dataTestId}Description`}
74-
{...props.description}
75-
>
76-
{props.description?.content}
77-
</Text>
78-
</SnackbarDescriptionWrapper>
66+
const buildDescription = () => {
67+
const { content, ...restDescriptionProps } = props.description || {};
68+
69+
return (
70+
content &&
71+
(props.styles?.description?.font_variant || props.description?.variant) && (
72+
<SnackbarDescriptionWrapper styles={props.styles}>
73+
<Text
74+
component={TextComponentType.PARAGRAPH}
75+
customTypography={props.styles?.description}
76+
dataTestId={`${props.dataTestId}Description`}
77+
{...restDescriptionProps}
78+
>
79+
{content}
80+
</Text>
81+
</SnackbarDescriptionWrapper>
82+
)
7983
);
84+
};
8085

8186
return (
8287
<Popover

src/components/text/textStandAlone.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const TextStandAloneComponent = (
3232
$transform={transform}
3333
align={align}
3434
as={component}
35+
content={undefined}
3536
data-testid={dataTestId}
3637
htmlFor={htmlFor}
3738
id={id}

0 commit comments

Comments
 (0)