Skip to content

Commit 867f0ca

Browse files
CopilotTechQuery
andauthored
refactor: remove label prop from Countdown, move label rendering to Hero
Agent-Logs-Url: https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/sessions/d946deb1-3c20-4f85-afa5-f4569b09dd6a Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
1 parent ac10cfb commit 867f0ca

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

components/Activity/Hackathon/Countdown.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import styles from './Hero.module.less';
66

77
export interface CountdownProps {
88
countdownTo?: string;
9-
label?: string;
109
unitLabels: string[];
1110
}
1211

@@ -71,25 +70,21 @@ export class Countdown extends Component<CountdownProps> {
7170
}
7271

7372
render() {
74-
const { label, unitLabels } = this.props;
73+
const { unitLabels } = this.props;
7574
const { sections } = this;
7675

7776
return (
78-
<div className={styles.countdownWrap}>
79-
{label && <p className={`${styles.countdownLabel} m-0`}>{label}</p>}
80-
81-
<ol className={`list-unstyled ${styles.countdownGrid} m-0`}>
82-
{sections.map((value, index) => (
83-
<li
84-
key={`${index}-${unitLabels[index]}`}
85-
className={`${styles.countdownCell} d-flex flex-column justify-content-center align-items-center`}
86-
>
87-
<strong>{value}</strong>
88-
<span>{unitLabels[index]}</span>
89-
</li>
90-
))}
91-
</ol>
92-
</div>
77+
<ol className={`list-unstyled ${styles.countdownGrid} m-0`}>
78+
{sections.map((value, index) => (
79+
<li
80+
key={`${index}-${unitLabels[index]}`}
81+
className={`${styles.countdownCell} d-flex flex-column justify-content-center align-items-center`}
82+
>
83+
<strong>{value}</strong>
84+
<span>{unitLabels[index]}</span>
85+
</li>
86+
))}
87+
</ol>
9388
);
9489
}
9590
}

components/Activity/Hackathon/Hero.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ export const HackathonHero: FC<HackathonHeroProps> = ({
161161
<p className={styles.description}>{description}</p>
162162

163163
{countdownTo && (
164-
<Countdown
165-
countdownTo={countdownTo}
166-
label={countdownLabel}
167-
unitLabels={countdownUnitLabels}
168-
/>
164+
<div className={styles.countdownWrap}>
165+
{countdownLabel && (
166+
<p className={`${styles.countdownLabel} m-0`}>{countdownLabel}</p>
167+
)}
168+
<Countdown countdownTo={countdownTo} unitLabels={countdownUnitLabels} />
169+
</div>
169170
)}
170171

171172
<nav className="d-flex flex-wrap gap-2 gap-md-3" aria-label={subtitle}>

0 commit comments

Comments
 (0)