Files
FrontOffice/src/FrontOffice.Main/Shared/MainLayout.razor

91 lines
4.5 KiB
Plaintext
Raw Normal View History

2025-09-28 01:28:44 +03:30
@inherits LayoutComponentBase
2025-10-22 16:13:37 +03:30
<PageTitle>KBS</PageTitle>
2025-09-28 01:28:44 +03:30
<MudRTLProvider RightToLeft="true">
2025-09-28 10:55:21 +03:30
<MudThemeProvider @ref="_mudThemeProvider" Theme="CustomMudTheme.CustomMudBlazorTheme" @bind-IsDarkMode="_isDark" />
2025-10-07 00:39:38 +03:30
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
2025-09-28 01:28:44 +03:30
<MudLayout>
2025-09-28 10:55:21 +03:30
<!-- AppBar -->
2025-10-07 00:39:38 +03:30
<MudAppBar Elevation="0" Color="Color.Transparent" Dense="true" Class="py-2" id="top">
2025-09-28 10:55:21 +03:30
<MudContainer MaxWidth="MaxWidth.Large" Class="d-flex align-center justify-space-between w-100">
2025-10-07 00:39:38 +03:30
<MudHidden Breakpoint="Breakpoint.SmAndUp">
<MudIconButton Class="d-inline"
Icon="@Icons.Material.Filled.Menu"
OnClick="@ToggleDrawer" />
</MudHidden>
2025-09-28 10:55:21 +03:30
<div class="d-flex align-center gap-2">
2025-10-07 23:40:43 +03:30
<MudLink Href="@(RouteConstants.Main.MainPage)" Underline="Underline.None">
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Center">
<MudHidden Breakpoint="Breakpoint.SmAndUp" Invert="true">
<MudImage ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Center"
Width="32"
Height="32"
Class="rounded-circle"
Src="favicon.png" />
</MudHidden>
2025-10-22 16:13:37 +03:30
<MudText Typo="Typo.h6" >KBS</MudText>
2025-10-07 23:40:43 +03:30
</MudStack>
</MudLink>
2025-09-28 10:55:21 +03:30
</div>
2025-10-12 14:34:54 +03:30
<div class="d-none d-md-flex align-center gap-10">
2025-10-12 13:03:09 +03:30
<MudLink Href="@(RouteConstants.FAQ.Index)" Typo="Typo.subtitle1" Class="mud-link">سوالات متداول</MudLink>
2025-10-09 22:52:42 +03:30
<MudLink Href="@(RouteConstants.About.Index)" Typo="Typo.subtitle1" Class="mud-link">درباره ما</MudLink>
2025-10-12 17:26:27 +03:30
<MudLink Href="@(RouteConstants.Contact.Index)" Typo="Typo.subtitle1" Class="mud-link">ارتباط با ما</MudLink>
2025-09-28 10:55:21 +03:30
</div>
<div class="d-flex align-center gap-2">
2025-10-20 21:17:53 +03:30
@if (_isAuthenticated)
{
<MudMenu Icon="@Icons.Material.Filled.Person" Color="Color.Inherit" Size="Size.Medium">
<MudMenuItem OnClick="NavigateToProfile">پروفایل</MudMenuItem>
<MudDivider />
<MudMenuItem OnClick="Logout">خروج از حساب</MudMenuItem>
</MudMenu>
}
else
{
<MudIconButton Icon="@Icons.Material.Filled.Login" Color="Color.Inherit" OnClick="OpenAuthDialog" />
}
2025-10-07 00:39:38 +03:30
<MudIconButton OnClick="@ToggleTheme" Edge="Edge.End"
2025-09-28 10:55:21 +03:30
Icon="@(_isDark ? Icons.Material.Filled.DarkMode : Icons.Material.Filled.LightMode)" />
</div>
</MudContainer>
</MudAppBar>
<!-- Mobile Drawer -->
2025-10-07 00:39:38 +03:30
<MudDrawer @bind-Open="_drawerOpen" Anchor="Anchor.Right" Elevation="1" Variant="DrawerVariant.Temporary" Class="pa-4">
2025-10-20 21:02:13 +03:30
<MudStack Spacing="2">
2025-10-12 13:03:09 +03:30
<MudLink Href="@(RouteConstants.FAQ.Index)" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">سوالات متداول</MudLink>
2025-10-09 22:52:42 +03:30
<MudLink Href="@(RouteConstants.About.Index)" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">درباره ما</MudLink>
2025-10-12 17:26:27 +03:30
<MudLink Href="@(RouteConstants.Contact.Index)" Typo="Typo.subtitle1" OnClick="() => _drawerOpen=false">ارتباط با ما</MudLink>
2025-10-07 23:40:43 +03:30
2025-09-28 10:55:21 +03:30
<MudDivider Class="my-2" />
2025-10-07 23:40:43 +03:30
@if (_isAuthenticated)
{
<MudButton Href="/profile" Color="Color.Primary" OnClick="() => _drawerOpen=false">پروفایل</MudButton>
2025-10-20 21:02:13 +03:30
<MudButton Variant="Variant.Text" Color="Color.Error" OnClick="() => { _drawerOpen=false; Logout(); }">خروج از حساب</MudButton>
2025-10-07 23:40:43 +03:30
}
else
{
<MudButton Color="Color.Primary" OnClick="() => { _drawerOpen=false; OpenAuthDialog(); }">ورود</MudButton>
}
2025-09-28 10:55:21 +03:30
</MudStack>
</MudDrawer>
2025-09-28 01:28:44 +03:30
<MudMainContent>
@Body
2025-10-07 00:39:38 +03:30
<Footer />
2025-09-28 01:28:44 +03:30
</MudMainContent>
2025-10-07 00:39:38 +03:30
2025-09-28 01:28:44 +03:30
</MudLayout>
</MudRTLProvider>