Skip to content

Feat: Add the base component to the registry - #11

Merged
tobias-hay merged 1 commit into
mainfrom
feat/base-on-reg
Jul 15, 2025
Merged

Feat: Add the base component to the registry#11
tobias-hay merged 1 commit into
mainfrom
feat/base-on-reg

Conversation

@tobias-hay

Copy link
Copy Markdown
Member

No description provided.

@tobias-hay
tobias-hay requested a review from mezotv July 15, 2025 17:48
@mezotv
mezotv requested review from Copilot and removed request for mezotv July 15, 2025 17:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new “Discord Base” registry component by removing example items and registering the shared base components, utilities, and styles needed for Discord‐style UI elements.

  • Replace earlier example components (hello-world, example-form, complex-component) with a single discord-base entry in registry.json and its metadata in public/r/discord-base.json.
  • Add the Discord base component files (discord-base.tsx, discord-icons.tsx, lib/date-fns.ts) under registry/discord-base.
  • Update project scripts and styling: rename the build script, bump shadcn version, and consolidate the global CSS base layer.

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
registry/discord-base/discord-base.tsx Add Discord base components and update avatar/date imports
registry.json Remove old entries and register new discord-base component
public/r/discord-base.json Add registry metadata for discord-base
package.json Rename npm script and bump shadcn dependency
app/globals.css Move and dedupe the @layer base declarations
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

package.json:12

  • [nitpick] The npm script name "reg:build" is not immediately clear; consider renaming it to something more descriptive like "registry:build" to align with its purpose and existing conventions.
    "reg:build": "shadcn build"

public/r/discord-base.json:22

  • The new formatDate utility has branching logic for today, yesterday, and older dates—consider adding unit tests that cover each branch to ensure the formatting behaves as expected.
      "content": "export function formatDate(date: Date, use24Hour = false): string {\n\tconst now = new Date();\n\tconst diff = now.getTime() - date.getTime();\n\tconst diffDays = Math.floor(diff / (1000 * 60 * 60 * 24));\n\n\tlet hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst ampm = hours >= 12 ? \" PM\" : \" AM\";\n\n\tif (!use24Hour) {\n\t\thours %= 12;\n\t\thours = hours ? hours : 12; // the hour '0' should be '12'\n\t}\n\n\tconst formattedTime = `${String(hours).padStart(2, \"0\")}:${String(\n\t\tminutes\n\t).padStart(2, \"0\")}${use24Hour ? \"\" : ampm}`;\n\n\tif (diffDays === 0) {\n\t\treturn formattedTime;\n\t}\n\tif (diffDays === 1) {\n\t\treturn `Yesterday ${formattedTime}`;\n\t}\n\n\tconst month = date.getMonth() + 1;\n\tconst day = date.getDate();\n\tconst year = date.getFullYear();\n\treturn `${String(month).padStart(2, \"0\")}/${String(day).padStart(\n\t\t2,\n\t\t\"0\"\n\t)}/${year} ${formattedTime}`;\n}\n",

@tobias-hay
tobias-hay enabled auto-merge (squash) July 15, 2025 17:53
@tobias-hay
tobias-hay merged commit 4459daf into main Jul 15, 2025
2 checks passed
@mezotv
mezotv deleted the feat/base-on-reg branch July 15, 2025 18:01
@tobias-hay tobias-hay mentioned this pull request Jul 19, 2025
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.

3 participants