diff --git a/src/Common/DTOs/Leaderboard/LeaderboardUserDto.cs b/src/Common/DTOs/Leaderboard/LeaderboardUserDto.cs index 8d74c0ce..42375309 100644 --- a/src/Common/DTOs/Leaderboard/LeaderboardUserDto.cs +++ b/src/Common/DTOs/Leaderboard/LeaderboardUserDto.cs @@ -1,4 +1,5 @@ -using SSW.Rewards.Domain.Entities; +using System.Text.RegularExpressions; +using SSW.Rewards.Domain.Entities; namespace SSW.Rewards.Shared.DTOs.Leaderboard; @@ -52,7 +53,7 @@ public LeaderboardUserDto(User user, DateTime firstDayOfWeek) if (!string.IsNullOrEmpty(company)) { - Title = company; + Title = Regex.Replace(company, @"^https?://", string.Empty); } else { diff --git a/src/MobileUI/Features/Activity/ActivityPageViewModel.cs b/src/MobileUI/Features/Activity/ActivityPageViewModel.cs index 256b307c..e5832ee4 100644 --- a/src/MobileUI/Features/Activity/ActivityPageViewModel.cs +++ b/src/MobileUI/Features/Activity/ActivityPageViewModel.cs @@ -1,3 +1,4 @@ +using System.Text.RegularExpressions; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using SSW.Rewards.ApiClient.Services; @@ -123,6 +124,7 @@ private async Task> GetFeedData() : x.UserAvatar; x.AchievementMessage = GetMessage(x.Achievement); x.TimeElapsed = DateTimeHelpers.GetTimeElapsed(x.AwardedAt); + x.UserTitle = Regex.Replace(x.UserTitle, @"^https?://", string.Empty); return x; }).ToList(); } diff --git a/src/MobileUI/Features/Leaderboard/LeaderViewModel.cs b/src/MobileUI/Features/Leaderboard/LeaderViewModel.cs index 9cea01e7..02c41c91 100644 --- a/src/MobileUI/Features/Leaderboard/LeaderViewModel.cs +++ b/src/MobileUI/Features/Leaderboard/LeaderViewModel.cs @@ -1,4 +1,5 @@ using System.Net.Mail; +using System.Text.RegularExpressions; using SSW.Rewards.Shared.DTOs.Leaderboard; namespace SSW.Rewards.Mobile.ViewModels; @@ -35,7 +36,7 @@ public LeaderViewModel(LeaderboardUserDto dto, bool isMe) Balance = dto.Balance; Email = dto.Email; IsMe = isMe; - Title = dto.Title; + Title = Regex.Replace(dto.Title, @"^https?://", string.Empty); } public int DisplayPoints { get; set; } diff --git a/src/MobileUI/Features/Profile/ProfileViewModelBase.cs b/src/MobileUI/Features/Profile/ProfileViewModelBase.cs index 15346078..b9f4621a 100644 --- a/src/MobileUI/Features/Profile/ProfileViewModelBase.cs +++ b/src/MobileUI/Features/Profile/ProfileViewModelBase.cs @@ -1,4 +1,5 @@ using System.Collections.ObjectModel; +using System.Text.RegularExpressions; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Mopups.Services; @@ -147,7 +148,9 @@ private string GetTitle() return "SSW"; } - return !string.IsNullOrEmpty(CompanyUrl) ? CompanyUrl : "Community"; + return !string.IsNullOrEmpty(CompanyUrl) + ? Regex.Replace(CompanyUrl, @"^https?://", string.Empty) + : "Community"; } [RelayCommand]