From c8ecdd23f073387264e4e66b0bfd2eaf2ef8d1ad Mon Sep 17 00:00:00 2001 From: Johnson Mao <86179381+JohnsonMao@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:38:09 +0800 Subject: [PATCH] feat: add mobile sidebar --- pages/learning-marathon/index.jsx | 80 ++++++++++++++++++------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/pages/learning-marathon/index.jsx b/pages/learning-marathon/index.jsx index 1dcc4dff..93596d59 100644 --- a/pages/learning-marathon/index.jsx +++ b/pages/learning-marathon/index.jsx @@ -4,10 +4,8 @@ import styled from '@emotion/styled'; import { useRouter } from 'next/router'; import SEOConfig from '@/shared/components/SEO'; import { GoArrowUpRight } from "react-icons/go"; +import { FaAngleUp } from "react-icons/fa6"; -import Navigation from '@/shared/components/Navigation_v2'; -import Footer from '@/shared/components/Footer_v2'; -import InfoCompletionGuard from '@/shared/components/InfoCompletionGuard'; import Button from '@mui/material/Button'; import Participant from '@/components/Marathon/Participant'; import Equip from '@/components/Marathon/Equip'; @@ -21,11 +19,6 @@ import { useAuth, useAuthDispatch } from '@/contexts/Auth'; import { cn } from '@/utils/cn'; import Banner from '@/components/Banner'; -const HomePageWrapper = styled.div` - --section-height: calc(100vh - 80px); - --section-height-offset: 80px; -`; - const StyledBannerButton = styled(Button)` &.MuiButton-root { position: absolute; @@ -117,6 +110,7 @@ const Sidebar = ({ onClickSignupButton }) => { const scrollPaddingTop = useScrollPaddingTop(); const [activeSection, setActiveSection] = useState(null); const [isShow, setIsShow] = useState(false); + const [isOpenSidebar, setIsOpenSidebar] = useState(false); const sidebarItems = [ { label: '活動介紹', href: '#marathon-intro' }, @@ -167,31 +161,51 @@ const Sidebar = ({ onClickSignupButton }) => { }, []); return ( - + <> + +