about summary refs log tree commit diff
path: root/src/lib/strings
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-03-19 12:47:46 -0700
committerGitHub <noreply@github.com>2024-03-19 12:47:46 -0700
commita1c4f19731878f7026d398d28e475bbeb7de824a (patch)
tree3b4b869b69f71dacda41707b786916bb46a9f3f1 /src/lib/strings
parentb6903419a1112bae5397a398756e46a46afcf65f (diff)
downloadvoidsky-a1c4f19731878f7026d398d28e475bbeb7de824a.tar.zst
Use ALF for signup flow, improve a11y of signup (#3151)
* Use ALF for signup flow, improve a11y of signup

* adjust padding

* rm log

* org imports

* clarify allowance of hyphens

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* fix a few accessibility items

* Standardise date input across platforms (#3223)

* make the date input consistent across platforms

* integrate into new signup form

* rm log

* add transitions

* show correct # of steps

* use `FormError`

* animate buttons

* use `ScreenTransition`

* fix android text overflow via flex -> flex_1

* change button color

* (android) make date input the same height as others

* fix deps

* fix deps

---------

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/lib/strings')
-rw-r--r--src/lib/strings/handles.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/strings/handles.ts b/src/lib/strings/handles.ts
index a18fef453..bc07b32ec 100644
--- a/src/lib/strings/handles.ts
+++ b/src/lib/strings/handles.ts
@@ -27,6 +27,7 @@ export function sanitizeHandle(handle: string, prefix = ''): string {
 
 export interface IsValidHandle {
   handleChars: boolean
+  hyphenStartOrEnd: boolean
   frontLength: boolean
   totalLength: boolean
   overall: boolean
@@ -39,6 +40,7 @@ export function validateHandle(str: string, userDomain: string): IsValidHandle {
   const results = {
     handleChars:
       !str || (VALIDATE_REGEX.test(fullHandle) && !str.includes('.')),
+    hyphenStartOrEnd: !str.startsWith('-') && !str.endsWith('-'),
     frontLength: str.length >= 3,
     totalLength: fullHandle.length <= 253,
   }