From 18a02a004dd69cf473e6acb874a1f0f4275a6c47 Mon Sep 17 00:00:00 2001 From: George Drak Date: Tue, 18 Jan 2022 18:15:53 +0500 Subject: [PATCH] fix(demo): upd demo to use correct layout and components Refs: BLOCKLY-T-2 --- apps/Sitko.Blockly.Demo/Pages/Add.razor | 18 ++---- apps/Sitko.Blockly.Demo/Pages/Edit.razor | 23 ++------ apps/Sitko.Blockly.Demo/Pages/Index.razor | 55 ++++++++----------- .../Pages/PostFormComponent.razor | 2 +- apps/Sitko.Blockly.Demo/Pages/Show.razor | 30 +++------- .../Shared/MainLayout.razor | 7 +-- apps/Sitko.Blockly.Demo/Shared/NavMenu.razor | 6 ++ apps/Sitko.Blockly.Demo/_Imports.razor | 1 + 8 files changed, 47 insertions(+), 95 deletions(-) create mode 100644 apps/Sitko.Blockly.Demo/Shared/NavMenu.razor diff --git a/apps/Sitko.Blockly.Demo/Pages/Add.razor b/apps/Sitko.Blockly.Demo/Pages/Add.razor index 34a3220..7aca9ef 100644 --- a/apps/Sitko.Blockly.Demo/Pages/Add.razor +++ b/apps/Sitko.Blockly.Demo/Pages/Add.razor @@ -1,15 +1,5 @@ @page "/Posts/Add" - - - - Home - Posts - Add - - - - - - - - +@inherits BaseComponent + + + diff --git a/apps/Sitko.Blockly.Demo/Pages/Edit.razor b/apps/Sitko.Blockly.Demo/Pages/Edit.razor index c1cdb4c..81a2007 100644 --- a/apps/Sitko.Blockly.Demo/Pages/Edit.razor +++ b/apps/Sitko.Blockly.Demo/Pages/Edit.razor @@ -1,26 +1,11 @@ @page "/Posts/{PostId:guid}/Edit" +@inherits BaseComponent @{ var title = $"Edit post {PostId}"; } - - - - Home - Posts - Edit - - - - - - - - - - - + + + @code { diff --git a/apps/Sitko.Blockly.Demo/Pages/Index.razor b/apps/Sitko.Blockly.Demo/Pages/Index.razor index 3a57770..64146d9 100644 --- a/apps/Sitko.Blockly.Demo/Pages/Index.razor +++ b/apps/Sitko.Blockly.Demo/Pages/Index.razor @@ -4,40 +4,29 @@ @using Sitko.Blockly.Display @using Sitko.Core.Storage @inherits BaseComponent - - - - Home - Posts - - - - - - - + + + Add + - @foreach (Post post in Posts) - { - - - - - - - - - - - - } - + @foreach (var post in Posts) + { + + + @post.Title + + + Edit + + + + + + + } - - + @code{ @@ -48,6 +37,6 @@ Posts = posts.items; } - private Post[] Posts { get; set; } = new Post[0]; + private Post[] Posts { get; set; } = Array.Empty(); } diff --git a/apps/Sitko.Blockly.Demo/Pages/PostFormComponent.razor b/apps/Sitko.Blockly.Demo/Pages/PostFormComponent.razor index f6851d7..0065210 100644 --- a/apps/Sitko.Blockly.Demo/Pages/PostFormComponent.razor +++ b/apps/Sitko.Blockly.Demo/Pages/PostFormComponent.razor @@ -8,7 +8,7 @@ @inherits BaseComponent - + diff --git a/apps/Sitko.Blockly.Demo/Pages/Show.razor b/apps/Sitko.Blockly.Demo/Pages/Show.razor index 61fe575..a215844 100644 --- a/apps/Sitko.Blockly.Demo/Pages/Show.razor +++ b/apps/Sitko.Blockly.Demo/Pages/Show.razor @@ -2,25 +2,11 @@ @using Sitko.Core.Storage @using Sitko.Blockly.Display @inherits BaseComponent -@if (Post is not null) -{ - var title = Post.Title; - - - - Home - Posts - - - - - - - - - - - -} + + + Edit + + + + + diff --git a/apps/Sitko.Blockly.Demo/Shared/MainLayout.razor b/apps/Sitko.Blockly.Demo/Shared/MainLayout.razor index 322a701..9e5e8fa 100644 --- a/apps/Sitko.Blockly.Demo/Shared/MainLayout.razor +++ b/apps/Sitko.Blockly.Demo/Shared/MainLayout.razor @@ -1,14 +1,9 @@ @inherits LayoutComponentBase - - - Posts - + @Body - Sitko.ru @DateTimeOffset.UtcNow.Year - diff --git a/apps/Sitko.Blockly.Demo/Shared/NavMenu.razor b/apps/Sitko.Blockly.Demo/Shared/NavMenu.razor new file mode 100644 index 0000000..f782536 --- /dev/null +++ b/apps/Sitko.Blockly.Demo/Shared/NavMenu.razor @@ -0,0 +1,6 @@ + + + Posts + + +© @DateTimeOffset.Now.Year Sitko.ru diff --git a/apps/Sitko.Blockly.Demo/_Imports.razor b/apps/Sitko.Blockly.Demo/_Imports.razor index 4654dbd..4d9ba3d 100644 --- a/apps/Sitko.Blockly.Demo/_Imports.razor +++ b/apps/Sitko.Blockly.Demo/_Imports.razor @@ -11,5 +11,6 @@ @using Sitko.Blockly.MudBlazorComponents.Forms @using Sitko.Blockly.MudBlazorComponents.Display @using Sitko.Core.Blazor.Components +@using Sitko.Core.Blazor.MudBlazorComponents @using MudBlazor