[Cashtab][Alias] Utilize existing isValidAliasString to gatekeep alias status checks
Summary:
T3363
The alias input status check should leverage the existing isValidAliasString function's regex to weed out all instances of non-alphanumeric inputs (e.g. capital letters, spaces, symbols, non-english characters).
The else block here is also removed to prevent the scenario where an available alias overrides the invalid alias input error.
Test Plan:
npm test
npm start
Ensure the following alias input permutations match the expected outcome:
- Valid input + unregistered alias = byte size and price message displayed
- Valid input + registered alias = Alias taken error displayed
- Invalid input (capital letter) + unregistered alias = invalid input error
- Invalid input (space) + unregistered alias = invalid input error
- Invalid input (% symbol) + unregistered alias = invalid input error
- Invalid input (字 non-english char) + unregistered alias = invalid input error
- Invalid input (capital letter) + registered alias = invalid input error
- Invalid input (space) + registered alias = invalid input error
- Invalid input (% symbol) + registered alias = invalid input error
- Invalid input (字 non-english char) + registered alias = invalid input error
- Enter an input, then delete the input = invalid input error
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D14923