File tree Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change
1
+ import React , { useEffect } from 'react' ;
2
+ interface Props { }
3
+
4
+ function RelatedPostAd ( props : Props ) {
5
+ useEffect ( ( ) => {
6
+ ( window . adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
7
+ } , [ ] ) ;
8
+
9
+ return (
10
+ < ins
11
+ className = "adsbygoogle"
12
+ style = { { display : 'block' } }
13
+ data-ad-format = "fluid"
14
+ data-ad-layout-key = "-7q+de+1z+n+3"
15
+ data-ad-client = "ca-pub-5574866530496701"
16
+ data-ad-slot = "9497725960"
17
+ > </ ins >
18
+ ) ;
19
+ }
20
+
21
+ export default RelatedPostAd ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { userThumbnail } from '../../static/images';
13
13
import { Link } from 'react-router-dom' ;
14
14
import gtag from '../../lib/gtag' ;
15
15
import optimizeImage from '../../lib/optimizeImage' ;
16
+ import RelatedPostAd from './RelatedPostAd' ;
16
17
// import { detectAnyAdblocker } from 'just-detect-adblock';
17
18
18
19
function RelatedPostsForGuest ( {
@@ -83,14 +84,7 @@ function RelatedPostsForGuest({
83
84
</ Item >
84
85
) : (
85
86
< Item >
86
- < ins
87
- className = "adsbygoogle"
88
- style = { { display : 'block' } }
89
- data-ad-format = "fluid"
90
- data-ad-layout-key = "-7p+de+1x+n+9"
91
- data-ad-client = "ca-pub-5574866530496701"
92
- data-ad-slot = "9497725960"
93
- > </ ins >
87
+ < RelatedPostAd />
94
88
</ Item >
95
89
) ,
96
90
) }
@@ -114,8 +108,8 @@ const Wrapper = styled(VelogResponsive)`
114
108
` ;
115
109
116
110
const Grid = styled . div `
117
- margin-left: -0.5rem ;
118
- margin-right: -0.5rem ;
111
+ margin-left: -1rem ;
112
+ margin-right: -1rem ;
119
113
display: flex;
120
114
flex-wrap: wrap;
121
115
margin-top: 1.5rem;
@@ -124,8 +118,8 @@ const Grid = styled.div`
124
118
const Item = styled . div `
125
119
position: relative;
126
120
width: 33.333%;
127
- padding-left: 0.5rem ;
128
- padding-right: 0.5rem ;
121
+ padding-left: 0.25rem ;
122
+ padding-right: 0.25rem ;
129
123
padding-bottom: 2rem;
130
124
${ media . medium } {
131
125
width: 50%;
You can’t perform that action at this time.
0 commit comments