Skip to content

Commit

Permalink
fix: added toaster
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAmunga committed Dec 15, 2024
1 parent 0c39fd0 commit e560c68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
import { ModeToggle } from "./components/mode-toggle";
import { Card } from "./components/ui/card";
import { DefaultSeo } from "next-seo";
import { toast } from "sonner";

const PIN_STORAGE_KEY = "krapins";

Expand Down Expand Up @@ -111,8 +112,8 @@ function App() {
};

const handleCopyToClipboard = (pin: PIN) => {
const text = `Name: ${pin.name}\nPIN: ${pin.pin}`;
navigator.clipboard.writeText(text);
toast.success("Copied to Clipboard",{position:"top-center"});
navigator.clipboard.writeText(pin.pin);
};

const handleWhatsAppShare = (pin: PIN) => {
Expand Down
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "sonner";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<App />
<Toaster />
</ThemeProvider>
</StrictMode>
);

0 comments on commit e560c68

Please sign in to comment.