mirror of
https://github.com/AnmolSaini16/mapcn
synced 2026-04-25 16:14:54 +02:00
feat: add @mapcn registry alias so install works with add @mapcn
This commit is contained in:
@@ -5,8 +5,7 @@ import { Copy, Check, ArrowRight } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
|
||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "site-url-here";
|
||||
const installCommand = `npx shadcn@latest add ${siteUrl}/r/map.json`;
|
||||
const installCommand = "npx shadcn@latest add @mapcn/map";
|
||||
|
||||
function CopyButton({ text }: { text: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
@@ -58,7 +57,7 @@ export function Hero() {
|
||||
Built on MapLibre. Styled with Tailwind.
|
||||
</p>
|
||||
|
||||
<div className="mt-8 animate-fade-up delay-300 w-full max-w-xl">
|
||||
<div className="mt-8 animate-fade-up delay-300 w-full max-w-lg">
|
||||
<div className="bg-card border border-border rounded-lg shadow-xs overflow-hidden">
|
||||
<div className="flex items-center gap-1.5 px-3 py-2 border-b border-border/50">
|
||||
<span className="size-2 rounded-full bg-foreground/20" />
|
||||
|
||||
@@ -10,9 +10,7 @@ import { Metadata } from "next";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Map, MapControls } from "@/registry/map";
|
||||
|
||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "site-url-here";
|
||||
|
||||
const installCode = `npx shadcn@latest add ${siteUrl}/r/map.json`;
|
||||
const installCommand = "npx shadcn@latest add @mapcn/map";
|
||||
|
||||
const usageCode = `import { Map, MapControls } from "@/components/ui/map";
|
||||
import { Card } from "@/components/ui/card";
|
||||
@@ -60,7 +58,7 @@ export default function InstallationPage() {
|
||||
|
||||
<DocsSection title="Installation">
|
||||
<p>Run the following command to add the map component:</p>
|
||||
<CodeBlock code={installCode} language="bash" />
|
||||
<CodeBlock code={installCommand} language="bash" />
|
||||
<p>
|
||||
This will install <DocsCode>maplibre-gl</DocsCode> and add the map
|
||||
component to your project.
|
||||
|
||||
Reference in New Issue
Block a user