Skip to content

Commit

Permalink
add check for imgUrl and imdbUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
HoTaBu4 committed Feb 9, 2024
1 parent c0fd5be commit 141ced7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ export const TextField: React.FC<Props> = ({
required = false,
onChange = () => {},
}) => {
const pattern = /^((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@,.\w_]*)#?(?:[,.!/\\\w]*))?)$/;
const pattern = new RegExp(
'^((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|'
+ '(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[+~%/\\.\\w-_]*)?'
+ '\\??(?:[-+=&;%@,\\.\\w_]*)#?(?:[,.!/\\\\\\w]*))?)$',
);
// generage a unique id once on component load
const [id] = useState(() => `${name}-${getRandomDigits()}`);

Expand Down

0 comments on commit 141ced7

Please sign in to comment.