feat(profile): add invitees section and inviter mobile functionality
- Introduced a new section in the Profile hub for viewing invitees, enhancing user engagement and tracking of referrals. - Added buttons for accessing the invitees page from the Profile index, improving navigation. - Enhanced the AuthDialog and PhoneVerifyForm components to support inviter mobile input, allowing users to specify who referred them. - Updated RouteConstants to include a new route for invitees, ensuring proper navigation within the application. These changes improve the user experience by facilitating better referral tracking and enhancing the profile management features.
This commit is contained in:
@@ -44,6 +44,8 @@ public partial class AuthDialog : IDisposable
|
||||
|
||||
// Referral code field
|
||||
private string? _referralCode;
|
||||
// Inviter mobile (دعوتکننده)
|
||||
private string? _inviterMobile;
|
||||
|
||||
[Inject] private ILocalStorageService LocalStorage { get; set; } = default!;
|
||||
[Inject] private UserContract.UserContractClient UserClient { get; set; } = default!;
|
||||
@@ -71,6 +73,7 @@ public partial class AuthDialog : IDisposable
|
||||
}
|
||||
|
||||
_referralCode = await LocalStorage.GetItemAsync<string>("referral:code");
|
||||
_inviterMobile = await LocalStorage.GetItemAsync<string>("inviter:mobile");
|
||||
// await LocalStorage.RemoveItemAsync(TokenStorageKey);
|
||||
}
|
||||
|
||||
@@ -83,6 +86,15 @@ public partial class AuthDialog : IDisposable
|
||||
await LocalStorage.RemoveItemAsync("referral:code");
|
||||
}
|
||||
|
||||
private async Task OnInviterMobileChanged(string? value)
|
||||
{
|
||||
_inviterMobile = value;
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
await LocalStorage.SetItemAsync("inviter:mobile", value);
|
||||
else
|
||||
await LocalStorage.RemoveItemAsync("inviter:mobile");
|
||||
}
|
||||
|
||||
private void GenerateCaptcha()
|
||||
{
|
||||
_captchaCode = Guid.NewGuid().ToString("N")[..6].ToUpperInvariant();
|
||||
@@ -204,6 +216,15 @@ public partial class AuthDialog : IDisposable
|
||||
_verifyRequest.ParentReferralCode = effectiveReferralCode;
|
||||
}
|
||||
|
||||
var storedInviterMobile = await LocalStorage.GetItemAsync<string>("inviter:mobile");
|
||||
var effectiveInviterMobile = !string.IsNullOrWhiteSpace(_inviterMobile)
|
||||
? _inviterMobile
|
||||
: storedInviterMobile;
|
||||
if (!string.IsNullOrWhiteSpace(effectiveInviterMobile))
|
||||
{
|
||||
_verifyRequest.InviterMobile = effectiveInviterMobile;
|
||||
}
|
||||
|
||||
var validationResult = true; // _verifyRequestValidator.Validate(_verifyRequest);
|
||||
if (!validationResult)
|
||||
{
|
||||
@@ -236,6 +257,7 @@ public partial class AuthDialog : IDisposable
|
||||
await LocalStorage.RemoveItemAsync(PhoneStorageKey);
|
||||
await LocalStorage.RemoveItemAsync(RedirectStorageKey);
|
||||
await LocalStorage.RemoveItemAsync("referral:code");
|
||||
await LocalStorage.RemoveItemAsync("inviter:mobile");
|
||||
|
||||
_attemptsLeft = MaxVerificationAttempts;
|
||||
_verifyRequest.Code = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user