Skip to content

Commit 5d6a7b3

Browse files
cmgriffingd13
authored andcommitted
Adds workshop banner to welcome page
1 parent 3f3dad9 commit 5d6a7b3

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

src/webviews/apps/welcome/welcome.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ <h1 class="welcome__brand"><gitlens-logo></gitlens-logo> <small>Git Supercharged
4949
</p>
5050
</header>
5151
<main class="welcome__main">
52+
<div class="workshop-banner" id="workshop-banner">
53+
<p class="workshop-banner__date"><strong>April 30th 1PM ET</strong></p>
54+
55+
<p class="workshop-banner__content">
56+
<span>Discover faster, easier onboarding with GitLens</span>
57+
<span><strong>Free Workshop</strong></span>
58+
</p>
59+
<gl-button
60+
href="https://event.sessions.us/gitkraken/fast-easy-onboarding-with-gitlens-in-vs-code?utm_campaign=GitKraken%20Workshops&utm_source=twitter&utm_medium=social&utm_term=GitLens%20Workshop"
61+
class="workshop-banner__register-button"
62+
>
63+
Register Now
64+
</gl-button>
65+
</div>
5266
<section class="welcome__section">
5367
<p class="t-feature">
5468
Supercharge Git and unlock <strong>untapped knowledge</strong> within your repository to better

src/webviews/apps/welcome/welcome.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,48 @@ gk-card p {
278278
grid-template-columns: 1fr;
279279
grid-template-rows: min-content;
280280
gap: 1.6rem 3rem;
281+
282+
.workshop-banner {
283+
border: thin solid #c64eff;
284+
border-radius: 3px;
285+
display: flex;
286+
flex-direction: row;
287+
margin: 1rem;
288+
align-items: center;
289+
justify-content: space-between;
290+
padding: 1rem 2rem;
291+
gap: 1rem;
292+
margin-right: 6rem;
293+
294+
&__date {
295+
margin-bottom: 0;
296+
}
297+
298+
&__content {
299+
display: flex;
300+
flex-direction: column;
301+
align-items: center;
302+
justify-content: center;
303+
gap: 0.5rem;
304+
margin-bottom: 0;
305+
}
306+
307+
&__register-button {
308+
--button-foreground: white;
309+
--button-background: #c64eff;
310+
--button-hover-background: #d98ffb;
311+
font-weight: bold;
312+
border-radius: 2px;
313+
padding: 0.5rem 2rem;
314+
}
315+
316+
@media screen and (width < 1000px) {
317+
flex-direction: column;
318+
margin-right: 0;
319+
text-align: center;
320+
padding: 1rem 1rem;
321+
}
322+
}
281323
}
282324

283325
&__section {

src/webviews/apps/welcome/welcome.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export class WelcomeApp extends App<State> {
106106
this.updateAccountState();
107107
this.updatePromo();
108108
this.updateOrgSettings();
109+
this.updateWorkshopBanner();
109110
}
110111

111112
private updateOrgSettings() {
@@ -149,6 +150,17 @@ export class WelcomeApp extends App<State> {
149150
const { isTrialOrPaid } = this.state;
150151
document.getElementById('try-pro')!.hidden = isTrialOrPaid ?? false;
151152
}
153+
154+
private updateWorkshopBanner() {
155+
const today = Date.now();
156+
const cutoffDate = Date.parse('30 Apr 2024 10:00:00 PDT');
157+
158+
const bannerElement = document.getElementById('workshop-banner');
159+
160+
if (bannerElement && today > cutoffDate) {
161+
bannerElement.hidden = true;
162+
}
163+
}
152164
}
153165

154166
new WelcomeApp();

0 commit comments

Comments
 (0)