remove unnecessary comments
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5ab02adc1a
commit
8e5e75d49d
@ -1,42 +1,41 @@
|
||||
|
||||
namespace ShoopNCook.Pages;
|
||||
using Models;
|
||||
using ShoopNCook.Views;
|
||||
using Endpoint;
|
||||
using LocalEndpoint;
|
||||
|
||||
public partial class HomePage : ContentPage
|
||||
{
|
||||
|
||||
public HomePage(Account account, IUserNotifier notifier, IEndpoint endpoint)
|
||||
{
|
||||
|
||||
|
||||
namespace ShoopNCook.Pages;
|
||||
using Models;
|
||||
using ShoopNCook.Views;
|
||||
using Endpoint;
|
||||
|
||||
public partial class HomePage : ContentPage
|
||||
{
|
||||
|
||||
public HomePage(Account account, IUserNotifier notifier, IEndpoint endpoint)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
BindingContext = account;
|
||||
IRecipesService service = endpoint.RecipesService;
|
||||
IAccountRecipesPreferences preferences = service.GetPreferencesOf(account);
|
||||
|
||||
|
||||
void PushRecipe(Layout layout, RecipeInfo info)
|
||||
{
|
||||
layout.Children.Add(new RecipeView(info, () =>
|
||||
{
|
||||
Recipe recipe = service.GetRecipe(info);
|
||||
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1));
|
||||
}));
|
||||
}
|
||||
|
||||
service.PopularRecipes().ForEach(recipe => PushRecipe(PopularsList, recipe));
|
||||
preferences.GetRecommendedRecipes().ForEach(recipe => PushRecipe(RecommendedList, recipe));
|
||||
|
||||
ProfilePictureImage.Source = ImageSource.FromUri(account.User.ProfilePicture);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnSyncButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
Shell.Current.Navigation.PushAsync(new SearchPage());
|
||||
}
|
||||
BindingContext = account;
|
||||
IRecipesService service = endpoint.RecipesService;
|
||||
IAccountRecipesPreferences preferences = service.GetPreferencesOf(account);
|
||||
|
||||
|
||||
void PushRecipe(Layout layout, RecipeInfo info)
|
||||
{
|
||||
layout.Children.Add(new RecipeView(info, () =>
|
||||
{
|
||||
Recipe recipe = service.GetRecipe(info);
|
||||
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1));
|
||||
}));
|
||||
}
|
||||
|
||||
service.PopularRecipes().ForEach(recipe => PushRecipe(PopularsList, recipe));
|
||||
preferences.GetRecommendedRecipes().ForEach(recipe => PushRecipe(RecommendedList, recipe));
|
||||
|
||||
ProfilePictureImage.Source = ImageSource.FromUri(account.User.ProfilePicture);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnSyncButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
Shell.Current.Navigation.PushAsync(new SearchPage());
|
||||
}
|
||||
}
|
Loading…
Reference in new issue