-
Notifications
You must be signed in to change notification settings - Fork 9
[refactor] use Time & Time Range components to render all Date Time texts #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| import { TableCellValue } from 'mobx-lark'; | ||
| import { FC } from 'react'; | ||
| import dynamic from 'next/dynamic'; | ||
| import { FC, ReactNode } from 'react'; | ||
| import { Container } from 'react-bootstrap'; | ||
| import { TimeUnit } from 'idea-react'; | ||
|
|
||
| import { Agenda } from '../../../models/Hackathon'; | ||
| import { LarkImage } from '../../LarkImage'; | ||
| import { AgendaCountdown } from './AgendaCountdown'; | ||
| import { TimeUnit } from '../../Base/Countdown'; | ||
| import styles from './Hero.module.less'; | ||
|
|
||
| const AgendaCountdown = dynamic(() => import('./AgendaCountdown'), { ssr: false }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 给倒计时补一个首屏占位,避免 hydration 后推挤 hero 内容。 这里把 建议修复 const AgendaCountdown = dynamic(() => import('./AgendaCountdown'), {
ssr: false,
+ loading: () => <div style={{ minHeight: 120 }} />,
});🤖 Prompt for AI Agents |
||
|
|
||
|
Comment on lines
+11
to
+12
|
||
| export type HackathonHeroNavItem = Record<'label' | 'href', string>; | ||
|
|
||
| export interface HackathonHeroAction extends HackathonHeroNavItem { | ||
|
|
@@ -26,9 +28,9 @@ export interface HackathonHeroProps extends Record< | |
| string | ||
| > { | ||
| agendaItems: Agenda[]; | ||
| badges: string[]; | ||
| badges: ReactNode[]; | ||
| bottomCard?: HackathonHeroCard; | ||
| chips?: string[]; | ||
| chips?: ReactNode[]; | ||
| countdownUnits: TimeUnit[]; | ||
| endTime?: TableCellValue; | ||
| image?: TableCellValue; | ||
|
|
@@ -148,7 +150,7 @@ export const HackathonHero: FC<HackathonHeroProps> = ({ | |
| <ul className={`list-unstyled ${styles.heroEyebrow} d-flex flex-wrap gap-3 m-0`}> | ||
| {badges.map((badge, index) => ( | ||
| <li | ||
| key={`${badge}-${index}`} | ||
| key={index} | ||
| className={`${styles.heroBadge} d-inline-flex align-items-center ${BadgeToneClass[index % BadgeToneClass.length]}`} | ||
| > | ||
| {badge} | ||
|
|
@@ -180,8 +182,8 @@ export const HackathonHero: FC<HackathonHeroProps> = ({ | |
| <ul | ||
| className={`list-unstyled ${styles.heroStats} d-flex flex-wrap gap-2 gap-md-3 m-0`} | ||
| > | ||
| {chips.map(chip => ( | ||
| <li key={chip} className={`${styles.statChip} d-inline-flex align-items-center`}> | ||
| {chips.map((chip, index) => ( | ||
| <li key={index} className={`${styles.statChip} d-inline-flex align-items-center`}> | ||
| {chip} | ||
| </li> | ||
| ))} | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The countdown item styling was switched from
lito.item, but the mobile override in the@media (max-width: 767px)block still targetsli. To avoid relying on the underlying DOM tag (especially after switching toitemClassName), update the media-query selector to target.itemas well so the responsive styles keep applying.