@@ -35,9 +35,8 @@ import { toast } from 'react-toastify';
35
35
import MobileLikeButton from '../../components/post/MobileLikeButton' ;
36
36
import RelatedPost from './RelatedPost' ;
37
37
import optimizeImage from '../../lib/optimizeImage' ;
38
- import RelatedPostsForGuest from './RelatedPostsForGuest' ;
39
- import HorizontalAd from './HorizontalAd' ;
40
38
import { useSetShowFooter } from '../../components/velog/VelogPageTemplate' ;
39
+ import HorizontalBanner from './HorizontalBanner' ;
41
40
42
41
const UserProfileWrapper = styled ( VelogResponsive ) `
43
42
margin-top: 16rem;
@@ -323,7 +322,7 @@ const PostViewer: React.FC<PostViewerProps> = ({
323
322
324
323
const isVeryOld =
325
324
Date . now ( ) - new Date ( post . released_at ) . getTime ( ) >
326
- 1000 * 60 * 60 * 24 * 365 ;
325
+ 1000 * 60 * 60 * 24 * 180 ;
327
326
328
327
const url = `https://velog.io/@${ username } /${ post . url_slug } ` ;
329
328
@@ -389,6 +388,7 @@ const PostViewer: React.FC<PostViewerProps> = ({
389
388
/>
390
389
}
391
390
/>
391
+ { userId === null && isVeryOld ? < HorizontalBanner /> : null }
392
392
< PostContent isMarkdown = { post . is_markdown } body = { post . body } />
393
393
< UserProfileWrapper >
394
394
< UserProfile
@@ -400,7 +400,7 @@ const PostViewer: React.FC<PostViewerProps> = ({
400
400
/>
401
401
</ UserProfileWrapper >
402
402
< LinkedPostList linkedPosts = { post . linked_posts } />
403
- { showRecommends && userId === null && ! isVeryOld && (
403
+ { /* { showRecommends && userId === null && !isVeryOld && (
404
404
<RelatedPostsForGuest
405
405
postId={post.id}
406
406
showAds={
@@ -410,15 +410,18 @@ const PostViewer: React.FC<PostViewerProps> = ({
410
410
// 1000 * 60 * 60 * 24 * 21
411
411
}
412
412
/>
413
- ) }
414
- { /* {isVeryOld && userId === null && <HorizontalAd />} */ }
413
+ )} */ }
414
+ { userId === null && isVeryOld && post . body . length > 300 ? (
415
+ < HorizontalBanner />
416
+ ) : null }
417
+
415
418
< PostComments
416
419
count = { post . comments_count }
417
420
comments = { post . comments }
418
421
postId = { post . id }
419
422
ownPost = { post . user . id === userId }
420
423
/>
421
- { showRecommends && ( userId !== null || isVeryOld ) && (
424
+ { /* { showRecommends && (userId !== null || isVeryOld) && (
422
425
<RelatedPost
423
426
postId={post.id}
424
427
showAds={
@@ -429,7 +432,8 @@ const PostViewer: React.FC<PostViewerProps> = ({
429
432
// 1000 * 60 * 60 * 24 * 30
430
433
}
431
434
/>
432
- ) }
435
+ )} */ }
436
+ { showRecommends ? < RelatedPost postId = { post . id } showAds = { false } /> : null }
433
437
</ PostViewerProvider >
434
438
) ;
435
439
} ;
0 commit comments