components: memoize and streamline callbacks

This commit is contained in:
rektdeckard
2020-09-14 01:05:55 -04:00
parent 1d862e6587
commit b4db1df589
6 changed files with 30 additions and 23 deletions

View File

@@ -25,19 +25,17 @@ const illustrationVariants = {
visible: { opacity: 1, transition: { duration: 0.2 } },
};
const handleGetStarted = () => {
const handleGetStarted = () =>
window.open(
"https://github.com/phosphor-icons/phosphor-web#phosphor-icons",
"_blank",
"noopener noreferrer"
);
};
const handleScrollToIcons = () => {
const handleScrollToIcons = () =>
document
.getElementById("toolbar")
?.scrollIntoView({ behavior: "smooth", block: "start" });
};
const Header: React.FC<HeaderProps> = () => {
return (
@@ -62,7 +60,11 @@ const Header: React.FC<HeaderProps> = () => {
</button>
</div>
<div className="links">
<a className="nav-link" href="#">
<a
className="nav-link"
href={`${process.env.PUBLIC_URL}/favicon.ico`}
download
>
Download all
</a>
<a