diff --git a/Start/Client/Components/BookmarkContainer.razor b/Start/Client/Components/BookmarkContainer.razor index 69c68d0..f093ee4 100644 --- a/Start/Client/Components/BookmarkContainer.razor +++ b/Start/Client/Components/BookmarkContainer.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.State +@using Start.Client.Components.Shared +@using Start.Client.Store.State @using Start.Client.Store.Features.CreateGroup @using Fluxor diff --git a/Start/Client/Components/CreateBookmark.razor b/Start/Client/Components/CreateBookmark.razor index 5c9ba90..fad12ac 100644 --- a/Start/Client/Components/CreateBookmark.razor +++ b/Start/Client/Components/CreateBookmark.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.CreateBookmark +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.CreateBookmark @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -7,63 +8,68 @@ @inject IDispatcher dispatch @inject IState state - - - + +
+ Create Bookmark +
+ + + - @if (this.state.Value.CreateBookmarkErrorMessage != null) - { - - @this.state.Value.CreateBookmarkErrorMessage - - } + @if (this.state.Value.CreateBookmarkErrorMessage != null) + { + + @this.state.Value.CreateBookmarkErrorMessage + + } - + -
-
-
-
- - +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
-
-
- - -
-
-
-
- - +
+
+
+ @if (this.state.Value.IsLoadingCreateBookmark) + { + + } + else + { + + } +
-
-
-
- @if (this.state.Value.IsLoadingCreateBookmark) - { - - } - else - { - - } -
-
-
-
- + +
@code { diff --git a/Start/Client/Components/CreateContainer.razor b/Start/Client/Components/CreateContainer.razor index 70016b2..f21abbf 100644 --- a/Start/Client/Components/CreateContainer.razor +++ b/Start/Client/Components/CreateContainer.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.CreateContainer +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.CreateContainer @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -6,53 +7,58 @@ @inject IDispatcher dispatch @inject IState state - - - + +
+ Create Container +
+ + + - @if (this.state.Value.CreateContainerErrorMessage != null) - { - - @this.state.Value.CreateContainerErrorMessage - - } + @if (this.state.Value.CreateContainerErrorMessage != null) + { + + @this.state.Value.CreateContainerErrorMessage + + } - + -
-
-
-
-
- - +
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ @if (this.state.Value.IsLoadingCreateContainer) + { + + } + else + { + + } +
-
-
-
-
- @if (this.state.Value.IsLoadingCreateContainer) - { - - } - else - { - - } -
-
-
-
-
- + +
@code { diff --git a/Start/Client/Components/CreateGroup.razor b/Start/Client/Components/CreateGroup.razor index 85be69b..238942a 100644 --- a/Start/Client/Components/CreateGroup.razor +++ b/Start/Client/Components/CreateGroup.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.CreateGroup +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.CreateGroup @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -7,53 +8,58 @@ @inject IDispatcher dispatch @inject IState state - - - + +
+ Create Bookmark Group +
+ + + - @if (this.state.Value.CreateGroupErrorMessage != null) - { - - @this.state.Value.CreateGroupErrorMessage - - } + @if (this.state.Value.CreateGroupErrorMessage != null) + { + + @this.state.Value.CreateGroupErrorMessage + + } - + -
-
-
-
- - +
+
+
+
+ + +
+
+ + +
-
- - +
+
+
+
+ @if (this.state.Value.IsLoadingCreateGroup) + { + + } + else + { + + } +
-
-
-
- @if (this.state.Value.IsLoadingCreateGroup) - { - - } - else - { - - } -
-
-
-
- + +
@code { diff --git a/Start/Client/Components/DeleteBookmark.razor b/Start/Client/Components/DeleteBookmark.razor index 20443b8..52a62f1 100644 --- a/Start/Client/Components/DeleteBookmark.razor +++ b/Start/Client/Components/DeleteBookmark.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.DeleteBookmark +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.DeleteBookmark @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -6,52 +7,55 @@ @inject IDispatcher dispatch @inject IState state -@{ string title = $"Delete Bookmark \"{this.state.Value.BookmarkToDelete?.Title}\""; } + +
+ Delete Bookmark "@this.state.Value.BookmarkToDelete?.Title" +
+ + @if (this.state.Value.DeleteBookmarkErrorMessage != null) + { + + @this.state.Value.DeleteBookmarkErrorMessage + + } - - @if (this.state.Value.DeleteBookmarkErrorMessage != null) - { - - @this.state.Value.DeleteBookmarkErrorMessage - - } + @if (this.state.Value.BookmarkToDelete == null) + { + + There is no bookmark to delete selected + + } + else + { +

Are you sure you want to delete this bookmark?

+
+
Title
+
@this.state.Value.BookmarkToDelete.Title
- @if (this.state.Value.BookmarkToDelete == null) - { - - There is no bookmark to delete selected - - } - else - { -

Are you sure you want to delete this bookmark?

-
-
Title
-
@this.state.Value.BookmarkToDelete.Title
+
URL
+
@this.state.Value.BookmarkToDelete.Url
-
URL
-
@this.state.Value.BookmarkToDelete.Url
+ @if (!string.IsNullOrWhiteSpace(this.state.Value.BookmarkToDelete.Notes)) + { +
Notes
+
@this.state.Value.BookmarkToDelete.Notes
+ } +
- @if (!string.IsNullOrWhiteSpace(this.state.Value.BookmarkToDelete.Notes)) - { -
Notes
-
@this.state.Value.BookmarkToDelete.Notes
- } -
- -
- @if (!this.state.Value.IsLoadingDeleteBookmark) - { - - - } - else - { - - - } -
- } +
+ @if (!this.state.Value.IsLoadingDeleteBookmark) + { + + + } + else + { + + + } +
+ } +
@code { diff --git a/Start/Client/Components/DeleteContainer.razor b/Start/Client/Components/DeleteContainer.razor index 5a5c43c..d4263c5 100644 --- a/Start/Client/Components/DeleteContainer.razor +++ b/Start/Client/Components/DeleteContainer.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.DeleteContainer +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.DeleteContainer @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -6,32 +7,35 @@ @inject IDispatcher dispatch @inject IState state -@{ string title = $"Delete Container \"{this.state.Value.BookmarkContainerTitleToDelete}\""; } - - - @if (this.state.Value.DeleteContainerErrorMessage != null) - { - - @this.state.Value.DeleteContainerErrorMessage - - } - -

- Are you sure you want to delete the bookmark container - "@this.state.Value.BookmarkContainerTitleToDelete"? -

-
- @if (!this.state.Value.IsLoadingDeleteContainer) + +
+ Delete Container "@this.state.Value.BookmarkContainerTitleToDelete" +
+ + @if (this.state.Value.DeleteContainerErrorMessage != null) { - - + + @this.state.Value.DeleteContainerErrorMessage + } - else - { - - - } -
+ +

+ Are you sure you want to delete the bookmark container + "@this.state.Value.BookmarkContainerTitleToDelete"? +

+
+ @if (!this.state.Value.IsLoadingDeleteContainer) + { + + + } + else + { + + + } +
+
@code { diff --git a/Start/Client/Components/DeleteGroup.razor b/Start/Client/Components/DeleteGroup.razor index 50398f4..29b4189 100644 --- a/Start/Client/Components/DeleteGroup.razor +++ b/Start/Client/Components/DeleteGroup.razor @@ -1,4 +1,5 @@ -@using Start.Client.Store.Features.DeleteGroup +@using Start.Client.Components.Shared +@using Start.Client.Store.Features.DeleteGroup @using Fluxor @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -6,40 +7,45 @@ @inject IDispatcher dispatch @inject IState state -@{ string title = $"Delete Group \"{this.state.Value.BookmarkGroupTitleToDelete}\""; } - - - @if (this.state.Value.DeleteGroupErrorMessage != null) - { - - @this.state.Value.DeleteGroupErrorMessage - - } - -

- Are you sure you want to delete the bookmark container - "@this.state.Value.BookmarkGroupTitleToDelete"? -

-
- @if (!this.state.Value.IsLoadingDeleteGroup) + +
+ Delete Group "@this.state.Value.BookmarkGroupTitleToDelete" +
+ + @if (this.state.Value.DeleteGroupErrorMessage != null) { - - + + @this.state.Value.DeleteGroupErrorMessage + } - else - { - - - } -
+ +

+ Are you sure you want to delete the bookmark container + "@this.state.Value.BookmarkGroupTitleToDelete"? +

+
+ @if (!this.state.Value.IsLoadingDeleteGroup) + { + + + } + else + { + + + } +
+
@code { - public void OnDialogClose() { + public void OnDialogClose() + { this.dispatch.Dispatch(new HideDeleteGroupFormAction()); } - public void OnConfirmDelete() { + public void OnConfirmDelete() + { this.dispatch.Dispatch(new SubmitDeleteGroupFormAction( this.state.Value.BookmarkGroupIdToDelete)); } diff --git a/Start/Client/Components/Dialog.razor b/Start/Client/Components/Dialog.razor deleted file mode 100644 index 6b35968..0000000 --- a/Start/Client/Components/Dialog.razor +++ /dev/null @@ -1,35 +0,0 @@ -@using Microsoft.Extensions.Logging - -@inject ILogger logger - - - -@code { - [Parameter] - public string Title { get; set; } = null!; - [Parameter] - public RenderFragment ChildContent { get; set; } = null!; - [Parameter] - public bool Active { get; set; } - [Parameter] - public EventCallback OnClose { get; set; } - - public void OnDialogClose() - { - this.Active = false; - this.OnClose.InvokeAsync(); - } -} diff --git a/Start/Client/Components/Alert.razor b/Start/Client/Components/Shared/Alert.razor similarity index 90% rename from Start/Client/Components/Alert.razor rename to Start/Client/Components/Shared/Alert.razor index fa41e86..bb5f905 100644 --- a/Start/Client/Components/Alert.razor +++ b/Start/Client/Components/Shared/Alert.razor @@ -1,4 +1,4 @@ -
+ diff --git a/Start/Client/Components/Shared/Dialog.razor b/Start/Client/Components/Shared/Dialog.razor new file mode 100644 index 0000000..ed4f5dc --- /dev/null +++ b/Start/Client/Components/Shared/Dialog.razor @@ -0,0 +1,46 @@ + + +@code { + [Parameter] + public RenderFragment Header { get; set; } = null!; + [Parameter] + public RenderFragment Body { get; set; } = null!; + [Parameter] + public RenderFragment? Footer { get; set; } = null; + + [Parameter] + public bool Active { get; set; } + [Parameter] + public EventCallback OnClose { get; set; } + + public void OnDialogClose() + { + if (this.OnClose.HasDelegate) + { + this.OnClose.InvokeAsync(); + } + else + { + this.Active = false; + } + } +} diff --git a/Start/Client/Pages/Index.razor b/Start/Client/Pages/Index.razor index 1457eb4..355b63d 100644 --- a/Start/Client/Pages/Index.razor +++ b/Start/Client/Pages/Index.razor @@ -1,6 +1,7 @@ @page "/" @using Start.Client.Components +@using Start.Client.Components.Shared @using Start.Client.Store.State @using Microsoft.AspNetCore.Authorization @using Fluxor diff --git a/Start/Client/Start.Client.csproj b/Start/Client/Start.Client.csproj index 125eba0..ad12e78 100644 --- a/Start/Client/Start.Client.csproj +++ b/Start/Client/Start.Client.csproj @@ -132,6 +132,7 @@ + @@ -151,5 +152,6 @@ +