From d6952cb3a9f8c526b2dee2d4674e68844d42c8d3 Mon Sep 17 00:00:00 2001 From: Tsvetan Igov Date: Thu, 1 Feb 2024 16:51:36 +0200 Subject: [PATCH] Added inline calendly pages --- .../Company/ContactsPage.razor | 4 ++-- .../Company/ScheduleMeeting.razor | 10 ++++++++++ .../Company/ScheduleMeeting.razor.cs | 19 +++++++++++++++++++ src/Byteology.Website/wwwroot/index.html | 1 + src/Byteology.Website/wwwroot/js/calendly.js | 6 ++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/Byteology.Website/Company/ScheduleMeeting.razor create mode 100644 src/Byteology.Website/Company/ScheduleMeeting.razor.cs create mode 100644 src/Byteology.Website/wwwroot/js/calendly.js diff --git a/src/Byteology.Website/Company/ContactsPage.razor b/src/Byteology.Website/Company/ContactsPage.razor index ced3fac..3223d2c 100644 --- a/src/Byteology.Website/Company/ContactsPage.razor +++ b/src/Byteology.Website/Company/ContactsPage.razor @@ -6,8 +6,8 @@ @using Byteology.Website.Inquiry @using Byteology.Website.Layout - + Keywords="@(new string[] { "schedule", "meeting" })" /> diff --git a/src/Byteology.Website/Company/ScheduleMeeting.razor b/src/Byteology.Website/Company/ScheduleMeeting.razor new file mode 100644 index 0000000..7bafb66 --- /dev/null +++ b/src/Byteology.Website/Company/ScheduleMeeting.razor @@ -0,0 +1,10 @@ +@page "/schedule-meeting/{link}" + +@layout BasicLayout + + + + +
diff --git a/src/Byteology.Website/Company/ScheduleMeeting.razor.cs b/src/Byteology.Website/Company/ScheduleMeeting.razor.cs new file mode 100644 index 0000000..f56a32c --- /dev/null +++ b/src/Byteology.Website/Company/ScheduleMeeting.razor.cs @@ -0,0 +1,19 @@ +namespace Byteology.Website.Company; + +using Microsoft.JSInterop; + +public partial class ScheduleMeeting : ComponentBase +{ + [Inject] + private IJSRuntime _jsRuntimeAsync { get; set; } = default!; + private IJSInProcessRuntime _jsRuntime => (IJSInProcessRuntime)_jsRuntimeAsync; + + [Parameter] + public string Link { get; set; } = null!; + + protected override void OnAfterRender(bool firstRender) + { + string link = $"https://calendly.com/tsvetan-igov/{Link}?background_color=090326&text_color=ffffff&primary_color=573ce2"; + _jsRuntime.InvokeVoid("initCalendly", link); + } +} \ No newline at end of file diff --git a/src/Byteology.Website/wwwroot/index.html b/src/Byteology.Website/wwwroot/index.html index 8cbadbc..aa21293 100644 --- a/src/Byteology.Website/wwwroot/index.html +++ b/src/Byteology.Website/wwwroot/index.html @@ -18,6 +18,7 @@
+ diff --git a/src/Byteology.Website/wwwroot/js/calendly.js b/src/Byteology.Website/wwwroot/js/calendly.js new file mode 100644 index 0000000..6689c48 --- /dev/null +++ b/src/Byteology.Website/wwwroot/js/calendly.js @@ -0,0 +1,6 @@ +window.initCalendly = (link) => { + Calendly.initInlineWidget({ + url: "https://calendly.com/tsvetan-igov/" + link + "?background_color=090326&text_color=ffffff&primary_color=573ce2", + parentElement: document.getElementById('calendly-embed') + }); +} \ No newline at end of file