Skip to content

countdown component - #23

Open
MatthewMo520 wants to merge 2 commits into
mainfrom
feat/countdown-component
Open

MatthewMo520 wants to merge 2 commits into
mainfrom
feat/countdown-component

Conversation

@MatthewMo520

Copy link
Copy Markdown

Closes Issue

closes #22

Changes Made

  • added a countdown component to replace dossier card once countdown date finalized

Additional Notes/Screenshots/Videos (Optional)

  • TODO: add migration for the countdown date

@MatthewMo520
MatthewMo520 requested a review from a team as a code owner October 22, 2026 22:52
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cxc Ready Ready Preview Oct 28, 2026 3:06pm UTC

@MatthewMo520 MatthewMo520 self-assigned this Oct 22, 2026
@github-actions

Copy link
Copy Markdown

🚀 Preview deployment ready —

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🚦 Quality Gate Report

📊 Check Results

Check Status Details
🔍 Linting ✅ Passed ESLint code quality checks
🔒 Type Checking ✅ Passed TypeScript type safety
🏗️ Build ✅ Passed Production build verification

✅ All Checks Passed!

Your code meets all quality standards and is ready to merge! 🎉


📝 Run Details

Comment thread lib/countdown.ts
Comment on lines +2 to +14
* Countdown to the start of CxC.
*
* Pure date math, no React and no dependencies, so it can be unit tested and
* reused anywhere the timer shows up.
*/

/**
* When CxC begins.
*
* The offset is explicit on purpose: without it, the target would be parsed in
* the viewer's own timezone and the countdown would read differently in
* Waterloo than in Vancouver.
*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove these comments and keep just the todo comment

Suggested change
* Countdown to the start of CxC.
*
* Pure date math, no React and no dependencies, so it can be unit tested and
* reused anywhere the timer shows up.
*/
/**
* When CxC begins.
*
* The offset is explicit on purpose: without it, the target would be parsed in
* the viewer's own timezone and the countdown would read differently in
* Waterloo than in Vancouver.
*

Comment thread lib/countdown.ts
Comment on lines +33 to +38
/**
* Time left between `now` and `target`, clamped at zero.
*
* `now` is a parameter rather than an internal `new Date()` so callers control
* the clock — the component passes the real one, a test passes a fixed one.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this comment block can be simplified too

Comment on lines +71 to +75
}: {
/** ISO string with an explicit UTC offset. */
target?: string;
className?: string;
}) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

define this prop as a distinct interface

Comment on lines +9 to +23
/**
* The countdown, built to drop into the slot {@link DossierPanel} occupies.
*
* NOT RENDERED YET. It is staged here so that the moment the application
* release date is confirmed, swapping it in is a two-line change in
* `ComingSoon.tsx` — the import, and `<DossierPanel />` → `<CountdownPanel />`.
* It keeps the dossier card's `max-w-4xl` width so the swap moves nothing else
* on the page.
*
* The unit styling reproduces the Figma countdown frame: a SMOKE card holding
* the numeral, a white caret, then a bordered label strip, stacked with 10px
* gaps. Unlike the Figma frame it is fluid rather than pinned at 173px wide,
* because here it has to share a page that scales — the card keeps the design's
* 173:224 proportions instead.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

none of this is needed in the codebase

@patel-aaryan

patel-aaryan commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Overall, the component looks good, I think the countdown logic can be simplified down to a single hook in lib/hooks/, and an observer/subscriber pattern isn't really needed when only a single component in a single page is tracking the time remaining. Something like:

// lib/hooks/useCountdown.ts
export function useCountdown(...): ... {
  // get target time
  // ...
  // compute time remaining and return
}

in place of lib/countdown.ts and the subscribers set up in the react component

also in the home page, add a gate so that when process.env.NODE_ENV === development, the countdown component renders, otherwise the coming soon dossier component does (for prod), and we can remove the gate when we're ready to ship to prod

This branch was successfully deployed

1 active deployment
Preview — 8e844f82 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Landing: Countdown

2 participants