Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 17 additions & 31 deletions web/src/components/DisputePreview/DisputeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ import { StyledSkeleton } from "components/StyledSkeleton";

import AliasDisplay from "./Alias";
import { Divider } from "../Divider";
import { ExternalLink } from "../ExternalLink";

const StyledH1 = styled.h1`
margin: 0;
word-wrap: break-word;
`;

const QuestionAndDescription = styled.div`
display: flex;
flex-direction: column;
word-wrap: break-word;
div:first-child p:first-of-type {
font-size: 16px;
font-weight: 400;
const ReactMarkdownWrapper = styled.div`
& p:first-of-type {
margin: 0;
}
`;

const VotingOptions = styled(QuestionAndDescription)`
const VotingOptions = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
Expand All @@ -51,19 +47,6 @@ const Answer = styled.div`
display: flex;
flex-wrap: wrap;
gap: 6px;
> label {
max-width: 100%;
}
`;

const StyledSmall = styled.small`
color: ${({ theme }) => theme.secondaryText};
font-weight: 400;
`;

const StyledLabel = styled.label`
color: ${({ theme }) => theme.primaryText};
font-weight: 600;
`;

const AliasesContainer = styled.div`
Expand All @@ -83,26 +66,29 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
<>
<StyledH1>{isUndefined(disputeDetails) ? <StyledSkeleton /> : (disputeDetails?.title ?? errMsg)}</StyledH1>
{!isUndefined(disputeDetails) && (
<QuestionAndDescription>
<ReactMarkdown>{disputeDetails?.question}</ReactMarkdown>
<ReactMarkdown>{disputeDetails?.description}</ReactMarkdown>
</QuestionAndDescription>
<>
<ReactMarkdownWrapper>
<ReactMarkdown>{disputeDetails?.question}</ReactMarkdown>
</ReactMarkdownWrapper>
<ReactMarkdownWrapper>
<ReactMarkdown>{disputeDetails?.description}</ReactMarkdown>
</ReactMarkdownWrapper>
</>
)}
{isUndefined(disputeDetails?.frontendUrl) ? null : (
<a href={disputeDetails?.frontendUrl} target="_blank" rel="noreferrer">
<ExternalLink href={disputeDetails?.frontendUrl} target="_blank" rel="noreferrer">
Go to arbitrable
</a>
</ExternalLink>
)}
<VotingOptions>
{isUndefined(disputeDetails) ? null : <AnswersHeader>Voting Options</AnswersHeader>}
<AnswersContainer>
{disputeDetails?.answers?.map((answer: IAnswer, i: number) => (
<Answer key={answer.title}>
<StyledSmall>{i + 1 + `.`}</StyledSmall>
<StyledLabel>
{answer.title}
<small>
<label>{i + 1}.</label> {answer.title}
{answer.description.trim() ? ` - ${answer.description}` : null}
</StyledLabel>
</small>
</Answer>
))}
</AnswersContainer>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ErrorFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Container = styled.div`
height: 100vh;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
max-width: 1780px;
max-width: 1400px;
margin: 0 auto;
`;

Expand Down
16 changes: 11 additions & 5 deletions web/src/components/ExtraStatsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "styled-components";

import { StyledSkeleton } from "components/StyledSkeleton";
import { isUndefined } from "utils/index";
import { InternalLink } from "./InternalLink";

const Container = styled.div`
display: flex;
Expand Down Expand Up @@ -30,10 +31,8 @@ const TextContainer = styled.div`
justify-content: center;
`;

