Skip to content

Commit 20294e3

Browse files
committed
update: use clipboard for copy icon
1 parent 528e273 commit 20294e3

File tree

6 files changed

+21
-24
lines changed

6 files changed

+21
-24
lines changed

app/[locale]/staking/deposit-contract/_components/deposit-contract.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
2-
32
import { useEffect, useState } from "react"
43
import makeBlockie from "ethereum-blockies-base64"
4+
import { Clipboard, ClipboardCheck } from "lucide-react"
55

66
import type { ChildOnlyProp, TranslationKey } from "@/lib/types"
77

@@ -375,16 +375,13 @@ const DepositContractPage = () => {
375375
<CopyButton>
376376
{!isCopied ? (
377377
<>
378-
<Emoji text=":clipboard:" className="text-md" />
379378
{t("page-staking-deposit-contract-copy")}
379+
<Clipboard className="ms-1" />
380380
</>
381381
) : (
382382
<>
383-
<Emoji
384-
text=":white_check_mark:"
385-
className="text-md"
386-
/>
387383
{t("page-staking-deposit-contract-copied")}
384+
<ClipboardCheck className="ms-1" />
388385
</>
389386
)}
390387
</CopyButton>

src/components/CodeModal.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Children, type ReactElement } from "react"
2-
import { Check, Copy } from "lucide-react"
2+
import { Clipboard, ClipboardCheck } from "lucide-react"
33

44
import { Button } from "./ui/buttons/Button"
55
import {
@@ -43,11 +43,13 @@ const CodeModal = ({ children, isOpen, setIsOpen, title }: CodeModalProps) => {
4343
>
4444
{hasCopied ? (
4545
<>
46-
<Check /> {t("copied")}
46+
{t("copied")}
47+
<ClipboardCheck className="ms-1" />
4748
</>
4849
) : (
4950
<>
50-
<Copy /> {t("copy")}
51+
{t("copy")}
52+
<Clipboard className="ms-1" />
5153
</>
5254
)}
5355
</Button>

src/components/Codeblock.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
2-
32
import React, { useState } from "react"
3+
import { Clipboard, ClipboardCheck } from "lucide-react"
44
import Highlight, {
55
defaultProps,
66
Language,
@@ -10,7 +10,6 @@ import Prism from "prism-react-renderer/prism"
1010

1111
// https://github.com/FormidableLabs/prism-react-renderer/tree/master#custom-language-support
1212
import CopyToClipboard from "@/components/CopyToClipboard"
13-
import Emoji from "@/components/Emoji"
1413
import { Flex } from "@/components/ui/flex"
1514

1615
import { cn } from "@/lib/utils/cn"
@@ -304,16 +303,13 @@ const Codeblock = ({
304303
<TopBarItem>
305304
{!isCopied ? (
306305
<>
307-
<Emoji text=":clipboard:" className="text-md" />{" "}
308306
{t("copy")}
307+
<Clipboard className="mb-1 ms-1 inline-block size-[1em]" />
309308
</>
310309
) : (
311310
<>
312-
<Emoji
313-
text=":white_check_mark:"
314-
className="text-md"
315-
/>{" "}
316311
{t("copied")}
312+
<ClipboardCheck className="mb-1 ms-1 inline-block size-[1em]" />
317313
</>
318314
)}
319315
</TopBarItem>

src/components/CopyToClipboard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
22

3-
import { CheckCircle, Copy } from "lucide-react"
3+
import { Clipboard, ClipboardCheck } from "lucide-react"
44

55
import { cn } from "@/lib/utils/cn"
66

@@ -42,9 +42,9 @@ export const CopyButton = ({ message, ...props }: CopyButtonProps) => {
4242
return (
4343
<Button variant="ghost" onClick={() => onCopy(message)} {...props}>
4444
{hasCopied ? (
45-
<CheckCircle className="size-5" />
45+
<ClipboardCheck className="size-5" />
4646
) : (
47-
<Copy className="size-5" />
47+
<Clipboard className="size-5" />
4848
)}
4949
</Button>
5050
)

src/components/Homepage/CodeExamples.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
22

33
import { Suspense, useState } from "react"
4-
import { Check, Copy } from "lucide-react"
4+
import { Clipboard, ClipboardCheck } from "lucide-react"
55
import { useLocale } from "next-intl"
66

77
import type { CodeExample } from "@/lib/interfaces"
@@ -93,9 +93,11 @@ const CodeExamples = ({ title, codeExamples }: CodeExamplesProps) => {
9393
</Codeblock>
9494
<CopyToClipboard
9595
text={code}
96-
className="absolute end-4 top-4"
96+
className="absolute end-2 top-2 rounded p-2 hover:bg-primary/10 hover:text-primary"
9797
>
98-
{(hasCopied) => (hasCopied ? <Check /> : <Copy />)}
98+
{(hasCopied) =>
99+
hasCopied ? <ClipboardCheck /> : <Clipboard />
100+
}
99101
</CopyToClipboard>
100102
</div>
101103
</Suspense>

src/components/Simulator/WalletHome/AddressPill.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Copy } from "lucide-react"
1+
import { Clipboard } from "lucide-react"
22

33
import { Flex, type FlexProps } from "@/components/ui/flex"
44

@@ -17,7 +17,7 @@ export const AddressPill = ({ ...btnProps }: AddressPillProps) => (
1717
{...btnProps}
1818
>
1919
<p>{FAKE_DEMO_ADDRESS}</p>
20-
<Copy className="size-4 text-lg leading-none" />
20+
<Clipboard className="size-4 text-lg leading-none" />
2121
</Flex>
2222
</NotificationPopover>
2323
)

0 commit comments

Comments
 (0)