namespace ShoopNCook.Pages;

public partial class MorePage : ContentPage
{
	public MorePage(): this("Adom Shafi", ImageSource.FromFile("default_profile_picture.png"))
	{
	}

	public MorePage(string userName, ImageSource userImage)
	{
        InitializeComponent();
		ProfileImage.Source = userImage;
		ProfileName.Text = userName;
    }
    private async void OnMyRecipesButtonTapped(object sender, EventArgs e)
    {
        await Shell.Current.Navigation.PushAsync(new MyRecipesPage());
    }
    
    private async void OnEditProfileButtonTapped(object sender, EventArgs e)
    {
        await Shell.Current.Navigation.PushAsync(new ProfilePage());
    }
    
    private async void OnLogoutButtonTapped(object sender, EventArgs e)
    {
        await Shell.Current.GoToAsync("//LoginPage");
    }
    private async void OnShareButtonClicked(object sender, EventArgs e)
    {
        await Share.RequestAsync(new ShareTextRequest
        {
            Text = "Voici le texte à partager (à changer)",
            Title = "Partagez ce texte : (à modifier)"
        });
    }
}