Skip to content

Commit

Permalink
post page add dlive ads
Browse files Browse the repository at this point in the history
  • Loading branch information
leon9665 committed Jul 7, 2020
1 parent 244aaa7 commit cdf7710
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/app/components/pages/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { INVEST_TOKEN_UPPERCASE } from 'app/client_config';
import { SIGNUP_URL } from 'shared/constants';
import GptAd from 'app/components/elements/GptAd';
import { isLoggedIn } from 'app/utils/UserUtil';
import { recordAdsView } from 'app/utils/ServerApiClient';

import Icon from 'app/components/elements/Icon';

Expand All @@ -37,6 +38,7 @@ class Post extends React.Component {
};
constructor() {
super();
this.setRecordAdsView = this.setRecordAdsView.bind(this);
this.state = {
showNegativeComments: false,
};
Expand All @@ -60,6 +62,12 @@ class Post extends React.Component {
showAnywayClick = () => {
this.setState({ showAnyway: true });
};
setRecordAdsView() {
recordAdsView({
trackingId: this.props.trackingId,
adTag: 'SteemitDlivebanner240*240Post',
});
}

render() {
const { showSignUp } = this;
Expand Down Expand Up @@ -203,6 +211,20 @@ class Post extends React.Component {

return (
<div className="Post">
<div className="c-sidebr-ads">
<a
href="https://dlive.tv/"
target="_blank"
onClick={this.setRecordAdsView}
>
<img
src="/images/dlive.png"
alt=""
width="240"
height="240"
/>
</a>
</div>
<div className="row">
<div className="column">{postBody}</div>
</div>
Expand Down Expand Up @@ -284,12 +306,13 @@ export default connect((state, ownProps) => {
const post = username + '/' + slug;
const content = state.global.get('content');
const dis = content.get(post);

const trackingId = state.user.get('trackingId');
return {
post,
content,
dis,
sortOrder: currLocation.query.sort || 'trending',
gptEnabled: state.app.getIn(['googleAds', 'gptEnabled']),
trackingId,
};
})(Post);
11 changes: 11 additions & 0 deletions src/app/components/pages/Post.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.Post{
position: relative;
.c-sidebr-ads{
position: absolute;
left: calc(50% - 27rem);
margin-left: -255px;
@media screen and (max-width: 85rem){
display: none;
}
}
}
.Post__comments_sort_order {
margin: 0.5rem 0;
@include themify($themes) {
Expand Down

0 comments on commit cdf7710

Please sign in to comment.