Skip to content

Commit e9addc3

Browse files
committed
ChatUI: Create the getting started with the Blazor ChatUI sample
1 parent 58b79c6 commit e9addc3

File tree

16 files changed

+53
-61
lines changed

16 files changed

+53
-61
lines changed

ChatUI/BlazorWebApp/BlazorWebApp.Client/BlazorWebApp.Client.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
88
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.11" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
1313
<PackageReference Include="Syncfusion.Blazor.InteractiveChat" Version="28.1.35" />
1414
<PackageReference Include="Syncfusion.Blazor.Themes" Version="28.1.35" />
1515
</ItemGroup>

ChatUI/BlazorWebApp/BlazorWebApp.Client/Layout/MainLayout.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
</main>
1717
</div>
1818

19-
<div id="blazor-error-ui">
19+
<div id="blazor-error-ui" data-nosnippet>
2020
An unhandled error has occurred.
21-
<a href="" class="reload">Reload</a>
22-
<a class="dismiss">🗙</a>
21+
<a href="." class="reload">Reload</a>
22+
<span class="dismiss">🗙</span>
2323
</div>

ChatUI/BlazorWebApp/BlazorWebApp.Client/Layout/MainLayout.razor.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ main {
7777
}
7878

7979
#blazor-error-ui {
80+
color-scheme: light only;
8081
background: lightyellow;
8182
bottom: 0;
8283
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
84+
box-sizing: border-box;
8385
display: none;
8486
left: 0;
8587
padding: 0.6rem 1.25rem 0.7rem 1.25rem;

ChatUI/BlazorWebApp/BlazorWebApp.Client/Layout/NavMenu.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
88

99
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
10-
<nav class="flex-column">
10+
<nav class="nav flex-column">
1111
<div class="nav-item px-3">
1212
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
1313
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home

ChatUI/BlazorWebApp/BlazorWebApp.Client/Layout/NavMenu.razor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
.top-row {
19-
height: 3.5rem;
19+
min-height: 3.5rem;
2020
background-color: rgba(0,0,0,0.4);
2121
}
2222

ChatUI/BlazorWebApp/BlazorWebApp.Client/Pages/Home.razor

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@page "/"
22

33
<!-- SfChatUI component that sets up the Blazor chat interface with various configurations -->
4-
<SfChatUI HeaderText="Testing Collaboration - Product & QA"
4+
<SfChatUI HeaderText="Feature Testing Collaboration"
55
ShowTimeBreak="true" TimestampFormat="MMMM hh:mm tt" User="ProductManager"
66
Width="400px" Height="500px" Messages="ChatUserMessages">
77
<!-- Empty chat template to display when no messages are present -->
@@ -18,17 +18,20 @@
1818
<style>
1919
.empty-chat-text {
2020
font-size: 15px;
21-
text-align: center;
22-
margin-top: 90px;
21+
display: flex;
22+
flex-direction: column;
23+
align-items: center;
24+
margin-top: 35%;
25+
justify-content: center;
2326
}
2427
</style>
2528

2629
@code {
2730

2831
// Defining static user models for the participants in the chat
29-
private static UserModel ProductManager = new UserModel() { ID = "User1", User = "Product Manager" };
30-
private static UserModel Tester = new UserModel() { ID = "User2", User = "Tester" };
31-
private static UserModel Developer = new UserModel() { ID = "User3", User = "Developer" };
32+
private static UserModel ProductManager = new UserModel() { ID = "User1", User = "Thomas Cooper" };
33+
private static UserModel Tester = new UserModel() { ID = "User2", User = "James Carter" };
34+
private static UserModel Developer = new UserModel() { ID = "User3", User = "David Morgan", AvatarUrl = "images/Developer.jpg" };
3235

3336
// List of messages to display in the chat
3437
private List<ChatMessage> ChatUserMessages = new List<ChatMessage>()
@@ -46,7 +49,7 @@
4649
new ChatMessage() { Text = "Just a heads up, I’m working on the fixes for the reported bugs.",
4750
Author = Developer, Timestamp = new DateTime(2024,12,24,9,05,0) },
4851

49-
new ChatMessage() { Text = "Thanks, Developer! I’ll check them and make sure the fixes align with the test cases.",
52+
new ChatMessage() { Text = "Thanks, David Morgan! I’ll check them and make sure the fixes align with the test cases.",
5053
Author = ProductManager, Timestamp = new DateTime(2024,12,24,10,45,0) },
5154

5255
new ChatMessage() { Text = "I’ll review the test cases and update any changes if needed.",
@@ -62,3 +65,4 @@
6265
Author = Developer, Timestamp = new DateTime(2024,12,24,12,15,0) }
6366
};
6467
}
68+

