You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
397 B
23 lines
397 B
2 years ago
|
import React, { useState, useEffect } from "react";
|
||
|
|
||
|
const HiddenEmail = ({
|
||
|
email,
|
||
|
alt,
|
||
|
althref,
|
||
|
}: {
|
||
|
email: string;
|
||
|
alt: string;
|
||
|
althref: string;
|
||
|
}) => {
|
||
|
const [visible, setVisible] = useState(false);
|
||
|
useEffect(() => {
|
||
|
setVisible(true);
|
||
|
}, []);
|
||
|
|
||
|
return (
|
||
|
<a href={visible ? `mailto:${email}` : althref}>{visible ? email : alt}</a>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default HiddenEmail;
|