Skip to content

Commit f1535de

Browse files
committed
feat(web): lang-direction
1 parent a744c1f commit f1535de

File tree

21 files changed

+81
-40
lines changed

21 files changed

+81
-40
lines changed

web/src/components/CasesDisplay/Search.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const Search: React.FC = () => {
9090
)}
9191
<SearchBarContainer>
9292
<StyledSearchbar
93+
dir="auto"
9394
type="text"
9495
placeholder="Search By ID"
9596
value={search}

web/src/components/DisputePreview/Alias.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const AliasDisplay: React.FC<IAlias> = ({ name, address }) => {
4646
const resolvedAddress = addressFromENS ?? (address as `0x${string}`);
4747

4848
return (
49-
<AliasContainer>
49+
<AliasContainer dir="auto">
5050
{isLoading ? <Skeleton width={30} height={24} /> : <IdenticonOrAvatar address={resolvedAddress} size="24" />}
5151
<TextContainer>
5252
{isLoading ? <Skeleton width={30} height={24} /> : <AddressOrName address={resolvedAddress} />}&nbsp;

web/src/components/DisputePreview/DisputeContext.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import { responsiveSize } from "styles/responsiveSize";
1212
import ReactMarkdown from "components/ReactMarkdown";
1313
import { StyledSkeleton } from "components/StyledSkeleton";
1414

15-
import AliasDisplay from "./Alias";
1615
import { Divider } from "../Divider";
1716
import { ExternalLink } from "../ExternalLink";
1817

18+
import AliasDisplay from "./Alias";
19+
1920
const StyledH1 = styled.h1`
2021
margin: 0;
2122
word-wrap: break-word;
@@ -75,16 +76,18 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
7576

7677
return (
7778
<>
78-
<StyledH1>{isUndefined(disputeDetails) ? <StyledSkeleton /> : (disputeDetails?.title ?? errMsg)}</StyledH1>
79+
<StyledH1 dir="auto">
80+
{isUndefined(disputeDetails) ? <StyledSkeleton /> : (disputeDetails?.title ?? errMsg)}
81+
</StyledH1>
7982
{disputeDetails?.question?.trim() || disputeDetails?.description?.trim() ? (
8083
<div>
8184
{disputeDetails?.question?.trim() ? (
82-
<ReactMarkdownWrapper>
85+
<ReactMarkdownWrapper dir="auto">
8386
<ReactMarkdown>{disputeDetails.question}</ReactMarkdown>
8487
</ReactMarkdownWrapper>
8588
) : null}
8689
{disputeDetails?.description?.trim() ? (
87-
<ReactMarkdownWrapper>
90+
<ReactMarkdownWrapper dir="auto">
8891
<ReactMarkdown>{disputeDetails.description}</ReactMarkdown>
8992
</ReactMarkdownWrapper>
9093
) : null}
@@ -100,7 +103,7 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
100103
{isUndefined(disputeDetails) ? null : <AnswersHeader>Voting Options</AnswersHeader>}
101104
<AnswersContainer>
102105
{disputeDetails?.answers?.map((answer: IAnswer, i: number) => (
103-
<AnswerTitleAndDescription key={answer.title}>
106+
<AnswerTitleAndDescription dir="auto" key={answer.title}>
104107
<label>{i + 1}. </label>
105108
<AnswerTitle>{answer.title}</AnswerTitle>
106109
<AnswerDescription>{answer.description.trim() ? ` - ${answer.description}` : null}</AnswerDescription>

web/src/components/DisputeView/DisputeCardView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { Card } from "@kleros/ui-components-library";
77

88
import { Periods } from "consts/periods";
99

10-
import { responsiveSize } from "styles/responsiveSize";
1110
import { hoverShortTransitionTiming } from "styles/commonStyles";
11+
import { responsiveSize } from "styles/responsiveSize";
1212

1313
import { StyledSkeleton } from "components/StyledSkeleton";
1414

@@ -37,7 +37,7 @@ const StyledCaseCardTitleSkeleton = styled(StyledSkeleton)`
3737

3838
const TruncatedTitle = ({ text, maxLength }) => {
3939
const truncatedText = text.length <= maxLength ? text : text.slice(0, maxLength) + "…";
40-
return <h3>{truncatedText}</h3>;
40+
return <h3 dir="auto">{truncatedText}</h3>;
4141
};
4242
interface IDisputeCardView {
4343
title: string;

web/src/components/DisputeView/DisputeListView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { Card } from "@kleros/ui-components-library";
88

99
import { Periods } from "consts/periods";
1010

11-
import { responsiveSize } from "styles/responsiveSize";
1211
import { hoverShortTransitionTiming } from "styles/commonStyles";
12+
import { responsiveSize } from "styles/responsiveSize";
1313

1414
import DisputeInfo from "./DisputeInfo";
1515
import PeriodBanner from "./PeriodBanner";
@@ -37,11 +37,12 @@ const TitleContainer = styled.div<{ isLabel?: boolean }>`
3737
width: ${({ isLabel }) => (isLabel ? responsiveSize(150, 340, 900) : "fit-content")};
3838
h3 {
3939
margin: 0;
40+
flex: 1;
4041
}
4142
`;
4243
const TruncatedTitle = ({ text, maxLength }) => {
4344
const truncatedText = text.length <= maxLength ? text : text.slice(0, maxLength) + "…";
44-
return <h3>{truncatedText}</h3>;
45+
return <h3 dir="auto">{truncatedText}</h3>;
4546
};
4647
interface IDisputeListView {
4748
title: string;

web/src/components/EvidenceCard.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import React, { useMemo } from "react";
22
import styled, { css } from "styled-components";
33

4-
import { landscapeStyle } from "styles/landscapeStyle";
5-
import { responsiveSize } from "styles/responsiveSize";
6-
import { hoverShortTransitionTiming } from "styles/commonStyles";
7-
84
import Identicon from "react-identicons";
95
import ReactMarkdown from "react-markdown";
106

@@ -19,6 +15,10 @@ import { shortenAddress } from "utils/shortenAddress";
1915

2016
import { type Evidence } from "src/graphql/graphql";
2117

18+
import { hoverShortTransitionTiming } from "styles/commonStyles";
19+
import { landscapeStyle } from "styles/landscapeStyle";
20+
import { responsiveSize } from "styles/responsiveSize";
21+
2222
import { ExternalLink } from "./ExternalLink";
2323
import { InternalLink } from "./InternalLink";
2424

@@ -58,6 +58,7 @@ const Index = styled.p`
5858
display: inline-block;
5959
`;
6060

61+
const ReactMarkdownWrapper = styled.div``;
6162
const StyledReactMarkdown = styled(ReactMarkdown)`
6263
a {
6364
font-size: 16px;
@@ -216,12 +217,18 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({
216217

217218
return (
218219
<StyledCard>
219-
<TopContent>
220+
<TopContent dir="auto">
220221
<IndexAndName>
221222
<Index>#{index}: </Index>
222223
<h3>{name}</h3>
223224
</IndexAndName>
224-
{name && description ? <StyledReactMarkdown>{description}</StyledReactMarkdown> : <p>{evidence}</p>}
225+
{name && description ? (
226+
<ReactMarkdownWrapper dir="auto">
227+
<StyledReactMarkdown>{description}</StyledReactMarkdown>
228+
</ReactMarkdownWrapper>
229+
) : (
230+
<p>{evidence}</p>
231+
)}
225232
</TopContent>
226233
<BottomShade>
227234
<BottomLeftContent>

web/src/components/Field.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import styled, { css } from "styled-components";
3+
34
import { landscapeStyle } from "styles/landscapeStyle";
45

56
import { InternalLink } from "./InternalLink";
@@ -99,7 +100,7 @@ const Field: React.FC<IField> = ({
99100
className,
100101
}) => {
101102
return (
102-
<FieldContainer isList={displayAsList} {...{ isOverview, isJurorBalance, width, className }}>
103+
<FieldContainer dir="auto" isList={displayAsList} {...{ isOverview, isJurorBalance, width, className }}>
103104
<Icon />
104105
{(!displayAsList || isOverview || isJurorBalance) && <label>{name}:</label>}
105106
{link ? (

web/src/components/LabeledInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const LabeledInput: React.FC<ILabeledInput> = (props) => {
3030
return (
3131
<Container>
3232
{!isUndefined(props.label) ? <StyledLabel id={props.label}>{props.label}</StyledLabel> : null}
33-
<StyledField {...props} id={props?.label} />
33+
<StyledField dir="auto" {...props} id={props?.label} />
3434
</Container>
3535
);
3636
};

web/src/components/Verdict/Answer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const AnswerDisplay: React.FC<IAnswer> = ({ answer, currentRuling }) => {
2222
return (
2323
<>
2424
{answer ? (
25-
<AnswerTitleAndDescription>
25+
<AnswerTitleAndDescription dir="auto">
2626
<AnswerTitle>{answer.title}</AnswerTitle>
2727
<AnswerDescription>{answer.description.trim() ? ` - ${answer.description}` : null}</AnswerDescription>
2828
</AnswerTitleAndDescription>

web/src/components/Verdict/FinalDecision.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { useAccount } from "wagmi";
77

88
import ArrowIcon from "svgs/icons/arrow.svg";
99

10+
import { DEFAULT_CHAIN } from "consts/chains";
1011
import { REFETCH_INTERVAL } from "consts/index";
1112
import { Periods } from "consts/periods";
12-
import { DEFAULT_CHAIN } from "consts/chains";
1313
import { useReadKlerosCoreCurrentRuling } from "hooks/contracts/generated";
1414
import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData";
1515
import { useVotingHistory } from "hooks/queries/useVotingHistory";
@@ -21,11 +21,12 @@ import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery";
2121

2222
import { responsiveSize } from "styles/responsiveSize";
2323

24-
import RulingAndRewardsIndicators from "./RulingAndRewardsIndicators";
25-
import AnswerDisplay from "./Answer";
2624
import { Divider } from "../Divider";
2725
import { StyledArrowLink } from "../StyledArrowLink";
2826

27+
import AnswerDisplay from "./Answer";
28+
import RulingAndRewardsIndicators from "./RulingAndRewardsIndicators";
29+
2930
const Container = styled.div`
3031
width: 100%;
3132
`;
@@ -36,11 +37,14 @@ const JuryContainer = styled.div`
3637
flex-wrap: wrap;
3738
align-items: center;
3839
gap: 4px 7px;
39-
40+
flex: 1;
4041
h3 {
4142
line-height: 21px;
4243
margin-bottom: 0px;
4344
}
45+
> div {
46+
flex: 1;
47+
}
4448
`;
4549

4650
const VerdictContainer = styled.div`
@@ -98,7 +102,7 @@ const FinalDecision: React.FC<IFinalDecision> = ({ arbitrable }) => {
98102
if (isVotingPeriod && isHiddenVotes && commited && !hasVoted) return "Reveal your vote";
99103
if (isVotingPeriod && !isHiddenVotes && !hasVoted) return "Cast your vote";
100104
return "Check how the jury voted";
101-
}, [wasDrawn, hasVoted, isCommitPeriod, isVotingPeriod, commited, isHiddenVotes]);
105+
}, [wasDrawn, hasVoted, isCommitPeriod, isVotingPeriod, commited, isHiddenVotes, isDisconnected]);
102106

103107
return (
104108
<Container>

0 commit comments

Comments
 (0)