ChatUI/BlazorWebApp/BlazorWebApp.Client/Pages/Weather.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ else
1616
<thead>
1717
<tr>
1818
<th>Date</th>
19-
<th>Temp. (C)</th>
20-
<th>Temp. (F)</th>
19+
<th aria-label="Temperature in Celsius">Temp. (C)</th>
20+
<th aria-label="Temperature in Farenheit">Temp. (F)</th>
2121
<th>Summary</th>
2222
</tr>
2323
</thead>

ChatUI/BlazorWebApp/BlazorWebApp.Client/_Imports.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
@using Microsoft.AspNetCore.Components.Web.Virtualization
88
@using Microsoft.JSInterop
99
@using BlazorWebApp.Client
10-
@using Syncfusion.Blazor.InteractiveChat
10+
@using Syncfusion.Blazor.InteractiveChat

ChatUI/BlazorWebApp/BlazorWebApp.sln

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.12.35527.113 d17.12
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebApp", "BlazorWebApp\BlazorWebApp.csproj", "{FD131A3D-E9DE-4B51-95DE-B86FEE54D101}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebApp", "BlazorWebApp\BlazorWebApp.csproj", "{1D867BC3-B49B-481F-AC65-E0221E44636A}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebApp.Client", "BlazorWebApp.Client\BlazorWebApp.Client.csproj", "{AFEE238E-64C3-44EE-8F4A-ADDE80B64959}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWebApp.Client", "BlazorWebApp.Client\BlazorWebApp.Client.csproj", "{ABA1455B-2C8C-45BC-BB84-A6E2ED2CBF8E}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1212
Debug|Any CPU = Debug|Any CPU
1313
Release|Any CPU = Release|Any CPU
1414
EndGlobalSection
1515
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16-
{FD131A3D-E9DE-4B51-95DE-B86FEE54D101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17-
{FD131A3D-E9DE-4B51-95DE-B86FEE54D101}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{FD131A3D-E9DE-4B51-95DE-B86FEE54D101}.Release|Any CPU.ActiveCfg = Release|Any CPU
19-
{FD131A3D-E9DE-4B51-95DE-B86FEE54D101}.Release|Any CPU.Build.0 = Release|Any CPU
20-
{AFEE238E-64C3-44EE-8F4A-ADDE80B64959}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21-
{AFEE238E-64C3-44EE-8F4A-ADDE80B64959}.Debug|Any CPU.Build.0 = Debug|Any CPU
22-
{AFEE238E-64C3-44EE-8F4A-ADDE80B64959}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{AFEE238E-64C3-44EE-8F4A-ADDE80B64959}.Release|Any CPU.Build.0 = Release|Any CPU
16+
{1D867BC3-B49B-481F-AC65-E0221E44636A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{1D867BC3-B49B-481F-AC65-E0221E44636A}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{1D867BC3-B49B-481F-AC65-E0221E44636A}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{1D867BC3-B49B-481F-AC65-E0221E44636A}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{ABA1455B-2C8C-45BC-BB84-A6E2ED2CBF8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{ABA1455B-2C8C-45BC-BB84-A6E2ED2CBF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{ABA1455B-2C8C-45BC-BB84-A6E2ED2CBF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{ABA1455B-2C8C-45BC-BB84-A6E2ED2CBF8E}.Release|Any CPU.Build.0 = Release|Any CPU
2424
EndGlobalSection
2525
GlobalSection(SolutionProperties) = preSolution
2626
HideSolutionNode = FALSE
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
1010
<ProjectReference Include="..\BlazorWebApp.Client\BlazorWebApp.Client.csproj" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.11" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
1212
</ItemGroup>
1313

1414
</Project>

0 commit comments

Comments
 (0)