Skip to content

Commit 2e51cd1

Browse files
authored
Merge pull request #1037 from wandooadzer-cmyk/wave-5-implementation
git push --forceMerge pull request #1036 from Akpamgbo/codex/issues-1…
2 parents b06c289 + 5c95566 commit 2e51cd1

3 files changed

Lines changed: 32 additions & 50 deletions

File tree

‎frontend/src/app/[locale]/settings/page.tsx‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ import {
88
Shield,
99
Monitor,
1010
Crown,
11-
Copy,
12-
CheckCheck,
1311
LogOut,
1412
Key,
1513
} from "lucide-react";
1614
import { Card, CardHeader, CardTitle, CardContent } from "../../components/ui/Card";
1715
import { Button } from "../../components/ui/Button";
1816
import { Input } from "../../components/ui/Input";
17+
import { CopyButton } from "../../components/ui/CopyButton";
1918
import { GamificationSettings } from "../../components/gamification/GamificationSettings";
2019
import { useThemeStore } from "../../stores/useThemeStore";
2120
import {
@@ -53,30 +52,6 @@ const SECTIONS = [
5352

5453
type SectionId = (typeof SECTIONS)[number]["id"];
5554

56-
// ─── Copy-to-clipboard helper ─────────────────────────────────────────────────
57-
58-
function CopyButton({ value }: { value: string }) {
59-
const [copied, setCopied] = useState(false);
60-
61-
const handleCopy = () => {
62-
navigator.clipboard.writeText(value).then(() => {
63-
setCopied(true);
64-
setTimeout(() => setCopied(false), 2000);
65-
});
66-
};
67-
68-
return (
69-
<button
70-
onClick={handleCopy}
71-
className="p-1.5 rounded-md text-zinc-400 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 transition-colors"
72-
title="Copy to clipboard"
73-
aria-label={copied ? "Copied to clipboard" : "Copy to clipboard"}
74-
>
75-
{copied ? <CheckCheck className="h-4 w-4 text-green-500" /> : <Copy className="h-4 w-4" />}
76-
</button>
77-
);
78-
}
79-
8055
// ─── Toggle switch ─────────────────────────────────────────────────────────────
8156

8257
function Toggle({

‎frontend/src/app/[locale]/wallet/page.tsx‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { useMemo, useState } from "react";
44
import { keepPreviousData, useQuery } from "@tanstack/react-query";
55
import {
66
Wallet,
7-
Copy,
8-
CheckCheck,
97
ArrowDownLeft,
108
ArrowUpRight,
119
RefreshCw,
@@ -15,6 +13,7 @@ import {
1513
} from "lucide-react";
1614
import { Card, CardHeader, CardTitle, CardContent } from "../../components/ui/Card";
1715
import { Button } from "../../components/ui/Button";
16+
import { CopyButton } from "../../components/ui/CopyButton";
1817
import { PaginationControls } from "../../components/ui/PaginationControls";
1918
import { Spinner } from "../../components/global_ui/Spinner";
2019
import { TransactionsSkeleton } from "../../components/skeletons/TransactionsSkeleton";
@@ -132,28 +131,6 @@ function useHorizonPayments(address: string, horizonUrl: string, cursor: string
132131
});
133132
}
134133

135-
// ─── Copy button ───────────────────────────────────────────────────────────────
136-
137-
function CopyButton({ value }: { value: string }) {
138-
const [copied, setCopied] = useState(false);
139-
const handleCopy = () => {
140-
navigator.clipboard.writeText(value).then(() => {
141-
setCopied(true);
142-
setTimeout(() => setCopied(false), 2000);
143-
});
144-
};
145-
return (
146-
<button
147-
onClick={handleCopy}
148-
className="p-1.5 rounded-md text-zinc-400 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 transition-colors"
149-
title="Copy to clipboard"
150-
aria-label={copied ? "Copied to clipboard" : "Copy to clipboard"}
151-
>
152-
{copied ? <CheckCheck className="h-4 w-4 text-green-500" /> : <Copy className="h-4 w-4" />}
153-
</button>
154-
);
155-
}
156-
157134
// ─── QR Code display ──────────────────────────────────────────────────────────
158135

159136
function QRDisplay({ address }: { address: string }) {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use client";
2+
3+
import { useState } from "react";
4+
import { Copy, CheckCheck } from "lucide-react";
5+
6+
interface CopyButtonProps {
7+
value: string;
8+
}
9+
10+
export function CopyButton({ value }: CopyButtonProps) {
11+
const [copied, setCopied] = useState(false);
12+
13+
const handleCopy = () => {
14+
navigator.clipboard.writeText(value).then(() => {
15+
setCopied(true);
16+
setTimeout(() => setCopied(false), 2000);
17+
});
18+
};
19+
20+
return (
21+
<button
22+
onClick={handleCopy}
23+
className="p-1.5 rounded-md text-zinc-400 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 transition-colors"
24+
title="Copy to clipboard"
25+
aria-label={copied ? "Copied to clipboard" : "Copy to clipboard"}
26+
>
27+
{copied ? <CheckCheck className="h-4 w-4 text-green-500" /> : <Copy className="h-4 w-4" />}
28+
</button>
29+
);
30+
}

0 commit comments

Comments
 (0)