mirror of
https://github.com/SomboChea/ui
synced 2026-01-20 01:55:56 +07:00
fix: verify validation url and email (#60)
* fix: verify validation url and email * chore: disable one expect * fix: lint issue * fix: fix lint
This commit is contained in:
committed by
GitHub
parent
233ba196a0
commit
980dac5b2f
@@ -10,6 +10,7 @@ import ListItemText from '@material-ui/core/ListItemText/index';
|
||||
|
||||
import { DetailContextConsumer } from '../../pages/version/index';
|
||||
import { Heading, AuthorListItem } from './styles';
|
||||
import { isEmail } from '../../utils/url';
|
||||
|
||||
class Authors extends Component<any, any> {
|
||||
render() {
|
||||
@@ -23,9 +24,10 @@ class Authors extends Component<any, any> {
|
||||
}
|
||||
|
||||
renderLinkForMail(email, avatarComponent, packageName, version) {
|
||||
if (!email) {
|
||||
if (!email || isEmail(email) === false) {
|
||||
return avatarComponent;
|
||||
}
|
||||
|
||||
return (
|
||||
<a href={`mailto:${email}?subject=${packageName}@${version}`} target={'_top'}>
|
||||
{avatarComponent}
|
||||
|
||||
Reference in New Issue
Block a user