Skip to content

Commit

Permalink
fix: academe bug (#283)
Browse files Browse the repository at this point in the history
Signed-off-by: laixingyou <[email protected]>
  • Loading branch information
coder-sett authored Dec 13, 2023
1 parent 4f3c2b2 commit 79c71ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
25 changes: 15 additions & 10 deletions apps/web/src/modules/academe/CooperationCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,30 @@ async function getData({ repo }) {
const Timer = ({
time = 15,
setActiveFun,
open,
}: {
time?: number;
setActiveFun: () => void;
open: boolean;
}) => {
const [progress, setProgress] = useState(0);

useEffect(() => {
const interval = setInterval(() => {
setProgress((prevProgress) => {
if (prevProgress >= 101) {
setActiveFun();
return 0;
} else {
return prevProgress + 10 / time;
}
});
!open &&
setProgress((prevProgress) => {
if (prevProgress >= 101) {
setActiveFun();
return 0;
} else {
return prevProgress + 10 / time;
}
});
}, 100);
return () => {
clearInterval(interval);
};
}, []);
}, [open]);

return (
<div>
Expand Down Expand Up @@ -79,7 +83,7 @@ const CooperationCase = () => {
{t('academe:nju_desc')}
<LinkX
href={
'/blog/2023/12/07/compass-prediction-activity/compass-prediction-activity'
'/blog/2023/12/06/compass-prediction-activity/compass-prediction-activity'
}
>
<span className="text-[#002fa7]">{t('academe:nju_title')}</span>
Expand Down Expand Up @@ -434,6 +438,7 @@ const CooperationCase = () => {
index === caseList.length - 1 ? 0 : index + 1
);
}}
open={open}
/>
)}
</div>
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/modules/academe/components/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { useRouter } from 'next/router';
import classnames from 'classnames';
import { useTranslation } from 'next-i18next';
import Coutact from '../../Coutact';
import style from './index.module.css';

const Banner = () => {
const { t } = useTranslation();
const router = useRouter();
return (
<div
className={classnames(
Expand All @@ -17,7 +15,7 @@ const Banner = () => {
>
<div
className={classnames(
'absolute right-28 bottom-0 h-60 w-[376px] md:-right-[300px]',
'absolute right-28 bottom-0 h-[213px] w-[359px] md:-right-[300px]',
style.headerBgGraph
)}
></div>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/modules/academe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Banner from '@modules/academe/components/Banner';
import CooperationCase from './CooperationCase';
import CooperationProcess from './CooperationProcess';
import SubmitApplication from './SubmitApplication';
import Footer from '@common/components/Footer';

const Explore = () => {
return (
Expand All @@ -17,6 +18,7 @@ const Explore = () => {
<SubmitApplication />
</div>
</div>
<Footer />
</>
);
};
Expand Down

2 comments on commit 79c71ad

@vercel
Copy link

@vercel vercel bot commented on 79c71ad Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 79c71ad Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.