feat : add dark theme

release
Amir Hossein Khademi 2024-02-26 14:29:10 +03:30
parent acb8cfc638
commit 4ae2dcfb39
4 changed files with 30 additions and 27 deletions

View File

@ -13,7 +13,7 @@
</Found>
<NotFound>
<MudRTLProvider RightToLeft="true">
<MudThemeProvider IsDarkMode="true" Theme="@MainTheme.MyCustomTheme" />
<MudThemeProvider IsDarkMode="@MainTheme.IsDarkMode" Theme="@MainTheme.MyCustomTheme" />
<MudDialogProvider />
<MudSnackbarProvider />

View File

@ -32,7 +32,7 @@
<AuthorizeView>
<Authorized>
<MudRTLProvider RightToLeft="true">
<MudThemeProvider IsDarkMode="false" Theme="@MainTheme.MyCustomTheme" />
<MudThemeProvider IsDarkMode="@MainTheme.IsDarkMode" Theme="@MainTheme.MyCustomTheme" />
<MudDialogProvider />
<MudSnackbarProvider />
<RadzenContextMenu />
@ -53,7 +53,9 @@
<MudText Color="Color.Inherit" Typo="Typo.caption">@_user?.PhoneNumber</MudText>
</MudStack>
<MudSpacer />
@* <MudIconButton Size="Size.Medium" Color="Color.Inherit" Icon="@Icons.Material.Outlined.Settings"/> *@
<MudToggleIconButton @bind-Toggled="@MainTheme.IsDarkMode"
Icon="@Icons.Material.Outlined.DarkMode" Color="@Color.Default" Title="تاریک"
ToggledIcon="@Icons.Material.Filled.LightMode" ToggledColor="@Color.Default" ToggledTitle="روشن" />
<MudIconButton Size="Size.Medium" Color="Color.Error" OnClick="LogoutAsync" Icon="@Icons.Material.Outlined.ExitToApp" />
</MudAppBar>

View File

@ -3,8 +3,8 @@
public static class Address
{
#if DEBUG
public static string BaseAddress = "http://localhost:32770/api";
//public static string BaseAddress = "https://api.vesmook.com/api";
//public static string BaseAddress = "http://localhost:32770/api";
public static string BaseAddress = "https://api.vesmook.com/api";
#else
public static string BaseAddress = "https://api.vesmook.com/api";
#endif

View File

@ -23,4 +23,5 @@ public static class MainTheme
Secondary = "#E59F2E",
}
};
public static bool IsDarkMode { get; set; } = true;
}