@@ -3,15 +3,16 @@ import styled, { css } from "styled-components";
3
3
4
4
import Identicon from "react-identicons" ;
5
5
import ReactMarkdown from "react-markdown" ;
6
+ import { Link } from "react-router-dom" ;
6
7
7
8
import { Card } from "@kleros/ui-components-library" ;
8
9
9
10
import AttachmentIcon from "svgs/icons/attachment.svg" ;
10
11
11
12
import { useIPFSQuery } from "hooks/useIPFSQuery" ;
13
+ import { formatDate } from "utils/date" ;
12
14
import { getIpfsUrl } from "utils/getIpfsUrl" ;
13
15
import { shortenAddress } from "utils/shortenAddress" ;
14
- import { formatDate } from "utils/date" ;
15
16
16
17
import { landscapeStyle } from "styles/landscapeStyle" ;
17
18
import { responsiveSize } from "styles/responsiveSize" ;
@@ -65,13 +66,13 @@ const StyledA = styled.a`
65
66
margin-left : auto;
66
67
gap : ${ responsiveSize ( 5 , 6 ) } ;
67
68
${ landscapeStyle (
68
- ( ) => css `
69
+ ( ) => css `
69
70
> svg {
70
71
width : 16px ;
71
72
fill : ${ ( { theme } ) => theme . primaryBlue } ;
72
73
}
73
74
`
74
- ) }
75
+ ) }
75
76
` ;
76
77
77
78
const AccountContainer = styled . div `
@@ -95,22 +96,37 @@ const AccountContainer = styled.div`
95
96
const DesktopText = styled . span `
96
97
display : none;
97
98
${ landscapeStyle (
98
- ( ) => css `
99
+ ( ) => css `
99
100
display : inline;
100
101
`
101
- ) }
102
+ ) }
102
103
` ;
103
104
104
105
const Timestamp = styled . p `
105
- color: ${ ( { theme } ) => theme . secondaryText } ;
106
+ color : ${ ( { theme } ) => theme . secondaryText } ;
106
107
` ;
107
108
108
109
const MobileText = styled . span `
109
110
${ landscapeStyle (
110
- ( ) => css `
111
+ ( ) => css `
111
112
display : none;
112
113
`
113
- ) }
114
+ ) }
115
+ ` ;
116
+
117
+ const StyledLink = styled ( Link ) `
118
+ height: fit-content;
119
+ display: flex;
120
+ margin-left: auto;
121
+ gap: ${ responsiveSize ( 5 , 6 ) } ;
122
+ ${ landscapeStyle (
123
+ ( ) => css `
124
+ > svg {
125
+ width : 16px ;
126
+ fill : ${ ( { theme } ) => theme . primaryBlue } ;
127
+ }
128
+ `
129
+ ) }
114
130
` ;
115
131
116
132
const AttachedFileText : React . FC = ( ) => (
@@ -129,6 +145,7 @@ interface IEvidenceCard {
129
145
130
146
const EvidenceCard : React . FC < IEvidenceCard > = ( { evidence, sender, index, timestamp } ) => {
131
147
const { data } = useIPFSQuery ( evidence ) ;
148
+
132
149
return (
133
150
< StyledCard >
134
151
< TextContainer >
@@ -149,10 +166,10 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ evidence, sender, index, timest
149
166
</ AccountContainer >
150
167
< Timestamp > { formatDate ( Number ( timestamp ) ) } </ Timestamp >
151
168
{ data && typeof data . fileURI !== "undefined" && (
152
- < StyledA href = { getIpfsUrl ( data . fileURI ) } target = "_blank" rel = "noreferrer" >
169
+ < StyledLink to = { `attachment/?url= ${ getIpfsUrl ( data . fileURI ) } ` } >
153
170
< AttachmentIcon />
154
171
< AttachedFileText />
155
- </ StyledA >
172
+ </ StyledLink >
156
173
) }
157
174
</ BottomShade >
158
175
</ StyledCard >
0 commit comments