Skip to content

Commit ee63a5d

Browse files
authored
Merge pull request #1622 from kleros/refactor/evidence-tab-ui-updates
refactor(web): refactor-date-and-file-viewer-styles
2 parents de4c5d6 + f2021c8 commit ee63a5d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

web/src/components/EvidenceCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const DesktopText = styled.span`
102102
)}
103103
`;
104104

105-
const Timestamp = styled.p`
105+
const Timestamp = styled.label`
106106
color: ${({ theme }) => theme.secondaryText};
107107
`;
108108

@@ -164,7 +164,7 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ evidence, sender, index, timest
164164
<Identicon size="24" string={sender} />
165165
<p>{shortenAddress(sender)}</p>
166166
</AccountContainer>
167-
<Timestamp>{formatDate(Number(timestamp))}</Timestamp>
167+
<Timestamp>{formatDate(Number(timestamp), true)}</Timestamp>
168168
{data && typeof data.fileURI !== "undefined" && (
169169
<StyledLink to={`attachment/?url=${getIpfsUrl(data.fileURI)}`}>
170170
<AttachmentIcon />

web/src/components/FileViewer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Wrapper = styled.div`
1212
background-color: ${({ theme }) => theme.whiteBackground};
1313
border-radius: 3px;
1414
box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.06);
15-
max-height: 750px;
15+
max-height: 1050px;
1616
overflow: scroll;
1717
1818
${customScrollbar}

web/src/utils/date.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ export function getOneYearAgoTimestamp(): number {
2020
return currentTime - 31536000; // One year in seconds
2121
}
2222

23-
export function formatDate(unixTimestamp: number): string {
23+
export function formatDate(unixTimestamp: number, withTime = false): string {
2424
const date = new Date(unixTimestamp * 1000);
25-
const options: Intl.DateTimeFormatOptions = { month: "long", day: "2-digit", year: "numeric" };
25+
const options: Intl.DateTimeFormatOptions = withTime
26+
? {
27+
month: "long",
28+
day: "2-digit",
29+
year: "numeric",
30+
hour: "numeric",
31+
minute: "numeric",
32+
timeZone: "GMT",
33+
timeZoneName: "short",
34+
}
35+
: { month: "long", day: "2-digit", year: "numeric" };
2636
return date.toLocaleDateString("en-US", options);
2737
}

0 commit comments

Comments
 (0)