@@ -64,7 +64,6 @@ export default class Card extends React.PureComponent {
6464
6565 static defaultProps = {
6666 maxDescription : 50 ,
67- compact : false ,
6867 } ;
6968
7069 state = {
@@ -133,25 +132,25 @@ export default class Card extends React.PureComponent {
133132 }
134133
135134 render ( ) {
136- const { card, maxDescription, compact } = this . props ;
137- const { width, embedded } = this . state ;
135+ const { card, maxDescription } = this . props ;
136+ const { width, embedded } = this . state ;
138137
139138 if ( card === null ) {
140139 return null ;
141140 }
142141
143142 const provider = card . get ( 'provider_name' ) . length === 0 ? decodeIDNA ( getHostname ( card . get ( 'url' ) ) ) : card . get ( 'provider_name' ) ;
144- const horizontal = ( ! compact && card . get ( 'width' ) > card . get ( 'height' ) && ( card . get ( 'width' ) + 100 >= width ) ) || card . get ( 'type' ) !== 'link' || embedded ;
143+ const horizontal = card . get ( 'width' ) > card . get ( 'height' ) && ( card . get ( 'width' ) + 100 >= width ) || card . get ( 'type' ) !== 'link' ;
144+ const className = classnames ( 'status-card' , { horizontal } ) ;
145145 const interactive = card . get ( 'type' ) !== 'link' ;
146- const className = classnames ( 'status-card' , { horizontal, compact, interactive } ) ;
147146 const title = interactive ? < a className = 'status-card__title' href = { card . get ( 'url' ) } title = { card . get ( 'title' ) } rel = 'noopener' target = '_blank' > < strong > { card . get ( 'title' ) } </ strong > </ a > : < strong className = 'status-card__title' title = { card . get ( 'title' ) } > { card . get ( 'title' ) } </ strong > ;
148147 const ratio = card . get ( 'width' ) / card . get ( 'height' ) ;
149148 const height = ( compact && ! embedded ) ? ( width / ( 16 / 9 ) ) : ( width / ratio ) ;
150149
151150 const description = (
152151 < div className = 'status-card__content' >
153152 { title }
154- { ! ( horizontal || compact ) && < p className = 'status-card__description' > { trim ( card . get ( 'description' ) || '' , maxDescription ) } </ p > }
153+ { ! horizontal && < p className = 'status-card__description' > { trim ( card . get ( 'description' ) || '' , maxDescription ) } </ p > }
155154 < span className = 'status-card__host' > { provider } </ span >
156155 </ div >
157156 ) ;
@@ -176,7 +175,7 @@ export default class Card extends React.PureComponent {
176175 < div className = 'status-card__actions' >
177176 < div >
178177 < button onClick = { this . handleEmbedClick } > < i className = { `fa fa-${ iconVariant } ` } /> </ button >
179- { horizontal && < a href = { card . get ( 'url' ) } target = '_blank' rel = 'noopener' > < i className = 'fa fa-external-link' /> </ a > }
178+ < a href = { card . get ( 'url' ) } target = '_blank' rel = 'noopener' > < i className = 'fa fa-external-link' /> </ a >
180179 </ div >
181180 </ div >
182181 </ div >
@@ -186,7 +185,7 @@ export default class Card extends React.PureComponent {
186185 return (
187186 < div className = { className } ref = { this . setRef } >
188187 { embed }
189- { ! compact && description }
188+ { description }
190189 </ div >
191190 ) ;
192191 } else if ( card . get ( 'image' ) ) {
0 commit comments