Skip to content

Commit

Permalink
Fixing #1
Browse files Browse the repository at this point in the history
  • Loading branch information
p6laris committed Apr 4, 2024
1 parent b6450d5 commit 86bcd03
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions AraratMorse/Components/UI/Sidebar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</li>
}
<li>
<a @onclick="NavigateToConverter" class="flex items-center p-2 text-black rounded-lg hover:bg-gray-100 group cursor-pointer">
<a @onclick="() => NavigateToPage(Page.Converter)" class="flex items-center p-2 text-black rounded-lg hover:bg-gray-100 group cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
<g fill="currentColor">
<path d="m11.985 21.449l.489-.824c.378-.64.568-.96.872-1.136c.304-.177.687-.184 1.453-.197c1.13-.02 1.84-.089 2.434-.335a4.502 4.502 0 0 0 2.438-2.435c.161-.39.247-.83.292-1.406c.027-.354.041-.53-.053-.674c-.095-.143-.276-.205-.638-.327C17.864 13.64 14.752 12.481 13 11c-1.98-1.674-3.754-5.054-4.418-6.414c-.142-.29-.213-.435-.336-.511c-.123-.076-.28-.074-.592-.07c-1.808.02-2.637.126-3.504.657a4.502 4.502 0 0 0-1.486 1.486C2 7.23 2 8.703 2 11.65v.9c0 2.096 0 3.145.343 3.972a4.502 4.502 0 0 0 2.437 2.435c.595.246 1.304.316 2.434.335c.766.013 1.15.02 1.453.197c.305.177.494.496.873 1.136l.488.824c.435.735 1.522.735 1.957 0Z"/><path fill-rule="evenodd" d="M13.702 1.217a.696.696 0 0 1-.007 1.035l-1.002.921a47.2 47.2 0 0 1 2.467.076c.65.041 1.26.104 1.79.202c.52.096 1.022.237 1.42.46c.74.418 1.363.99 1.817 1.672c.438.656.63 1.398.723 2.292c.09.875.09 1.969.09 3.355v.038c0 .404-.352.732-.786.732c-.434 0-.785-.328-.785-.732c0-1.433-.001-2.456-.084-3.253c-.08-.785-.236-1.274-.493-1.66a3.78 3.78 0 0 0-1.296-1.191c-.168-.096-.462-.195-.912-.278a13.727 13.727 0 0 0-1.59-.177a45.123 45.123 0 0 0-2.348-.072l.989.91a.696.696 0 0 1 .007 1.034a.828.828 0 0 1-1.111.006L10.234 4.42A.707.707 0 0 1 10 3.899c0-.196.084-.383.234-.52L12.59 1.21a.828.828 0 0 1 1.11.006Z" clip-rule="evenodd"/>
Expand All @@ -34,7 +34,7 @@
</a>
</li>
<li>
<a href="about" class="flex items-center p-2 text-black rounded-lg hover:bg-gray-100 group">
<a @onclick="() => NavigateToPage(Page.About)" class="flex items-center p-2 text-black rounded-lg hover:bg-gray-100 group cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
<path fill="currentColor" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10Zm-10 5.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75ZM12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2Z" clip-rule="evenodd"/>
</svg>
Expand All @@ -55,6 +55,11 @@

@code {

enum Page
{
Converter,
About
}
#region Fields

public bool isOpened { get; set; } = false;
Expand All @@ -68,9 +73,10 @@
isOpened = !isOpened;
}

void NavigateToConverter()
void NavigateToPage(Page page)
{
Navigation.NavigateTo("", false);
string uri = page is Page.Converter ? "" : "about";
Navigation.NavigateTo(uri, false);
isOpened = false;
}

Expand Down

0 comments on commit 86bcd03

Please sign in to comment.