2
0

🚸 (fileUpload) Add success labels cutomization

Closes #515
This commit is contained in:
Baptiste Arnaud
2024-02-05 14:11:04 +01:00
parent 27b95c1f0b
commit 9fc05cb150
8 changed files with 125 additions and 33 deletions

View File

@@ -2,4 +2,6 @@ const urlRegex =
/^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]:[0-9]*\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]:[0-9]*\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$/
export const validateUrl = (url: string) =>
url.startsWith('http://localhost') || urlRegex.test(url)
url.startsWith('http://localhost') ||
url.startsWith('http://fake-upload-url.com') ||
urlRegex.test(url)