@@ -4,6 +4,9 @@ const thumbsImage = require('../images/thumbs.png')
44const commentsImage = require ( '../images/comments.png' )
55const dummyUserImage = require ( '../images/dummyUser.png' )
66
7+ const browserType = process . env . browser || 'chrome'
8+ const utmVal = ( browserType === 'chrome' ) ? 'chrome_extension' : 'FF_extension'
9+
710export class PostCard extends Component {
811 getReplacedImage ( src ) {
912 var newSrc = 'https://cdn.hashnode.com/res/hashnode/image/upload/'
@@ -34,7 +37,7 @@ export class PostCard extends Component {
3437 < a
3538 href = { `https://hashnode.com/post/${ post . slug } -${
3639 post . cuid
37- } ?utm_source=chrome_extension &utm_medium=extension`}
40+ } ?utm_source=${ utmVal } &utm_medium=extension`}
3841 target = '_blank'
3942 >
4043 < img className = 'post-cover' src = { post . coverImage } width = '100%' />
@@ -44,19 +47,19 @@ export class PostCard extends Component {
4447 < a
4548 href = { `https://hashnode.com/post/${ post . slug } -${
4649 post . cuid
47- } ?utm_source=chrome_extension &utm_medium=extension`}
50+ } ?utm_source=${ utmVal } &utm_medium=extension`}
4851 target = '_blank'
4952 >
5053 < h3 className = 'post-title' > { post . title } </ h3 >
51- < p className = 'post-desc' > { post . brief . substring ( 0 , 140 ) } ...</ p >
54+ { post . brief && < p className = 'post-desc' > { post . brief . substring ( 0 , 140 ) } ...</ p > }
5255 </ a >
5356 < div className = 'post-footer' >
5457 < a
5558 href = { `${
5659 post . author
5760 ? 'https://hashnode.com/@' +
5861 post . author . username +
59- ' ?utm_source=chrome_extension &utm_medium=extension'
62+ ` ?utm_source=${ utmVal } &utm_medium=extension`
6063 : ''
6164 } `}
6265 target = '_blank'
@@ -77,7 +80,7 @@ export class PostCard extends Component {
7780 < a
7881 href = { `https://hashnode.com/post/${ post . slug } -${
7982 post . cuid
80- } ?utm_source=chrome_extension &utm_medium=extension`}
83+ } ?utm_source=${ utmVal } &utm_medium=extension`}
8184 target = '_blank'
8285 className = 'reactions'
8386 >
@@ -87,7 +90,7 @@ export class PostCard extends Component {
8790 < a
8891 href = { `https://hashnode.com/post/${ post . slug } -${
8992 post . cuid
90- } ?utm_source=chrome_extension &utm_medium=extension`}
93+ } ?utm_source=${ utmVal } &utm_medium=extension`}
9194 target = '_blank'
9295 className = 'comments'
9396 >
0 commit comments