Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added script copy button #342

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: added script copy button #342

wants to merge 2 commits into from

Conversation

itsarghyadas
Copy link
Collaborator

image
Script copy Button added with theme support.

Copy link

vercel bot commented Sep 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
magicui ❌ Failed (Inspect) Oct 1, 2024 3:57pm

Copy link
Collaborator

@dillionverma dillionverma left a comment

Choose a reason for hiding this comment

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

Some minor fixes

Also, you should run pnpm format:write and pnpm lint:fix locally to clean the code before pushing up

{
name: "script-copy-btn",
type: "registry:ui",
files: ["magicui/script-copy-btn.tsx"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should list the dependencies here that are being imported by the component

distance: distance,
});
}
return child;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this dock fix should be in a separate PR ideally just so we know this is not related to the new component

import { Check, Copy } from "lucide-react";
import { codeToHtml } from "shiki";
import { motion } from "framer-motion";
import { useTheme } from "next-themes";
Copy link
Collaborator

Choose a reason for hiding this comment

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

what should be done for non next.js users?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will work for non-next.js users too.

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.

2 participants