File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/components/description Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { 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
59const 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
1522Description . defaultProps = {
@@ -18,7 +25,7 @@ Description.defaultProps = {
1825
1926Description . propTypes = {
2027 text : string . isRequired ,
21- variant : oneOf ( [ 'subtitle' , 'description' ] ) ,
28+ variant : oneOf ( [ 'subtitle' , 'description' , 'descriptionSubtitle' ] ) ,
2229} ;
2330
2431export default Description ;
You can’t perform that action at this time.
0 commit comments