Skip to content

Commit ebb3900

Browse files
d13eamodio
authored andcommitted
Adds cyber week message to gating
1 parent 59c260e commit ebb3900

File tree

2 files changed

+54
-13
lines changed

2 files changed

+54
-13
lines changed

src/webviews/apps/plus/account/components/account-content.ts

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css, html, LitElement, nothing } from 'lit';
22
import { customElement, property } from 'lit/decorators.js';
3+
import { when } from 'lit/directives/when.js';
34
import { hasAccountFromSubscriptionState, SubscriptionState } from '../../../../../plus/gk/account/subscription';
45
import { pluralize } from '../../../../../system/string';
56
import { elementBase, linkBase } from '../../../shared/components/styles/lit/base.css';
@@ -153,6 +154,8 @@ export class AccountContent extends LitElement {
153154
}
154155

155156
private renderAccountState() {
157+
const inCyberPromo = Date.now() < new Date('2023-12-06T07:59:00.000Z').getTime();
158+
156159
switch (this.state) {
157160
case SubscriptionState.VerificationRequired:
158161
return html`
@@ -187,10 +190,22 @@ export class AccountContent extends LitElement {
187190
Your GitKraken trial has ended, please upgrade to continue to use ✨ features on privately
188191
hosted repos.
189192
</p>
190-
<p>
191-
Special: <b>50% off GitKraken's suite of dev tools</b><br />
192-
1st & 2nd seats only $4/month each
193-
</p>
193+
${when(
194+
inCyberPromo,
195+
() =>
196+
html`<p style="text-align: center;">
197+
<a
198+
href=${'https://www.gitkraken.com/cw23?utm_source=cyber_week&utm_medium=gitlens_banner&utm_campaign=cyber_week_2023'}
199+
>Cyber Week Sale: 50% off first seat of Pro — only $4/month! Includes entire
200+
GitKraken suite of dev tools.</a
201+
>
202+
</p>`,
203+
() =>
204+
html`<p style="text-align: center;">
205+
Special: 50% off first seat of Pro — only $4/month! Includes entire GitKraken suite of
206+
dev tools.
207+
</p>`,
208+
)}
194209
<button-container>
195210
<gl-button full href="command:gitlens.plus.purchase">Upgrade to Pro</gl-button>
196211
</button-container>
@@ -216,10 +231,22 @@ export class AccountContent extends LitElement {
216231
${this.daysRemaining} remaining in your GitKraken trial.`}
217232
Once your trial ends, you'll need a paid plan to continue using ✨ features.
218233
</p>
219-
<p>
220-
Special: <b>50% off GitKraken's suite of dev tools</b><br />
221-
1st & 2nd seats only $4/month each
222-
</p>
234+
${when(
235+
inCyberPromo,
236+
() =>
237+
html`<p style="text-align: center;">
238+
<a
239+
href=${'https://www.gitkraken.com/cw23?utm_source=cyber_week&utm_medium=gitlens_banner&utm_campaign=cyber_week_2023'}
240+
>Cyber Week Sale: <b>50% off first seat of Pro</b> — only $4/month! Includes entire
241+
GitKraken suite of dev tools.</a
242+
>
243+
</p>`,
244+
() =>
245+
html`<p style="text-align: center;">
246+
Special: <b>50% off first seat of Pro</b> — only $4/month! Includes entire GitKraken
247+
suite of dev tools.
248+
</p>`,
249+
)}
223250
<button-container>
224251
<gl-button full href="command:gitlens.plus.purchase">Upgrade to Pro</gl-button>
225252
</button-container>

src/webviews/apps/plus/shared/components/feature-gate-plus-state.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { css, html, LitElement, nothing } from 'lit';
22
import { customElement, property } from 'lit/decorators.js';
3+
import { when } from 'lit/directives/when.js';
34
import { SubscriptionState } from '../../../../../plus/gk/account/subscription';
4-
import '../../../shared/components/button';
55
import { linkStyles } from './vscode.css';
6+
import '../../../shared/components/button';
67

78
@customElement('gk-feature-gate-plus-state')
89
export class FeatureGatePlusState extends LitElement {
@@ -56,6 +57,7 @@ export class FeatureGatePlusState extends LitElement {
5657

5758
this.hidden = false;
5859
const appearance = (this.appearance ?? 'alert') === 'alert' ? 'alert' : nothing;
60+
const inCyberPromo = Date.now() < new Date('2023-12-06T07:59:00.000Z').getTime();
5961

6062
switch (this.state) {
6163
case SubscriptionState.VerificationRequired:
@@ -99,10 +101,22 @@ export class FeatureGatePlusState extends LitElement {
99101
Your GitKraken trial has ended, please upgrade to continue to use this on privately hosted
100102
repos.
101103
</p>
102-
<p style="text-align: center;">
103-
Special: <b>50% off GitKraken's suite of dev tools</b><br />
104-
1st & 2nd seats only $4/month each
105-
</p>
104+
${when(
105+
inCyberPromo,
106+
() =>
107+
html`<p style="text-align: center;">
108+
<a
109+
href=${'https://www.gitkraken.com/cw23?utm_source=cyber_week&utm_medium=gitlens_banner&utm_campaign=cyber_week_2023'}
110+
>Cyber Week Sale: <b>50% off first seat of Pro</b> — only $4/month!<br />
111+
Includes entire GitKraken suite of dev tools.</a
112+
>
113+
</p>`,
114+
() =>
115+
html`<p style="text-align: center;">
116+
Special: <b>50% off first seat of Pro</b> — only $4/month!<br />
117+
Includes entire GitKraken suite of dev tools.
118+
</p>`,
119+
)}
106120
<gl-button appearance="${appearance}" href="command:gitlens.plus.purchase"
107121
>Upgrade to Pro</gl-button
108122
>

0 commit comments

Comments
 (0)