public async Task <IViewComponentResult> InvokeAsync(ApplicationUser user)
        {
            var hasDismissedCookieBanner = Request.Cookies.ContainsKey("cookieWarningDismissed");
            var isRegistrationOver       = await mediator.Send(new RegistrationAvailabilityQuery());

            var model = new HeaderMenuViewModel
            {
                UserName         = user?.SkaterName,
                UserProfileImage =
                    string.IsNullOrWhiteSpace(user?.ExternalProfileImage)
                                        ? gravatarResolver.GetGravatarUrl(user?.Email)
                                        : user?.ExternalProfileImage,
                IsLoggedIn         = user != null,
                ShowCookieBanner   = user == null && !hasDismissedCookieBanner,
                IsRegistrationOver = isRegistrationOver
            };

            return(View("~/Views/Shared/Components/HeaderMenu/Default.cshtml", model));
        }
 private string GetProfileImage(string emailAddress, string profileImage)
 {
     return(string.IsNullOrWhiteSpace(profileImage) ? gravatarResolver.GetGravatarUrl(emailAddress) : profileImage);
 }
Exemplo n.º 3
0
 private string GetProfileImage(ApplicationUser skater)
 {
     return(string.IsNullOrWhiteSpace(skater?.ExternalProfileImage)
                ? gravatarResolver.GetGravatarUrl(skater?.Email)
                : skater.ExternalProfileImage);
 }