Skip to content

Commit

Permalink
v11.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Jun 16, 2023
1 parent 4d78a41 commit 895f709
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 20 deletions.
6 changes: 3 additions & 3 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Gleap.setApiUrl("http://0.0.0.0:9000");

Gleap.setLanguage("de");

Gleap.initialize("zhkMPoY1k41yhOus4BRwVKE7Qas5zbyA");
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
//Gleap.setEnvironment("dev");

/*Gleap.setUrlHandler((url, newTab) => {
Expand All @@ -27,14 +27,14 @@ Gleap.attachCustomData({
},
});

Gleap.identify("@testinglukasaa", {
/*Gleap.identify("@testinglukasaa", {
name: "Max Doe",
email: "[email protected]",
value: 1234,
phone: "+49123456789",
testing: { "fun": 1123 },
luki: 19283
});
});*/

Gleap.log("Test log");
Gleap.log("Test log info", "INFO");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "10.5.0",
"version": "11.0.0",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
4 changes: 2 additions & 2 deletions src/GleapFrameManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { widgetMaxHeight } from "./UI";
import { runFunctionWhenDomIsReady } from "./GleapHelper";

export default class GleapFrameManager {
frameUrl = "https://messenger.gleap.io";
frameUrl = "https://messenger-app.gleap.io";
gleapFrameContainer = null;
gleapFrame = null;
injectedFrame = false;
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class GleapFrameManager {

autoWhiteListCookieManager = () => {
if (window && window.cmp_block_ignoredomains) {
window.cmp_block_ignoredomains.concat(["messenger.gleap.io"]);
window.cmp_block_ignoredomains.concat(["messenger-app.gleap.io"]);
}
};

Expand Down
24 changes: 16 additions & 8 deletions src/GleapNotificationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,28 @@ export default class GleapNotificationManager {
};

if (notification.data.news) {
const renderDescription = () => {
if (notification.data.previewText && notification.data.previewText.length > 0) {
return `<div class="gleap-notification-item-news-preview">${notification.data.previewText}</div>`;
}

return `${notification.data.sender ? `
<div class="gleap-notification-item-news-sender">
${notification.data.sender.profileImageUrl &&
`<img src="${notification.data.sender.profileImageUrl}" />`
} ${notification.data.sender.name}</div>`
: ""
}`;
};

// News preview
elem.className = "gleap-notification-item-news";
elem.innerHTML = `
<div class="gleap-notification-item-news-container">
${notification.data.coverImageUrl ? `<img class="gleap-notification-item-news-image" src="${notification.data.coverImageUrl}" />` : ''}
${notification.data.coverImageUrl && notification.data.coverImageUrl !== "" && !notification.data.coverImageUrl.includes("NewsImagePlaceholder") ? `<img class="gleap-notification-item-news-image" src="${notification.data.coverImageUrl}" />` : ''}
<div class="gleap-notification-item-news-content">
<div class="gleap-notification-item-news-content-title">${content}</div>
${notification.data.sender ? `
<div class="gleap-notification-item-news-sender">
${notification.data.sender.profileImageUrl &&
`<img src="${notification.data.sender.profileImageUrl}" />`
} ${notification.data.sender.name}</div>`
: ""
}
${renderDescription()}
</div>
</div>`;
} else {
Expand Down
27 changes: 21 additions & 6 deletions src/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,24 +340,39 @@ export const injectStyledCSS = (
padding: 15px;
}
.gleap-notification-item-news-preview {
color: ${subTextColor};
font-size: 15px;
line-height: 21px;
font-weight: 400;
overflow-wrap: break-word;
word-break: break-word;
display: block;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.gleap-notification-item-news-sender {
display: flex;
align-items: center;
color: ${subTextColor};
font-size: 14px;
font-size: 15px;
line-height: 21px;
font-weight: 400;
}
.gleap-notification-item-news-content-title {
font-size: 14px;
color: ${contrastBackgroundColor};
font-size: 15px;
font-weight: 500;
line-height: 18px;
line-height: 21px;
margin-bottom: 6px;
max-width: 100%;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: ${contrastBackgroundColor};
}
.gleap-notification-item-news-sender img {
Expand Down

0 comments on commit 895f709

Please sign in to comment.