improve: add production stage
This commit is contained in:
78
src/components/Footer.js
Normal file
78
src/components/Footer.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import React from "react";
|
||||
import "./Footer.css";
|
||||
|
||||
const Footer = () => {
|
||||
const [isExpanded, setIsExpanded] = React.useState(false);
|
||||
const [isVisible, setIsVisible] = React.useState(false);
|
||||
const toggleExpand = () => {
|
||||
if(!isExpanded) {
|
||||
setIsVisible(true);
|
||||
}
|
||||
setIsExpanded((prev) => !prev);
|
||||
};
|
||||
const onTransitionEnd = () => {
|
||||
if(!isExpanded) {
|
||||
setIsVisible(false);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<footer className={`footer ${isExpanded ? "expanded" : ""}`}>
|
||||
<button
|
||||
className="toggle-button"
|
||||
onClick={toggleExpand}
|
||||
type="button"
|
||||
>
|
||||
{isExpanded ? "↓" : "↑"}
|
||||
</button>
|
||||
<div className={`footer-content`}>
|
||||
<p>© {new Date().getFullYear()} Hangman Lab. All rights reserved.</p>
|
||||
{
|
||||
isVisible && (
|
||||
<div
|
||||
className={`footer-details ${isExpanded ? "expanded" : ""}`}
|
||||
onTransitionEnd={onTransitionEnd}
|
||||
>
|
||||
<div className="footer-icons">
|
||||
<a
|
||||
href="https://www.linkedin.com/in/zhhrozhh/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img
|
||||
src="/icons/linkedin.png"
|
||||
alt="LinkedIn"
|
||||
className="footer-icon"
|
||||
/>
|
||||
LinkedIn
|
||||
</a>
|
||||
<a
|
||||
href="https://git.hangman-lab.top/hzhang/HangmanLab"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img
|
||||
src="/icons/git.png"
|
||||
alt="GitHub"
|
||||
className="footer-icon"
|
||||
/>
|
||||
GitHub
|
||||
</a>
|
||||
<a href="mailto:hzhang@hangman-lab.top">
|
||||
<img
|
||||
src="/icons/email.png"
|
||||
alt="Email"
|
||||
className="footer-icon"
|
||||
/>
|
||||
Email
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
Reference in New Issue
Block a user