Skip to content

Commit d3642da

Browse files
refactor(web): style-feedback
1 parent 35f2581 commit d3642da

File tree

3 files changed

+19
-28
lines changed

3 files changed

+19
-28
lines changed

web/src/components/Verdict/DisputeTimeline.tsx

+13-18
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { _TimelineItem1, CustomTimeline } from "@kleros/ui-components-library";
88

99
import CalendarIcon from "svgs/icons/calendar.svg";
1010
import ClosedCaseIcon from "svgs/icons/check-circle-outline.svg";
11+
import NewTabIcon from "svgs/icons/new-tab.svg";
1112

1213
import { Periods } from "consts/periods";
1314
import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData";
1415
import { getLocalRounds } from "utils/getLocalRounds";
1516
import { getVoteChoice } from "utils/getVoteChoice";
16-
import { shortenTxnHash } from "utils/shortenAddress";
1717

1818
import { DisputeDetailsQuery, useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery";
1919
import { useVotingHistory } from "queries/useVotingHistory";
@@ -55,13 +55,15 @@ const StyledCalendarIcon = styled(CalendarIcon)`
5555
height: 14px;
5656
`;
5757

58-
const LinkContainer = styled.div`
59-
display: flex;
60-
gap: 4px;
61-
align-items: center;
62-
span {
63-
font-size: 14px;
64-
color: ${({ theme }) => theme.primaryText};
58+
const StyledNewTabIcon = styled(NewTabIcon)`
59+
margin-bottom: 2px;
60+
path {
61+
fill: ${({ theme }) => theme.primaryBlue};
62+
}
63+
:hover {
64+
path {
65+
fill: ${({ theme }) => theme.secondaryBlue};
66+
}
6567
}
6668
`;
6769

@@ -138,16 +140,9 @@ const useItems = (disputeDetails?: DisputeDetailsQuery, arbitrable?: `0x${string
138140
{
139141
title: "Dispute created",
140142
party: (
141-
<LinkContainer>
142-
<span>at</span>
143-
<ExternalLink to={txnExplorerLink} rel="noopener noreferrer" target="_blank">
144-
{votingHistory?.dispute?.transactionHash ? (
145-
shortenTxnHash(votingHistory?.dispute?.transactionHash)
146-
) : (
147-
<Skeleton height={16} width={56} />
148-
)}
149-
</ExternalLink>
150-
</LinkContainer>
143+
<ExternalLink to={txnExplorerLink} rel="noopener noreferrer" target="_blank">
144+
<StyledNewTabIcon />
145+
</ExternalLink>
151146
),
152147
subtitle: formatDate(votingHistory?.dispute?.createdAt),
153148
rightSided: true,

web/src/pages/Cases/CaseDetails/Voting/VotesDetails/index.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ const SecondaryTextLabel = styled.label`
9595
font-size: 16px;
9696
`;
9797

98+
const StyledExternalLink = styled(ExternalLink)`
99+
font-size: 16px;
100+
`;
101+
98102
const AccordionContent: React.FC<{
99103
choice?: string;
100104
answers: Answer[];
@@ -117,9 +121,9 @@ const AccordionContent: React.FC<{
117121
{!isUndefined(timestamp) && (
118122
<div>
119123
<StyledLabel>Date:&nbsp;</StyledLabel>
120-
<ExternalLink to={transactionExplorerLink} rel="noopener noreferrer" target="_blank">
124+
<StyledExternalLink to={transactionExplorerLink} rel="noopener noreferrer" target="_blank">
121125
{formatDate(Number(timestamp), true)}
122-
</ExternalLink>
126+
</StyledExternalLink>
123127
</div>
124128
)}
125129
{justification ? (

web/src/utils/shortenAddress.ts

-8
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,3 @@ export function shortenAddress(address: string): string {
88
throw new TypeError("Invalid input, address can't be parsed");
99
}
1010
}
11-
12-
export function shortenTxnHash(hash: string): string {
13-
try {
14-
return hash.substring(0, 6) + "..." + hash.substring(hash.length - 4);
15-
} catch {
16-
throw new TypeError("Invalid input, address can't be parsed");
17-
}
18-
}

0 commit comments

Comments
 (0)