From 26aa7ef1e1cca1a458dd71dda3c545c05ba1ede2 Mon Sep 17 00:00:00 2001 From: Peace Date: Tue, 30 Jul 2024 15:54:14 +0900 Subject: [PATCH] persona --- .../Components/Layout/NavMenu.razor | 1 + .../Pages/Components/CompoPersona.razor | 108 ++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 BlazorFluentUI/Components/Pages/Components/CompoPersona.razor diff --git a/BlazorFluentUI/Components/Layout/NavMenu.razor b/BlazorFluentUI/Components/Layout/NavMenu.razor index ce91d95..897f1b8 100644 --- a/BlazorFluentUI/Components/Layout/NavMenu.razor +++ b/BlazorFluentUI/Components/Layout/NavMenu.razor @@ -70,6 +70,7 @@ MessageBar MessageBox Overlay + Persona Toast diff --git a/BlazorFluentUI/Components/Pages/Components/CompoPersona.razor b/BlazorFluentUI/Components/Pages/Components/CompoPersona.razor new file mode 100644 index 0000000..63ccb92 --- /dev/null +++ b/BlazorFluentUI/Components/Pages/Components/CompoPersona.razor @@ -0,0 +1,108 @@ +@page "/compopersona" + +@inject EmployeeService EmployeeService; + +@rendermode RenderMode.InteractiveServer + +

Persona

+ +
+ A FluentPerona is a visual representation of a person with an avatar. A status can be specified optionally. +
+ + +

Default

+ + @if (employee != null) + { + + } + + +

Text Position

+ + @if (employee != null) + { + + } + + +

Icon

+ + + + +

With no image (Default initials)

+ + + + + + + +

Dissmiss action

+ + @if (employees != null && employees.Count > 0) + { + + @foreach (var emp in employees) + { + + } + + } +

+ Message: @dismissMessage?.ToString() +

+
+ +@code { + readonly int EMP_SIZE = 5; + + Employee? employee; + List? employees; + Dictionary? hiddenOptions; + + protected override void OnInitialized() + { + employees = EmployeeService.GetEmployeeData(EMP_SIZE); + employee = employees[Random.Shared.Next(0, EMP_SIZE)]; + hiddenOptions = new Dictionary(); + foreach (var emp in employees) + { + hiddenOptions.Add(emp.ID, false); + } + } + + string? dismissMessage; +}