feat: responsive view (#75)

* chore: add license

* feat: mobile view
This commit is contained in:
STEVEN
2022-06-19 11:32:49 +08:00
committed by GitHub
parent b96d78ed19
commit cd7000da70
23 changed files with 149 additions and 119 deletions

View File

@ -27,6 +27,11 @@ const Sidebar: React.FC<Props> = () => {
return (
<aside className="sidebar-wrapper">
<div className="close-container">
<span className="action-btn" onClick={toggleSiderbar}>
<img src="/icons/close.svg" className="icon-img" alt="" />
</span>
</div>
<UserBanner />
<div className="status-text-container">
<div className="status-text memos-text">
@ -57,4 +62,14 @@ const Sidebar: React.FC<Props> = () => {
);
};
export const toggleSiderbar = () => {
const sidebarEl = document.body.querySelector(".sidebar-wrapper") as HTMLDivElement;
const display = window.getComputedStyle(sidebarEl).display;
if (display === "none") {
sidebarEl.style.display = "flex";
} else {
sidebarEl.style.display = "none";
}
};
export default Sidebar;