Skip to content

Commit

Permalink
Added NotificationBar component to story book
Browse files Browse the repository at this point in the history
  • Loading branch information
dyatlov-a committed Oct 6, 2024
1 parent 498fbb1 commit 2643364
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@attribute [Stories("Features/NotificationBar")]

@inject IServiceProvider ServiceProvider

<Stories TComponent="NotificationBar" Layout="typeof(StubLayout)">
<Story Name="Default">
<Template>
<NotificationBar @attributes="context.Args" />
</Template>
</Story>
</Stories>

@code {
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
{
var notificationsService = ServiceProvider.GetRequiredService<INotificationsService>();

notificationsService.Publish(Notification.Info("Info message."));
notificationsService.Publish(Notification.Warning("Warning message."));
notificationsService.Publish(Notification.Error("Error message."));
}
}
}
3 changes: 2 additions & 1 deletion src/Inc.TeamAssistant.Stories/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
@using Inc.TeamAssistant.Stories.Components

@using Inc.TeamAssistant.WebUI.Components
@using Inc.TeamAssistant.WebUI.Services.ClientCore
@using Inc.TeamAssistant.WebUI.Services.ClientCore
@using Inc.TeamAssistant.WebUI.Features.Notifications

0 comments on commit 2643364

Please sign in to comment.