@@ -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" ;
@@ -65,13 +66,13 @@ const StyledA = styled.a`
6566 margin-left : auto;
6667 gap : ${ responsiveSize ( 5 , 6 ) } ;
6768 ${ landscapeStyle (
68- ( ) => css `
69+ ( ) => css `
6970 > svg {
7071 width : 16px ;
7172 fill : ${ ( { theme } ) => theme . primaryBlue } ;
7273 }
7374 `
74- ) }
75+ ) }
7576` ;
7677
7778const AccountContainer = styled . div `
@@ -95,22 +96,37 @@ const AccountContainer = styled.div`
9596const DesktopText = styled . span `
9697 display : none;
9798 ${ landscapeStyle (
98- ( ) => css `
99+ ( ) => css `
99100 display : inline;
100101 `
101- ) }
102+ ) }
102103` ;
103104
104- const Timestamp = styled . p `
105- color: ${ ( { theme } ) => theme . secondaryText } ;
105+ const Timestamp = styled . label `
106+ color : ${ ( { theme } ) => theme . secondaryText } ;
106107` ;
107108
108109const MobileText = styled . span `
109110 ${ landscapeStyle (
110- ( ) => css `
111+ ( ) => css `
111112 display : none;
112113 `
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+ ) }
114130` ;
115131
116132const AttachedFileText : React . FC = ( ) => (
@@ -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