add: email address format verification

This commit is contained in:
llovvoll 2021-08-26 12:31:07 +08:00
parent 33ff1400b0
commit e52bccc0a0

View File

@ -17,7 +17,8 @@ const components = {
}
const SocialIcon = ({ kind, href, size = 8 }) => {
if (!href) return null
if (!href || (kind === 'mail' && !/^mailto:\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/.test(href)))
return null
const SocialSvg = components[kind]