Skip to content

Commit 9dd7536

Browse files
committed
v12.1.0
1 parent 446c47e commit 9dd7536

File tree

5 files changed

+106
-7
lines changed

5 files changed

+106
-7
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/12.1.0/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GleapNotificationManager.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ export default class GleapNotificationManager {
155155
return `${notification.data.sender ? `
156156
<div class="gleap-notification-item-news-sender">
157157
${notification.data.sender.profileImageUrl &&
158-
`<img src="${notification.data.sender.profileImageUrl}" />`
159-
} ${notification.data.sender.name}</div>`
160-
: ""
161-
}`;
158+
`<img src="${notification.data.sender.profileImageUrl}" />`
159+
} ${notification.data.sender.name}</div>`
160+
: ""
161+
}`;
162162
};
163163

164164
// News preview
@@ -171,6 +171,29 @@ export default class GleapNotificationManager {
171171
${renderDescription()}
172172
</div>
173173
</div>`;
174+
} else if (notification.data.checklist) {
175+
var progress = Math.round(notification.data.currentStep / notification.data.totalSteps * 100);
176+
if (progress < 100) {
177+
progress += 4;
178+
}
179+
180+
// News preview
181+
elem.className = "gleap-notification-item-checklist";
182+
elem.innerHTML = `
183+
<div class="gleap-notification-item-checklist-container">
184+
<div class="gleap-notification-item-checklist-content">
185+
<div class="gleap-notification-item-checklist-content-title">${notification.data.text}</div>
186+
<div class="gleap-notification-item-checklist-content-progress">
187+
<div class="gleap-notification-item-checklist-content-progress-inner" style="width: ${progress}%;"></div>
188+
</div>
189+
<div class="gleap-notification-item-checklist-content-next">
190+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
191+
<path d="M4 12H20M20 12L14 6M20 12L14 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
192+
</svg>
193+
${notification.data.nextStepTitle}
194+
</div>
195+
</div>
196+
</div>`;
174197
} else {
175198
// Notification item.
176199
elem.className = "gleap-notification-item";

src/UI.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,82 @@ export const injectStyledCSS = (
434434
fill: ${backgroundColor};
435435
}
436436
437+
.gleap-notification-item-checklist-container {
438+
display: flex;
439+
animation: fadeIn;
440+
animation-duration: .45s;
441+
background-color: ${backgroundColor};
442+
border-radius: ${subTextColor};
443+
box-sizing: border-box;
444+
cursor: pointer;
445+
flex-direction: column;
446+
overflow: hidden;
447+
box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);
448+
border-radius: ${chatRadius}px;
449+
margin-bottom: 12px;
450+
}
451+
452+
.gleap-notification-item-checklist-content {
453+
align-items: flex-start;
454+
display: flex;
455+
flex-direction: column;
456+
padding: 15px;
457+
width: 100%;
458+
width: min(310px, 70vw);
459+
max-width: min(310px, 70vw);
460+
}
461+
462+
.gleap-notification-item-checklist-content-title {
463+
color: ${contrastBackgroundColor};
464+
font-size: 15px;
465+
font-weight: 500;
466+
line-height: 21px;
467+
margin-bottom: 10px;
468+
max-width: 100%;
469+
-webkit-line-clamp: 3;
470+
-webkit-box-orient: vertical;
471+
overflow: hidden;
472+
}
473+
474+
.gleap-notification-item-checklist-content-progress {
475+
width: 100%;
476+
height: 8px;
477+
border-radius: 8px;
478+
background-color: ${backgroundColorHover};
479+
}
480+
481+
.gleap-notification-item-checklist-content-progress-inner {
482+
height: 100%;
483+
border-radius: 8px;
484+
background-color: ${primaryColor};
485+
}
486+
487+
.gleap-notification-item-checklist-content-next {
488+
color: ${subTextColor};
489+
font-size: 15px;
490+
font-weight: normal;
491+
line-height: 21px;
492+
margin-top: 10px;
493+
max-width: 100%;
494+
white-space: nowrap;
495+
overflow: hidden;
496+
text-overflow: ellipsis;
497+
display: flex;
498+
align-items: center;
499+
}
500+
501+
.gleap-notification-item-checklist-content-next svg {
502+
height: 18px;
503+
margin-right: 5px;
504+
width: auto;
505+
}
506+
507+
.gleap-notification-item-checklist-content-next b {
508+
font-size: 15px;
509+
font-weight: normal;
510+
color: ${contrastBackgroundColor};
511+
}
512+
437513
.gleap-notification-item-news {
438514
width: 100%;
439515
cursor: pointer;

0 commit comments

Comments
 (0)