Skip to content

Commit c654db8

Browse files
committed
wider page & copy button for public key
1 parent 0180c77 commit c654db8

File tree

2 files changed

+70
-38
lines changed

2 files changed

+70
-38
lines changed

src/Account.tsx

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const Account: FC<{
6565
helpful to register an admin address for your broker.
6666
</Text>
6767

68-
<Card style={{ maxWidth: 240 }}>
68+
<Card style={{ maxWidth: 480 }}>
6969
{wallet ? (
7070
<>
7171
<Flex gap="1" direction="column">
@@ -97,29 +97,45 @@ export const Account: FC<{
9797
<Text as="div" size="2" weight="bold">
9898
Orderly Public Key:
9999
</Text>
100-
<Text as="div" size="2">
101-
{publicKey ?? '-'}
102-
</Text>
100+
<Flex gap="2">
101+
<Text as="div" size="2">
102+
{publicKey ?? '-'}
103+
</Text>
104+
{publicKey && (
105+
<IconButton
106+
size="1"
107+
variant="soft"
108+
onClick={async () => {
109+
if (publicKey == null) return;
110+
navigator.clipboard.writeText(publicKey);
111+
}}
112+
>
113+
<CopyIcon height="12" />
114+
</IconButton>
115+
)}
116+
</Flex>
103117
</Container>
104118
<Container>
105119
<Text as="div" size="2" weight="bold">
106120
Orderly Private Key:
107121
</Text>
108-
<Text as="div" size="2">
109-
{privateKey ? `${privateKey.slice(0, 12)}...${privateKey.slice(-4)}` : '-'}
110-
</Text>
111-
{orderlyKey && (
112-
<IconButton
113-
size="1"
114-
variant="soft"
115-
onClick={async () => {
116-
if (privateKey == null) return;
117-
navigator.clipboard.writeText(privateKey);
118-
}}
119-
>
120-
<CopyIcon height="12" />
121-
</IconButton>
122-
)}
122+
<Flex gap="2">
123+
<Text as="div" size="2">
124+
{privateKey ? `${privateKey.slice(0, 12)}...${privateKey.slice(-4)}` : '-'}
125+
</Text>
126+
{orderlyKey && (
127+
<IconButton
128+
size="1"
129+
variant="soft"
130+
onClick={async () => {
131+
if (privateKey == null) return;
132+
navigator.clipboard.writeText(privateKey);
133+
}}
134+
>
135+
<CopyIcon height="12" />
136+
</IconButton>
137+
)}
138+
</Flex>
123139
</Container>
124140
</Flex>
125141
</>

src/DelegateSigner.tsx

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const DelegateSigner: FC<{
7979
respective smart contract account.
8080
</Text>
8181

82-
<Card style={{ maxWidth: 240 }}>
82+
<Card style={{ maxWidth: 480 }}>
8383
{wallet ? (
8484
<>
8585
<Flex gap="1" direction="column">
@@ -127,29 +127,45 @@ export const DelegateSigner: FC<{
127127
<Text as="div" size="2" weight="bold">
128128
Orderly Public Key:
129129
</Text>
130-
<Text as="div" size="2">
131-
{publicKey ?? '-'}
132-
</Text>
130+
<Flex gap="2">
131+
<Text as="div" size="2">
132+
{publicKey ?? '-'}
133+
</Text>
134+
{publicKey && (
135+
<IconButton
136+
size="1"
137+
variant="soft"
138+
onClick={async () => {
139+
if (publicKey == null) return;
140+
navigator.clipboard.writeText(publicKey);
141+
}}
142+
>
143+
<CopyIcon height="12" />
144+
</IconButton>
145+
)}
146+
</Flex>
133147
</Container>
134148
<Container>
135149
<Text as="div" size="2" weight="bold">
136150
Orderly Private Key:
137151
</Text>
138-
<Text as="div" size="2">
139-
{privateKey ? `${privateKey.slice(0, 12)}...${privateKey.slice(-4)}` : '-'}
140-
</Text>
141-
{orderlyKey && (
142-
<IconButton
143-
size="1"
144-
variant="soft"
145-
onClick={async () => {
146-
if (privateKey == null) return;
147-
navigator.clipboard.writeText(privateKey);
148-
}}
149-
>
150-
<CopyIcon height="12" />
151-
</IconButton>
152-
)}
152+
<Flex gap="2">
153+
<Text as="div" size="2">
154+
{privateKey ? `${privateKey.slice(0, 12)}...${privateKey.slice(-4)}` : '-'}
155+
</Text>
156+
{orderlyKey && (
157+
<IconButton
158+
size="1"
159+
variant="soft"
160+
onClick={async () => {
161+
if (privateKey == null) return;
162+
navigator.clipboard.writeText(privateKey);
163+
}}
164+
>
165+
<CopyIcon height="12" />
166+
</IconButton>
167+
)}
168+
</Flex>
153169
</Container>
154170
</Flex>
155171
</>

0 commit comments

Comments
 (0)