Selector/Selector.MAUI/Pages/Settings.razor

66 lines
1.8 KiB
Plaintext

@page "/settings"
<div class="form-container">
<h1 class="text-center">Settings</h1>
<div class="row">
<RadzenCard>
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Start Page</RadzenText>
<RadzenDropDown AllowClear="true" TValue="string" Class="w-100"
Data=@startManager.StartPages
@bind-Value="currentStartPage"
Change=@OnStartPageChange />
</RadzenCard>
</div>
<div class="row">
<RadzenButton Click=@(_ => OpenAbout()) Text="About" ButtonStyle="ButtonStyle.Info" />
</div>
<div class="row" style="margin-bottom: 30px">
<RadzenButton Click=@(_ => OpenPrivacy()) Text="Privacy Policy" ButtonStyle="ButtonStyle.Info" />
</div>
<div class="row">
<RadzenButton Click=@(_ => SignOut()) Text="Sign Out" ButtonStyle="ButtonStyle.Danger" />
</div>
<SignatureImage />
</div>
<div class="v-space"></div>
@code {
[Inject]
private SessionManager sessionManager { get; set; }
[Inject]
private NavigationManager navigationManager { get; set; }
[Inject]
private StartPageManager startManager { get; set; }
private string currentStartPage { get; set; }
protected override void OnInitialized()
{
currentStartPage = startManager.GetStartPage();
}
private void OnStartPageChange(object value)
{
startManager.SetStartPage((string) value);
}
private void SignOut()
{
sessionManager.SignOut();
navigationManager.NavigateTo("/");
}
private async void OpenAbout()
{
await Browser.Default.OpenAsync("https://sarsoo.xyz/selector");
}
private async void OpenPrivacy()
{
await Browser.Default.OpenAsync("https://selector.sarsoo.xyz/privacy");
}
}