Skip to content

Commit 0623a86

Browse files
committed
⚙️ Normalize itemName to lowercase in copy commands and registry
1 parent b59c2e3 commit 0623a86

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

website/app/components/card/copyIcon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const CopyIconActions = ({ itemName, isFolder, ItemIcon }: CopyIconProps) => {
3535

3636
// Copy shadcn/ui command:
3737
const handleCopyShadcnCommand = async () => {
38-
const itemNameLower = itemName.charAt(0).toLowerCase() + itemName.slice(1);
38+
const itemNameLower = itemName.toLowerCase();
3939
const makeCommand = !isFolder
4040
? `${appConfig.shadcnCommand} ${appConfig.registryUrl}${itemNameLower}.json`
4141
: `${appConfig.shadcnCommand} ${appConfig.registryUrl}folders/${itemNameLower}.json`;
@@ -51,7 +51,7 @@ const CopyIconActions = ({ itemName, isFolder, ItemIcon }: CopyIconProps) => {
5151
// Copy source code:
5252
const handleCopySource = async () => {
5353
setLoading(true);
54-
const itemNameLower = itemName.charAt(0).toLowerCase() + itemName.slice(1);
54+
const itemNameLower = itemName.toLowerCase();
5555
const jsonUrl = !isFolder
5656
? `${appConfig.registryUrl}${itemNameLower}.json`
5757
: `${appConfig.registryUrl}folders/${itemNameLower}.json`;

website/app/components/card/openWithv0.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const OpenWithV0 = ({ itemName, isFolder }: OpenWithV0Props) => {
1515
title="Open with V0"
1616
href={
1717
!isFolder
18-
? `${appConfig.v0URL}${appConfig.registryUrl}${itemName}.json`
19-
: `${appConfig.v0URL}${appConfig.registryUrl}folders/${itemName}.json`
18+
? `${appConfig.v0URL}${appConfig.registryUrl}${itemName.toLowerCase()}.json`
19+
: `${appConfig.v0URL}${appConfig.registryUrl}folders/${itemName.toLowerCase()}.json`
2020
}
2121
className={buttonVariants({
2222
variant: "ghost",

website/generate-registry.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const processFiles = (source, target, recursive = true) => {
6969

7070
const outputFilePath = path.join(
7171
target,
72-
`${nameWithoutExtension}.json`,
72+
`${nameWithoutExtension.toLowerCase()}.json`,
7373
);
7474
fs.writeFileSync(outputFilePath, JSON.stringify(json, null, 2), "utf8");
7575
totalUpdated++;

0 commit comments

Comments
 (0)