Skip to content

Commit

Permalink
♻ refactor(App): delete the Dark theme feature (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Apr 3, 2023
1 parent ecda189 commit 22270a0
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions src/Component/BlazorComponent/Components/App/BApp.razor.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
namespace BlazorComponent
{
public abstract partial class BApp : BDomComponentBase, IThemeable, IDefaultsProvider
public abstract partial class BApp : BDomComponentBase, IDefaultsProvider
{
[Inject]
private IPopupProvider PopupProvider { get; set; } = null!;

[Parameter]
public RenderFragment? ChildContent { get; set; }

[Parameter]
public bool Dark { get; set; }

[Parameter]
public bool Light { get; set; }

[CascadingParameter(Name = "IsDark")]
public bool CascadingIsDark { get; set; }

protected string ThemeStyleMarkups { get; set; } = "";

protected virtual bool IsDark => false;

public virtual IDictionary<string, IDictionary<string, object?>?>? Defaults { get; }

protected override void OnInitialized()
Expand All @@ -28,24 +21,6 @@ protected override void OnInitialized()
PopupProvider.StateChanged += OnStateChanged;
}

public bool IsDark
{
get
{
if (Dark)
{
return true;
}

if (Light)
{
return false;
}

return CascadingIsDark;
}
}

private void OnStateChanged(object? sender, EventArgs e)
{
InvokeAsync(StateHasChanged);
Expand Down

0 comments on commit 22270a0

Please sign in to comment.