Feat: Add the base component to the registry - #11
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-baseentry inregistry.jsonand its metadata inpublic/r/discord-base.json. - Add the Discord base component files (
discord-base.tsx,discord-icons.tsx,lib/date-fns.ts) underregistry/discord-base. - Update project scripts and styling: rename the build script, bump
shadcnversion, 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
formatDateutility 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
enabled auto-merge (squash)
July 15, 2025 17:53
mezotv
approved these changes
Jul 15, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.