Skip to content

CAS-187 - add helper text to Community Links#132

Merged
dbslone merged 6 commits intomainfrom
germanurrustarazu/cas-187
Jul 14, 2022
Merged

CAS-187 - add helper text to Community Links#132
dbslone merged 6 commits intomainfrom
germanurrustarazu/cas-187

Conversation

@germanurrus
Copy link
Copy Markdown
Contributor

Screen Shot 2022-07-12 at 13 06 54

@germanurrus germanurrus self-assigned this Jul 12, 2022
wrapperMarginMobile = 'mb-4',
}) => {
const { register, formState } = useFormContext();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using context to plug react-hook

@germanurrus germanurrus force-pushed the germanurrustarazu/cas-187 branch from 7b4f1e7 to 5901998 Compare July 12, 2022 22:47
@germanurrus germanurrus marked this pull request as ready for review July 12, 2022 23:01
@germanurrus germanurrus force-pushed the germanurrustarazu/cas-187 branch from fa9e99b to 5901998 Compare July 12, 2022 23:04
Comment on lines +19 to +41
const regex = new RegExp('(https://)(www\\.)twitter\\.com/(\\w+)', 'i');
return url === '' || !!regex.test(url);
};
const instagramValidator = (url) => {
return (
url === '' ||
/(?:(?:http|https):\/\/)?(?:www.)?(?:instagram.com|instagr.am|instagr.com)\/(\w+)/gim.test(
/(https:\/\/)(www\.)(?:instagram.com|instagr.am|instagr.com)\/(\w+)/gim.test(
url
)
);
};
const discordValidator = (url) => {
return (
url === '' ||
/(https?:\/\/)?(www\.)?(discord\.(gg|io|me|li|com)|discordapp\.com\/invite)\/.+[a-zA-Z0-9]/gim.test(
/(https:\/\/)(www\.)(discord\.(gg|io|me|li|com)|discordapp\.com\/invite)\/.+[a-zA-Z0-9]/gim.test(
url
)
);
};
const githubValidator = (url) => {
return url === '' || /https?:\/\/github\.com\/(?:[^/\s]+)/gim.test(url);
return (
url === '' || /(https:\/\/)(www\.)(github\.com)\/(?:[^/\s]+)/gim.test(url)
);
Copy link
Copy Markdown
Contributor Author

@germanurrus germanurrus Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes done to enforce patter https://www. to be consistent with place holders

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The www. should still be optional in the regex

@germanurrus
Copy link
Copy Markdown
Contributor Author

@dbslone updates done

@dbslone dbslone merged commit 7e81d42 into main Jul 14, 2022
@dbslone dbslone deleted the germanurrustarazu/cas-187 branch July 14, 2022 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants