-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(create-bounty): prevent empty spaces
- Loading branch information
1 parent
faff89a
commit d43fefd
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/components/ModalsContainer/CreateBountyModal/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const BUDGET_PATTERN = /^[0-9]+$/ | ||
|
||
export const isBudgetValid = (budget: string): boolean => { | ||
const trimmedBudget = budget.trim() | ||
|
||
return !!(trimmedBudget && /^[0-9]+$/.test(trimmedBudget)) | ||
return !!(trimmedBudget && BUDGET_PATTERN.test(trimmedBudget)) | ||
} | ||
|
||
export const BUDGET_PATTERN = /^[0-9]+$/ |