1
+ import copy from "clipboard-copy" ;
1
2
import { format } from "date-fns" ;
2
3
import { ethers } from "ethers" ;
3
4
import styled from "styled-components" ;
4
5
import toFlexible from "toflexible" ;
5
6
7
+ import CopyIconImg from "@mybucks/assets/icons/copy.svg" ;
6
8
import { Box as BaseBox } from "@mybucks/components/Containers" ;
7
9
import Link from "@mybucks/components/Link" ;
8
10
import { H3 } from "@mybucks/components/Texts" ;
@@ -15,10 +17,18 @@ const Box = styled(BaseBox)`
15
17
16
18
const TableWrapper = styled . table `
17
19
width: 100%;
18
-
20
+ font-size: ${ ( { theme } ) => theme . sizes . base } ;
19
21
td {
20
- padding-bottom: 4px ;
22
+ padding-bottom: ${ ( { theme } ) => theme . sizes . x3s } ;
21
23
}
24
+
25
+ ${ media . sm `
26
+ font-size: ${ ( { theme } ) => theme . sizes . sm } ;
27
+
28
+ a {
29
+ font-size: ${ ( { theme } ) => theme . sizes . sm } ;
30
+ }
31
+ ` }
22
32
` ;
23
33
24
34
const AmountTd = styled . td `
@@ -27,9 +37,8 @@ const AmountTd = styled.td`
27
37
` ;
28
38
29
39
const AddressTd = styled . td `
30
- ${ media . sm `
31
- display: none;
32
- ` }
40
+ display: flex;
41
+ align-items: center;
33
42
` ;
34
43
35
44
const AddressLinkLg = styled ( Link ) `
@@ -47,6 +56,15 @@ const AddressLink = styled(Link)`
47
56
` }
48
57
` ;
49
58
59
+ const CopyButton = styled . img . attrs ( {
60
+ alt : "Copy" ,
61
+ src : CopyIconImg ,
62
+ } ) `
63
+ cursor: pointer;
64
+ margin-left: ${ ( { theme } ) => theme . sizes . xs } ;
65
+ width: ${ ( { theme } ) => theme . sizes . sm } ;
66
+ ` ;
67
+
50
68
const ActivityTable = ( { account, history } ) => (
51
69
< Box >
52
70
< H3 > Activity</ H3 >
@@ -73,9 +91,22 @@ const ActivityTable = ({ account, history }) => (
73
91
target = "_blank"
74
92
>
75
93
{ truncate (
76
- item . transferType === "IN" ? item . fromAddress : item . toAddress
94
+ item . transferType === "IN"
95
+ ? item . fromAddress
96
+ : item . toAddress ,
97
+ 8
77
98
) }
78
99
</ AddressLink >
100
+
101
+ < CopyButton
102
+ onClick = { ( ) =>
103
+ copy (
104
+ item . transferType === "IN"
105
+ ? item . fromAddress
106
+ : item . toAddress
107
+ )
108
+ }
109
+ />
79
110
</ AddressTd >
80
111
< AmountTd $in = { item . transferType === "IN" } >
81
112
{ item . transferType === "IN" ? "+" : "-" }
0 commit comments