Skip to content

Commit 577c00f

Browse files
committed
feat: seperate the navigation and copy actions in CopyAddress
1 parent 2960b65 commit 577c00f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.address {
4+
display: flex;
5+
flex-flow: row nowrap;
6+
gap: theme.spacing(2);
7+
}

apps/developer-hub/src/components/CopyAddress/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
"use client";
22

33
import { CopyButton } from "@pythnetwork/component-library/CopyButton";
4+
import { Link } from "@pythnetwork/component-library/Link";
45

56
import TruncateToMiddle from "../TruncateToMiddle";
7+
import styles from "./index.module.scss";
68

79
const CopyAddress = ({ address, url }: { address: string; url?: string }) => {
810
return url ? (
9-
<form>
10-
<CopyButton text={address} formAction={url} type="submit">
11+
<div className={styles.address}>
12+
<Link href={url} target="_blank" rel="noreferrer">
1113
<TruncateToMiddle text={address} />
12-
</CopyButton>
13-
</form>
14+
</Link>
15+
<CopyButton text={address} iconOnly />
16+
</div>
1417
) : (
1518
<CopyButton text={address}>
1619
<TruncateToMiddle text={address} />

0 commit comments

Comments
 (0)