Skip to content

Commit 8cd9547

Browse files
committed
Add DescriptionSubtitle variant
1 parent a3dccef commit 8cd9547

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import React from 'react';
22
import { string, oneOf } from 'prop-types';
3-
import { Subtitle, DescriptionText } from '../../styles/main';
3+
import {
4+
Subtitle,
5+
DescriptionText,
6+
DescriptionSubtitle,
7+
} from '../../styles/main';
48

59
const Description = (props) => {
610
const { variant, text } = props;
711

8-
return variant === 'subtitle' ? (
9-
<Subtitle>{text}</Subtitle>
10-
) : (
11-
<DescriptionText>{text}</DescriptionText>
12-
);
12+
switch (variant) {
13+
case 'subtitle':
14+
return <Subtitle>{text}</Subtitle>;
15+
case 'descriptionSubtitle':
16+
return <DescriptionSubtitle>{text}</DescriptionSubtitle>;
17+
default:
18+
return <DescriptionText>{text}</DescriptionText>;
19+
}
1320
};
1421

1522
Description.defaultProps = {
@@ -18,7 +25,7 @@ Description.defaultProps = {
1825

1926
Description.propTypes = {
2027
text: string.isRequired,
21-
variant: oneOf(['subtitle', 'description']),
28+
variant: oneOf(['subtitle', 'description', 'descriptionSubtitle']),
2229
};
2330

2431
export default Description;

0 commit comments

Comments
 (0)