Skip to content

Commit

Permalink
fix:adjust eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentxuu committed Dec 14, 2024
1 parent 64b8c1c commit 7c6f242
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 67 deletions.
18 changes: 9 additions & 9 deletions components/Home/MarathonBanner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled';
import Image from '@/shared/components/Image';
import LearningMarathonImgDesktop from '@/public/assets/[email protected]';
import LearningMarathonImgMobile from '@/public/assets/[email protected]';
import { Box,Button} from '@mui/material';
import { Box, Button } from '@mui/material';
import { useRouter } from 'next/router';

const StyledBanner = styled(Box)`
Expand Down Expand Up @@ -63,33 +63,33 @@ const StyledBannerButton = styled(Button)`

const MarathonBanner = () => {
const router = useRouter();

return (
<StyledBanner>
<StyledBanner>
<Box className="desktop">
<Image
<Image
src={LearningMarathonImgDesktop.src}
alt="島島盃 - 學習馬拉松 2025 春季賽"
height="inherit"
background="linear-gradient(#fcfefe 10%, #e0f1f2 40%)"
borderRadius="0"
className="desktop"
/>
/>
</Box>
<Box className="mobile">
<Image
<Image
src={LearningMarathonImgMobile.src}
alt="島島盃 - 學習馬拉松 2025 春季賽"
height="inherit"
background="linear-gradient(#fcfefe 10%, #e0f1f2 40%)"
borderRadius="0"
className="mobile"
/>
/>
</Box>
<StyledBannerButton onClick={() => { router.push('/learning-marathon#marathon-intro'); }}>
不要錯過!點我了解
不要錯過!點我了解
</StyledBannerButton>
</StyledBanner>
</StyledBanner>
);
};

Expand Down
3 changes: 1 addition & 2 deletions pages/learning-marathon/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useEffect,useLayoutEffect } from 'react';
import React, { useMemo, useEffect, useLayoutEffect } from 'react';
import styled from '@emotion/styled';
import { useRouter } from 'next/router';
import { sendLoginConfirmation } from '@/utils/openLoginWindow';
Expand Down Expand Up @@ -208,7 +208,6 @@ const LearningMarathon = () => {
return () => clearTimeout(timer);
}, [router.asPath]);


return (
<>
<SEOConfig data={SEOData} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,34 @@ const MarathonList = ({ onCloseMenu = () => {} }) => {
const [isOpenMenu, setIsOpenMenu] = useState(true);

const sections = [
{
name: '活動詳情',
id: 'marathon-intro',
path: '/learning-marathon#marathon-intro'
{
name: '活動詳情',
id: 'marathon-intro',
path: '/learning-marathon#marathon-intro'
},
{
name: '學習計畫分享區',
id: 'marathon-sharing',
path: '/marathon-sharing'
{
name: '學習計畫分享區',
id: 'marathon-sharing',
path: '/marathon-sharing'
},
{
name: '活動公告',
id: 'marathon-announcement',
path: '/marathon-announcement'
{
name: '活動公告',
id: 'marathon-announcement',
path: '/marathon-announcement'
},
{
name: '成果分享(暫不公開)',
id: 'project-sharing',
{
name: '成果分享(暫不公開)',
id: 'project-sharing',
path: '/project-sharing',
disabled: true
disabled: true
}
];
const handleNavigation = (section) => {
if (section.disabled) return;

setIsOpenMenu(false);
onCloseMenu && onCloseMenu();

router.push(section.path);
};

Expand All @@ -75,13 +75,13 @@ const MarathonList = ({ onCloseMenu = () => {} }) => {
sx={{
fontSize: '18px',
display: 'flex',
color: '#16b9b3',
color: '#16b9b3',
borderRadius: '4px',
transition: 'background-color 0.3s ease, padding 0.3s ease',
}}
transition: 'background-color 0.3s ease, padding 0.3s ease',
}}
onClick={() => setIsOpenMenu(!isOpenMenu)}
>
島島盃-春季學習馬拉松
島島盃-春季學習馬拉松
{isOpenMenu ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
</Box>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Menu = ({ open, list, onCloseMenu, shiftTop = '80px' }) => {
/>
);
})}
<MarathonList onCloseMenu={onCloseMenu}/>
<MarathonList onCloseMenu={onCloseMenu} />
<MenuDivider />
{auth.isLoggedIn ? (
<UserAvatar user={auth.user} onCloseMenu={onCloseMenu} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState,useRef,useEffect } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import { keyframes, css } from '@emotion/react';
import styled from '@emotion/styled';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
Expand Down Expand Up @@ -57,34 +57,34 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => {
}, [isOpenMenu]);

const sections = [
{
name: '活動詳情',
id: 'marathon-intro',
path: '/learning-marathon#marathon-intro'
{
name: '活動詳情',
id: 'marathon-intro',
path: '/learning-marathon#marathon-intro'
},
{
name: '學習計畫分享區',
id: 'marathon-sharing',
path: '/marathon-sharing'
{
name: '學習計畫分享區',
id: 'marathon-sharing',
path: '/marathon-sharing'
},
{
name: '活動公告',
id: 'marathon-announcement',
path: '/marathon-announcement'
{
name: '活動公告',
id: 'marathon-announcement',
path: '/marathon-announcement'
},
{
name: '成果分享(暫不公開)',
id: 'project-sharing',
{
name: '成果分享(暫不公開)',
id: 'project-sharing',
path: '/project-sharing',
disabled: true
disabled: true
}
];
const handleNavigation = (section) => {
if (section.disabled) return;

setIsOpenMenu(false);
onCloseMenu && onCloseMenu();

router.push(section.path);
};

Expand All @@ -99,14 +99,14 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => {
display: 'flex',
alignItems: 'center',
backgroundColor: isOpenMenu ? '#def5f5' : '#16b9b3',
color: isOpenMenu ? '#16b9b3':'#fff',
color: isOpenMenu ? '#16b9b3' : '#fff',
padding: '8px',
borderRadius: '8px',
transition: 'background-color 0.3s ease, padding 0.3s ease',
}}
transition: 'background-color 0.3s ease, padding 0.3s ease',
}}
onClick={() => setIsOpenMenu(!isOpenMenu)}
>
島島盃-春季學習馬拉松
島島盃-春季學習馬拉松
{isOpenMenu ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
</Box>
<Box
Expand All @@ -122,15 +122,15 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => {
>
<Box sx={{ padding: !isPadScreen && '12px' }}>
{sections.map((section, i) => (
<StyledMenuItem
as="div"
key={section.id}
delay={`${i * 0.1}s`}
isDisabled={section.id === 'project-sharing'}
onClick={() => handleNavigation(section)}
>
{section.name}
</StyledMenuItem>
<StyledMenuItem
as="div"
key={section.id}
delay={`${i * 0.1}s`}
isDisabled={section.id === 'project-sharing'}
onClick={() => handleNavigation(section)}
>
{section.name}
</StyledMenuItem>
))}
</Box>
</Box>
Expand Down
1 change: 0 additions & 1 deletion shared/components/Navigation_v2/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const texts = [
'✨報名學習馬拉松,即可試用最新個人化功能輔助學習唷!✨',
];


// const ToolbarWrapper = styled(Toolbar)`
// margin: 0 auto;
// `;
Expand Down

0 comments on commit 7c6f242

Please sign in to comment.