Skip to content

Commit 5924dde

Browse files
committed
[migrate] replace built-in Count Down & Zodiac Bar components with Idea-React 2.2
1 parent b160b03 commit 5924dde

9 files changed

Lines changed: 289 additions & 302 deletions

File tree

components/Activity/Hackathon/AgendaCountdown.module.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
grid-template-columns: repeat(4, minmax(0, 1fr));
2121
gap: 0.8rem;
2222

23-
li {
23+
.item {
2424
gap: 0.7rem;
2525
box-shadow:
2626
inset 0 0 0 1px rgba(255, 255, 255, 0.03),

components/Activity/Hackathon/AgendaCountdown.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { TableCellValue } from 'mobx-lark';
22
import { observer } from 'mobx-react';
33
import { FC, useContext, useState } from 'react';
4+
import { Countdown, TimeUnit } from 'idea-react';
45

56
import { Agenda } from '../../../models/Hackathon';
67
import { I18nContext } from '../../../models/Translation';
7-
import { Countdown, TimeUnit } from '../../Base/Countdown';
88
import styles from './AgendaCountdown.module.less';
99
import { agendaTypeLabelOf, resolveCountdownState } from './utility';
1010

@@ -15,7 +15,7 @@ export interface AgendaCountdownProps {
1515
units: TimeUnit[];
1616
}
1717

18-
export const AgendaCountdown: FC<AgendaCountdownProps> = observer(
18+
const AgendaCountdown: FC<AgendaCountdownProps> = observer(
1919
({ agendaItems, endTime, startTime, units }) => {
2020
const { t } = useContext(I18nContext);
2121
const [referenceTime, setReferenceTime] = useState(Date.now());
@@ -38,6 +38,7 @@ export const AgendaCountdown: FC<AgendaCountdownProps> = observer(
3838

3939
<Countdown
4040
className={styles.grid}
41+
itemClassName={`${styles.item} d-flex flex-column align-items-center justify-content-center`}
4142
endTime={countdownTo}
4243
onEnd={() => setReferenceTime(Date.now())}
4344
units={units}
@@ -46,3 +47,4 @@ export const AgendaCountdown: FC<AgendaCountdownProps> = observer(
4647
);
4748
},
4849
);
50+
export default AgendaCountdown;

components/Activity/Hackathon/Hero.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { TableCellValue } from 'mobx-lark';
2+
import dynamic from 'next/dynamic';
23
import { FC } from 'react';
34
import { Container } from 'react-bootstrap';
5+
import { TimeUnit } from 'idea-react';
46

57
import { Agenda } from '../../../models/Hackathon';
68
import { LarkImage } from '../../LarkImage';
7-
import { AgendaCountdown } from './AgendaCountdown';
8-
import { TimeUnit } from '../../Base/Countdown';
99
import styles from './Hero.module.less';
1010

11+
const AgendaCountdown = dynamic(() => import('./AgendaCountdown'), { ssr: false });
12+
1113
export type HackathonHeroNavItem = Record<'label' | 'href', string>;
1214

1315
export interface HackathonHeroAction extends HackathonHeroNavItem {

components/Base/Countdown.tsx

Lines changed: 0 additions & 105 deletions
This file was deleted.

components/Base/ZodiacBar.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"core-js": "^3.49.0",
2222
"echarts-jsx": "^0.6.0",
2323
"file-type": "^22.0.1",
24-
"idea-react": "^2.0.0-rc.13",
24+
"idea-react": "^2.2.0",
2525
"jsonwebtoken": "^9.0.3",
2626
"koa": "^3.2.0",
2727
"koa-jwt": "^4.0.4",
2828
"koajax": "^3.3.0",
2929
"license-filter": "^0.2.5",
30-
"marked": "^18.0.2",
30+
"marked": "^18.0.3",
3131
"mime": "^4.1.0",
3232
"mobx": "^6.15.0",
3333
"mobx-github": "^0.6.2",
@@ -49,7 +49,7 @@
4949
"react-typed-component": "^1.0.6",
5050
"remark-frontmatter": "^5.0.0",
5151
"remark-mdx-frontmatter": "^5.2.0",
52-
"web-utility": "^4.6.5",
52+
"web-utility": "^4.6.6",
5353
"yaml": "^2.8.3"
5454
},
5555
"devDependencies": {
@@ -69,7 +69,7 @@
6969
"@types/nodemailer": "^8.0.0",
7070
"@types/react": "^19.2.14",
7171
"@types/react-dom": "^19.2.3",
72-
"eslint": "^10.2.1",
72+
"eslint": "^10.3.0",
7373
"eslint-config-next": "^16.2.4",
7474
"eslint-config-prettier": "^10.1.8",
7575
"eslint-plugin-react": "^7.37.5",

pages/NGO/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { InferGetServerSidePropsType } from 'next';
33
import { cache, compose, errorLogger } from 'next-ssr-middleware';
44
import { FC, useContext } from 'react';
55
import { Container } from 'react-bootstrap';
6+
import { ZodiacBar } from 'idea-react';
67

7-
import { ZodiacBar } from '../../components/Base/ZodiacBar';
88
import { PageHead } from '../../components/Layout/PageHead';
99
import { OrganizationModel } from '../../models/Organization';
1010
import { I18nContext } from '../../models/Translation';

pages/hackathon/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { TableCellLocation, TableFormView } from 'mobx-lark';
22
import { observer } from 'mobx-react';
33
import { cache, compose, errorLogger } from 'next-ssr-middleware';
44
import { FC, useContext } from 'react';
5+
import { TimeUnit } from 'idea-react';
56

67
import {
78
HackathonActionHub,
@@ -25,7 +26,6 @@ import {
2526
heroNavigation,
2627
RequiredTableKeys,
2728
} from '../../components/Activity/Hackathon/constant';
28-
import { TimeUnit } from '../../components/Base/Countdown';
2929
import { HackathonFAQ } from '../../components/Activity/Hackathon/FAQ';
3030
import { HackathonHero } from '../../components/Activity/Hackathon/Hero';
3131
import { HackathonOverview } from '../../components/Activity/Hackathon/Overview';

0 commit comments

Comments
 (0)