const StyledP = styled.p`
font-size: 14px;
const StyledInternalLink = styled(InternalLink)`
font-weight: 600;
margin: 0;
`;

const StyledExtraStatTitleSkeleton = styled(StyledSkeleton)`
Expand All @@ -42,18 +41,25 @@ const StyledExtraStatTitleSkeleton = styled(StyledSkeleton)`

export interface IExtraStatsDisplay {
title: string;
courtId?: string;
icon: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
content?: React.ReactNode;
text?: string;
}

const ExtraStatsDisplay: React.FC<IExtraStatsDisplay> = ({ title, text, content, icon: Icon, ...props }) => {
const ExtraStatsDisplay: React.FC<IExtraStatsDisplay> = ({ title, courtId, text, content, icon: Icon, ...props }) => {
return (
<Container {...props}>
<SVGContainer>{<Icon />}</SVGContainer>
<TextContainer>
<label>{title}:</label>
{content ? content : <StyledP>{!isUndefined(text) ? text : <StyledExtraStatTitleSkeleton />}</StyledP>}
{content ? (
content
) : (
<StyledInternalLink to={`/courts/${courtId?.toString()}`}>
{!isUndefined(text) ? text : <StyledExtraStatTitleSkeleton />}
</StyledInternalLink>
)}
</TextContainer>
</Container>
);
Expand Down
2 changes: 2 additions & 0 deletions web/src/hooks/queries/usePopulatedDisputeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DisputeDetails } from "@kleros/kleros-sdk/src/dataMappings/utils/disput
import { populateTemplate } from "@kleros/kleros-sdk/src/dataMappings/utils/populateTemplate";

import { useGraphqlBatcher } from "context/GraphqlBatcher";
import { DEFAULT_CHAIN } from "consts/chains";
import { debounceErrorToast } from "utils/debounceErrorToast";
import { isUndefined } from "utils/index";

Expand Down Expand Up @@ -47,6 +48,7 @@ export const usePopulatedDisputeData = (disputeID?: string, arbitrableAddress?:
document: disputeTemplateQuery,
variables: { id: disputeData.dispute?.templateId.toString() },
isDisputeTemplate: true,
chainId: DEFAULT_CHAIN,
});

const templateData = disputeTemplate?.templateData;
Expand Down
1 change: 1 addition & 0 deletions web/src/layout/Header/DesktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Settings from "./navbar/Menu/Settings";
const Container = styled.div`
display: none;
position: absolute;
height: 64px;
${landscapeStyle(
() => css`
Expand Down
16 changes: 8 additions & 8 deletions web/src/layout/Header/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ import styled, { Theme } from "styled-components";

import { Link } from "react-router-dom";

import KlerosCourtLogo from "svgs/header/kleros-court.svg";

import { ArbitratorTypes, getArbitratorType } from "consts/index";

import { isUndefined } from "utils/index";

import KlerosCourtLogo from "svgs/header/kleros-court.svg";

const Container = styled.div`
display: flex;
flex-direction: row;
align-items: center;
gap: 16px;
`;

const StyledLink = styled(Link)`
min-height: 48px;
`;

const BadgeContainer = styled.div<{ backgroundColor: keyof Theme }>`
transform: skewX(-15deg);
background-color: ${({ theme, backgroundColor }) => theme[backgroundColor]};
Expand All @@ -32,6 +29,9 @@ const BadgeText = styled.label`
`;

const StyledKlerosCourtLogo = styled(KlerosCourtLogo)`
max-height: 40px;
width: auto;
&:hover {
path {
fill: ${({ theme }) => theme.white}BF;
Expand Down Expand Up @@ -61,9 +61,9 @@ const CourtBadge: React.FC = () => {
const Logo: React.FC = () => (
<Container>
{" "}
<StyledLink to={"/"}>
<Link to={"/"}>
<StyledKlerosCourtLogo />
</StyledLink>
</Link>
<CourtBadge />
</Container>
);
Expand Down
1 change: 1 addition & 0 deletions web/src/layout/Header/MobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Container = styled.div`
align-items: center;
justify-content: space-between;
width: 100%;
height: 64px;
${landscapeStyle(
() => css`
Expand Down
2 changes: 1 addition & 1 deletion web/src/layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Container = styled.div`

const HeaderContainer = styled.div`
width: 100%;
padding: 8px 24px;
padding: 0 24px;
`;

const Header: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EvidenceSearch: React.FC<IEvidenceSearch> = ({ search, setSearch, evidence

<SearchContainer>
<StyledSearchBar
placeholder="Search evidence by number, word, or submitter."
placeholder="Search evidence by number, word, or submitter"
onChange={(e) => setSearch(e.target.value)}
value={search}
/>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Cases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
max-width: 1780px;
max-width: 1400px;
margin: 0 auto;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Container = styled.div`

const PNKLogoAndTitle = styled.div`
display: flex;
gap: 0 16px;
gap: 0 12px;
align-items: center;
`;

Expand Down
21 changes: 11 additions & 10 deletions web/src/pages/Courts/CourtDetails/StakePanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ const Container = styled.div`
position: relative;
display: flex;
flex-direction: column;
gap: 28px;
gap: 16px;

${landscapeStyle(
() => css`
gap: 24px;
flex-direction: column;
`
)};
`;

const LeftArea = styled.div`
const StakingArea = styled.div`
display: flex;
flex-direction: column;
gap: 24px;
`;

const TagArea = styled.div`
display: flex;
gap: 10px;
`;

const StakeArea = styled(TagArea)`
margin-top: 28px;
const InputArea = styled(TagArea)`
flex-direction: column;
`;

const TextArea = styled.div`
margin-top: 32px;
color: ${({ theme }) => theme.primaryText};
`;

Expand All @@ -57,19 +57,20 @@ const StakePanel: React.FC<{ courtName: string }> = ({ courtName = "General Cour
const isStaking = action === ActionType.stake;
return (
<Container>
<LeftArea>
<StakingArea>
<TagArea>
<Tag text="Stake" active={isActive} onClick={() => handleClick(ActionType.stake)} />
<Tag text="Withdraw" active={!isActive} onClick={() => handleClick(ActionType.withdraw)} />
</TagArea>
<TextArea>
<strong>{`${isStaking ? "Stake" : "Withdraw"} PNK`}</strong> {`${isStaking ? "to join the" : "from"}`}{" "}
{courtName} court
{courtName}
{courtName.toLowerCase().endsWith("court") || courtName.toLowerCase().startsWith("corte") ? null : " Court"}
</TextArea>
<StakeArea>
<InputArea>
<InputDisplay {...{ action, amount, setAmount }} />
</StakeArea>
</LeftArea>
</InputArea>
</StakingArea>
<Simulator amountToStake={amount ? Number(uncommify(amount)) : 0} {...{ isStaking }} />
</Container>
);
Expand Down
13 changes: 11 additions & 2 deletions web/src/pages/Courts/CourtDetails/Stats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { responsiveSize } from "styles/responsiveSize";
import { landscapeStyle } from "styles/landscapeStyle";

import { useParams } from "react-router-dom";
import { Accordion } from "@kleros/ui-components-library";
Expand Down Expand Up @@ -39,11 +40,19 @@ const StyledAccordion = styled(Accordion)`
}
//adds padding to body container
> * > div > div {
padding: 0 24px;
padding: 0;
}
[class*="accordion-item"] {
margin: 0;
}

${landscapeStyle(
() => css`
> * > div > div {
padding: 0 24px;
}
`
)}
`;

const TimeDisplayContainer = styled.div`
Expand Down
5 changes: 2 additions & 3 deletions web/src/pages/Courts/CourtDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ const StakePanelAndStats = styled.div`
flex-direction: row;
justify-content: space-between;
margin-top: 24px;
gap: 20px;
gap: 16px;
flex-wrap: wrap;

${landscapeStyle(
() => css`
& > * {
flex: 1 1 calc(50% - 10px);
max-width: calc(50% - 10px);
flex: 1 1 calc(50% - 8px);
}
`
)}
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Courts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
max-width: 1780px;
max-width: 1400px;
margin: 0 auto;
`;

Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
max-width: 1780px;
max-width: 1400px;
margin: 0 auto;
`;

Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/GetPnk/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 72)} ${responsiveSize(24, 132)} ${responsiveSize(76, 96)};
max-width: 1780px;
max-width: 1400px;
margin: 0 auto;
display: flex;
flex-direction: column;
Expand Down
Loading
Loading