-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding protection email from scraping
- Loading branch information
1 parent
6cf472a
commit d55c18c
Showing
3 changed files
with
27 additions
and
9 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
|
||
interface ProtectedEmailLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> { | ||
message: string; | ||
subject?: string | ||
} | ||
|
||
const ProtectedEmailLink: React.FC<ProtectedEmailLinkProps> = ({message, subject, ...props}) => { | ||
const email = 'contact@baptiste-lacroix.fr'; | ||
const encodedEmail = email | ||
.split('') | ||
.map(char => `%${char.charCodeAt(0).toString(16).toUpperCase()}`) | ||
.join(''); | ||
|
||
return ( | ||
<a href={`mailto:${encodedEmail}?subject=${subject}`} {...props}> | ||
{message} | ||
</a> | ||
); | ||
}; | ||
|
||
export default ProtectedEmailLink; |
This file was deleted.
Oops, something went wrong.