feat(auth): add error text feedback

This commit is contained in:
EmirHanMamak 2026-01-17 14:35:12 +03:00
parent c947a84477
commit deb590ccb3
3 changed files with 16 additions and 3 deletions

View file

@ -678,7 +678,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
m_Name:
m_EditorClassIdentifier:
errorText: {fileID: 0}
errorText: {fileID: 562590035}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
@ -1609,7 +1609,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
m_Name:
m_EditorClassIdentifier:
errorText: {fileID: 0}
errorText: {fileID: 1082297275}
--- !u!1 &555582722
GameObject:
m_ObjectHideFlags: 0

View file

@ -60,6 +60,19 @@ namespace _Hub.Scripts.UI
(_maxUsernameLength >= _username.Length && _maxPasswordLength >= _password.Length) &&
usernameRegex.Success);
EnableLoginButton(interactable);
//Username
if (_username != null)
{
var usernameTooLong = _username.Length > _maxUsernameLength;
usernameInputField.Error(usernameTooLong);
}
//Password
if (_password != null )
{
var passwordTooLong = _password.Length > _maxPasswordLength;
passwordInputField.Error(passwordTooLong);
}
}
private void EnableLoginButton(bool interactable)

View file

@ -29,7 +29,7 @@ namespace _Network.Auth
}
else
{
errorText.gameObject.SetActive(true);
errorText.gameObject.SetActive(false);
}
}
}