1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-03 09:03:35 +00:00
Files
mobile/src/App/Pages/Accounts/HomePage.xaml.cs
Kyle Spearrin 2b670a5ae1 ios themeing
2019-06-24 14:29:23 -04:00

49 lines
1.4 KiB
C#

using Bit.App.Utilities;
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class HomePage : BaseContentPage
{
public HomePage()
{
InitializeComponent();
var theme = ThemeManager.GetTheme(Device.RuntimePlatform == Device.Android);
var darkbasedTheme = theme == "dark" || theme == "black" || theme == "nord";
_logo.Source = darkbasedTheme ? "logo_white.png" : "logo.png";
}
public async Task DismissRegisterPageAndLogInAsync(string email)
{
await Navigation.PopModalAsync();
await Navigation.PushModalAsync(new NavigationPage(new LoginPage(email)));
}
private void LogIn_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
Navigation.PushModalAsync(new NavigationPage(new LoginPage()));
}
}
private void Register_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
Navigation.PushModalAsync(new NavigationPage(new RegisterPage(this)));
}
}
private void Settings_Clicked(object sender, EventArgs e)
{
if(DoOnce())
{
Navigation.PushModalAsync(new NavigationPage(new EnvironmentPage()));
}
}
}
}