Skip to content

Commit

Permalink
Adding back button on sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Mangia committed Mar 16, 2023
1 parent e210a25 commit 7c66cc7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions Nostrid.Core/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<div class="offcanvas-body d-flex flex-column flex-grow-1">

<UpdatabableElement @ref="loggedInElements">
<div class="d-flex flex-row align-items-center justify-content-between">
<div class="d-flex flex-row align-items-center">
@if (accountService.MainAccount != null)
{
<a href="@($"account/{accountService.MainAccount?.Id}")" @onclick="HideOffCanvasMenu">
<a href="@($"account/{accountService.MainAccount?.Id}")" @onclick="HideOffCanvasMenu" class="me-3">
<AccountPicture Id="@accountService.MainAccount?.Id" Size="48"></AccountPicture>
</a>
}
<div>
<div class="flex-grow-1 d-flex flex-row align-items-center justify-content-end">
@{
var otherAccountsCount = eventDatabase.GetAccountIdsWithPk()
.Concat(accountService.GetAccountsWithSigners())
Expand All @@ -43,19 +43,28 @@
@if (otherAccountsCount > 0)
{
<a @onclick="@(async () => { accountsModal?.Show(); await HideOffCanvasMenu(); })" role="button" class="btn btn-sm @(accountService.MainAccount == null ? "btn-primary" : "btn-outline-secondary") rounded-5 fs-6 me-2">
<i class="bi bi-arrow-left-right"></i>
@if (accountService.MainAccount == null)
{
<span class="me-2">&nbsp;Select account</span>
}
else
{
<i class="bi bi-arrow-left-right"></i>
}
</a>
}
<a @onclick="@(async () => { accountsModal?.Show(true); await HideOffCanvasMenu(); })" role="button" class="btn btn-sm @(accountService.MainAccount == null && otherAccountsCount == 0 ? "btn-primary" : "btn-outline-secondary") rounded-5 fs-6">
<i class="bi bi-plus-lg"></i>
@if (accountService.MainAccount == null && otherAccountsCount == 0)
{
<span class="me-2">&nbsp;Add account</span>
}
else
{
<i class="bi bi-plus-lg"></i>
}
</a>
<a @onclick="@(async () => await jsRuntime.InvokeVoidAsync("history.back"))" role="button" class="btn btn-sm btn-outline-secondary rounded-5 fs-6 d-none d-md-block" style="margin-left: auto;">
<i class="bi bi-arrow-left"></i>
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Nostrid.Core/Shared/NavMenu.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
visibility: visible;
transform: translate(0px);
transition: none;
min-width: 200px;
max-width: 200px;
min-width: 218px;
max-width: 218px;
}
}

Expand Down

0 comments on commit 7c66cc7

Please sign in to comment.