Skip to content

Commit

Permalink
refactor(components): rename the 'OnToggle' event to 'OnMenuToggle' i…
Browse files Browse the repository at this point in the history
…n the `NavbarContext`
  • Loading branch information
desmondinho committed Jul 14, 2024
1 parent 32d449a commit c7ec738
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/LumexUI/Components/Navbar/LumexNavbarMenu.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override void OnInitialized()
ContextNullException.ThrowIfNull( Context, nameof( LumexNavbarMenu ) );

Context.Register( this );
Context.OnToggle += StateHasChanged;
Context.OnMenuToggle += StateHasChanged;
}

protected override async Task OnAfterRenderAsync( bool firstRender )
Expand Down
4 changes: 2 additions & 2 deletions src/LumexUI/Components/Navbar/NavbarContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal class NavbarContext( LumexNavbar owner ) : IComponentContext<LumexNavba
public LumexNavbarMenu? Menu { get; private set; }
public bool IsMenuExpanded { get; private set; }

public event Action? OnToggle;
public event Action OnMenuToggle = default!;

public void Register( LumexNavbarMenu menu )
{
Expand All @@ -21,5 +21,5 @@ public void ToggleMenu()
NotifyStateChanged();
}

private void NotifyStateChanged() => OnToggle?.Invoke();
private void NotifyStateChanged() => OnMenuToggle.Invoke();
}

0 comments on commit c7ec738

Please sign in to comment.