feat: validate host, port and nickname fields

This commit is contained in:
2023-02-21 02:26:19 +02:00
parent c965143264
commit bd4d332b75
2 changed files with 47 additions and 0 deletions
+3
View File
@@ -61,15 +61,18 @@ func NewLogin() State {
t.Focus()
t.CharLimit = 40
t.TextStyle = FocusedStyle
t.Validate = NoSpacesValidation
case 1:
t.Placeholder = "Port"
t.CharLimit = 5
t.Validate = ValidatePort
case 2:
t.Placeholder = "Channel"
t.CharLimit = 32
case 3:
t.Placeholder = "Nickname"
t.CharLimit = 32
t.Validate = NoSpacesValidation
case 4:
t.Placeholder = "Password"
t.CharLimit = 64