@@ -3,15 +3,16 @@ import styled, { css } from "styled-components";
33
44import Identicon from "react-identicons" ;
55import ReactMarkdown from "react-markdown" ;
6+ import { Link } from "react-router-dom" ;
67
78import { Card } from "@kleros/ui-components-library" ;
89
910import AttachmentIcon from "svgs/icons/attachment.svg" ;
1011
1112import { useIPFSQuery } from "hooks/useIPFSQuery" ;
13+ import { formatDate } from "utils/date" ;
1214import { getIpfsUrl } from "utils/getIpfsUrl" ;
1315import { shortenAddress } from "utils/shortenAddress" ;
14- import { formatDate } from "utils/date" ;
1516
1617import { landscapeStyle } from "styles/landscapeStyle" ;
1718import { responsiveSize } from "styles/responsiveSize" ;
@@ -113,6 +114,21 @@ const MobileText = styled.span`
113114 ) }
114115` ;
115116
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+ ) }
130+ ` ;
131+
116132const AttachedFileText : React . FC = ( ) => (
117133 < >
118134 < DesktopText > View attached file</ DesktopText >
@@ -129,6 +145,7 @@ interface IEvidenceCard {
129145
130146const EvidenceCard : React . FC < IEvidenceCard > = ( { evidence, sender, index, timestamp } ) => {
131147 const { data } = useIPFSQuery ( evidence ) ;
148+
132149 return (
133150 < StyledCard >
134151 < TextContainer >
@@ -147,12 +164,12 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ evidence, sender, index, timest
147164 < Identicon size = "24" string = { sender } />
148165 < p > { shortenAddress ( sender ) } </ p >
149166 </ AccountContainer >
150- < Timestamp > { formatDate ( Number ( timestamp ) ) } </ Timestamp >
167+ < Timestamp > { formatDate ( Number ( timestamp ) , true ) } </ Timestamp >
151168 { data && typeof data . fileURI !== "undefined" && (
152- < StyledA href = { getIpfsUrl ( data . fileURI ) } target = "_blank" rel = "noreferrer" >
169+ < StyledLink to = { `attachment/?url= ${ getIpfsUrl ( data . fileURI ) } ` } >
153170 < AttachmentIcon />
154171 < AttachedFileText />
155- </ StyledA >
172+ </ StyledLink >
156173 ) }
157174 </ BottomShade >
158175 </ StyledCard >
0 commit comments