2021-07-15 21:08:33 +08:00
|
|
|
|
import React, { FC, MouseEventHandler } from "react";
|
|
|
|
|
import styles from "./global-sidebar.module.css";
|
2021-05-01 23:10:28 +08:00
|
|
|
|
import Link from "next/link";
|
2021-07-15 21:08:33 +08:00
|
|
|
|
import classnames from "classnames";
|
2021-05-01 23:10:28 +08:00
|
|
|
|
|
|
|
|
|
const fullName = `${process.env.NEXT_PUBLIC_FIRST_NAME} ${process.env.NEXT_PUBLIC_LAST_NAME}`;
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
className: string;
|
2021-07-15 21:08:33 +08:00
|
|
|
|
focusOpen?: boolean;
|
|
|
|
|
onClick?: MouseEventHandler;
|
2021-05-01 23:10:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-07-15 21:08:33 +08:00
|
|
|
|
export const GlobalSidebar: FC<Props> = ({
|
|
|
|
|
className,
|
|
|
|
|
focusOpen = false,
|
|
|
|
|
onClick,
|
|
|
|
|
}) => {
|
2021-05-01 23:10:28 +08:00
|
|
|
|
return (
|
2021-07-15 21:08:33 +08:00
|
|
|
|
<div
|
|
|
|
|
className={classnames(className, styles.wrapper, {
|
|
|
|
|
[styles.focusOpen]: focusOpen,
|
|
|
|
|
})}
|
|
|
|
|
onClick={onClick}
|
|
|
|
|
>
|
2021-05-02 13:05:12 +08:00
|
|
|
|
<aside className={classnames(className, styles.sidebar)}>
|
|
|
|
|
<img className={styles.avatar} src="/images/avatar.png" />
|
|
|
|
|
<h2 className={styles.name}>{fullName}</h2>
|
2021-05-01 23:10:28 +08:00
|
|
|
|
|
2021-05-02 13:05:12 +08:00
|
|
|
|
<nav className={styles.nav}>
|
|
|
|
|
<ul>
|
|
|
|
|
<Link href="/">
|
|
|
|
|
<li className={styles.navItem}>
|
|
|
|
|
文章
|
|
|
|
|
<small> / ARTICLES</small>
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
|
|
|
|
<Link href="/tags">
|
|
|
|
|
<li className={styles.navItem}>
|
|
|
|
|
标签
|
|
|
|
|
<small> / TAGS</small>
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
|
|
|
|
<Link href="/about">
|
|
|
|
|
<li className={styles.navItem}>
|
|
|
|
|
关于
|
|
|
|
|
<small> / ABOUT</small>
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
<footer className={classnames(styles.bio, "md:block hidden")}>
|
|
|
|
|
{"“人造的身体,借来的心”"}
|
|
|
|
|
</footer>
|
|
|
|
|
<footer className={classnames(styles.bio, "md:hidden block")}>
|
|
|
|
|
{"好挤 (#`O′)"}
|
|
|
|
|
</footer>
|
|
|
|
|
</aside>
|
|
|
|
|
</div>
|
2021-05-01 23:10:28 +08:00
|
|
|
|
);
|
|
|
|
|
};
|