Skip to content

Commit

Permalink
Merge pull request #1800 from kleros/feat/new-navbar-color-and-blur-a…
Browse files Browse the repository at this point in the history
…nd-other-adjustments

fix: new navbar color with blur in dark mode, mobile responsiveness and other adjustments
  • Loading branch information
alcercu authored Dec 18, 2024
2 parents 20ac82c + 9eb9a66 commit 7a27eed
Show file tree
Hide file tree
Showing 51 changed files with 212 additions and 182 deletions.
2 changes: 1 addition & 1 deletion web-devtools/src/app/(main)/(homepage)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Tools from "./Tools";
const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.klerosUIComponentsLightBackground};
padding: ${responsiveSize(32, 72)} ${responsiveSize(24, 132)} ${responsiveSize(76, 96)};
padding: ${responsiveSize(32, 72)} ${responsiveSize(8, 132)} ${responsiveSize(76, 96)};
max-width: 1780px;
margin: 0 auto;
`;
Expand Down
83 changes: 41 additions & 42 deletions web/src/assets/svgs/hero/hero-darkmode-desktop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions web/src/assets/svgs/hero/hero-darkmode-mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion web/src/components/CasesDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ const TitleContainer = styled.div`

const StyledTitle = styled.h1`
margin: 0px;
font-size: ${responsiveSize(20, 24)};
`;

const StyledLabel = styled.label`
font-size: 16px;
font-size: ${responsiveSize(14, 16)};
`;

interface ICasesDisplay extends ICasesGrid {
Expand Down
40 changes: 25 additions & 15 deletions web/src/components/DisputePreview/DisputeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { ExternalLink } from "../ExternalLink";
const StyledH1 = styled.h1`
margin: 0;
word-wrap: break-word;
font-size: ${responsiveSize(18, 24)};
line-height: 24px;
`;

const ReactMarkdownWrapper = styled.div`
Expand All @@ -36,17 +38,25 @@ const VotingOptions = styled.div`
const AnswersContainer = styled.div`
display: flex;
flex-direction: column;
gap: ${responsiveSize(4, 2)};
`;

const AnswersHeader = styled.h3`
const AnswersHeader = styled.small`
margin: 0;
`;

const Answer = styled.div`
margin: 0px;
display: flex;
flex-wrap: wrap;
gap: 6px;
export const AnswerTitleAndDescription = styled.div`
display: block;
`;

export const AnswerTitle = styled.small`
display: inline;
`;

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

const AliasesContainer = styled.div`
Expand All @@ -62,11 +72,12 @@ interface IDisputeContext {

export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRpcError = false }) => {
const errMsg = isRpcError ? RPC_ERROR : INVALID_DISPUTE_DATA_ERROR;

return (
<>
<StyledH1>{isUndefined(disputeDetails) ? <StyledSkeleton /> : (disputeDetails?.title ?? errMsg)}</StyledH1>
{!isUndefined(disputeDetails) ? (
<>
{disputeDetails?.question?.trim() || disputeDetails?.description?.trim() ? (
<div>
{disputeDetails?.question?.trim() ? (
<ReactMarkdownWrapper>
<ReactMarkdown>{disputeDetails.question}</ReactMarkdown>
Expand All @@ -77,7 +88,7 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
<ReactMarkdown>{disputeDetails.description}</ReactMarkdown>
</ReactMarkdownWrapper>
) : null}
</>
</div>
) : null}

{isUndefined(disputeDetails?.frontendUrl) ? null : (
Expand All @@ -89,12 +100,11 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
{isUndefined(disputeDetails) ? null : <AnswersHeader>Voting Options</AnswersHeader>}
<AnswersContainer>
{disputeDetails?.answers?.map((answer: IAnswer, i: number) => (
<Answer key={answer.title}>
<small>
<label>{i + 1}.</label> {answer.title}
{answer.description.trim() ? ` - ${answer.description}` : null}
</small>
</Answer>
<AnswerTitleAndDescription key={answer.title}>
<label>{i + 1}. </label>
<AnswerTitle>{answer.title}</AnswerTitle>
<AnswerDescription>{answer.description.trim() ? ` - ${answer.description}` : null}</AnswerDescription>
</AnswerTitleAndDescription>
))}
</AnswersContainer>
</VotingOptions>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/DisputePreview/Policies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Container = styled.div`
flex-direction: row;
flex-wrap: wrap;
gap: 8px 16px;
padding: ${responsiveSize(16, 20)} ${responsiveSize(16, 32)};
padding: ${responsiveSize(12, 20)} ${responsiveSize(8, 32)};
background-color: ${({ theme }) => theme.mediumBlue};
`;

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/DisputeView/DisputeCardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const StyledCard = styled(Card)`

const CardContainer = styled.div`
height: calc(100% - 45px);
padding: ${responsiveSize(20, 24)};
padding: ${responsiveSize(20, 24)} ${responsiveSize(8, 24)};
display: flex;
flex-direction: column;
justify-content: space-between;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/DisputeView/PeriodBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Container = styled.div<IContainer>`
align-items: center;
gap: 8px;
justify-content: space-between;
padding: 0 ${({ isCard }) => (isCard ? "24px" : responsiveSize(8, 24, 900))};
padding: 0 ${({ isCard }) => (isCard ? responsiveSize(8, 24) : responsiveSize(8, 24, 900))};
flex-shrink: 0;
${({ frontColor, backgroundColor, isCard }) => {
return `
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/EvidenceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const StyledCard = styled(Card)`
const TopContent = styled.div`
display: flex;
flex-direction: column;
padding: ${responsiveSize(8, 24)};
gap: ${responsiveSize(4, 8)};
padding: ${responsiveSize(8, 20)} ${responsiveSize(8, 24)};
gap: 4px;
overflow-wrap: break-word;
> * {
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/FavoriteCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import DisputeView from "components/DisputeView";
import { SkeletonDisputeCard } from "components/StyledSkeleton";

const Container = styled.div`
margin-top: ${responsiveSize(48, 80)};
margin-top: ${responsiveSize(24, 48)};
`;

const Title = styled.h1`
margin-bottom: 4px;
font-size: ${responsiveSize(20, 24)};
`;

const DisputeContainer = styled.div`
Expand Down
1 change: 1 addition & 0 deletions web/src/components/LatestCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Container = styled.div`

const Title = styled.h1`
margin-bottom: ${responsiveSize(12, 24)};
font-size: ${responsiveSize(20, 24)};
`;

const DisputeContainer = styled.div`
Expand Down
18 changes: 18 additions & 0 deletions web/src/components/OverlayPortal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import ReactDOM from "react-dom";
import styled from "styled-components";

const PortalContainer = styled.div`
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
height: 100%;
`;

const OverlayPortal: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return ReactDOM.createPortal(<PortalContainer>{children}</PortalContainer>, document.body);
};

export default OverlayPortal;
13 changes: 6 additions & 7 deletions web/src/components/Verdict/Answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import styled from "styled-components";

import { Answer } from "@kleros/kleros-sdk/src/dataMappings/utils/disputeDetailsTypes";

import { AnswerDescription, AnswerTitle, AnswerTitleAndDescription } from "../DisputePreview/DisputeContext";

const Container = styled.div`
display: flex;
flex-direction: row;
Expand All @@ -20,13 +22,10 @@ const AnswerDisplay: React.FC<IAnswer> = ({ answer, currentRuling }) => {
return (
<>
{answer ? (
<Container>
<small>
{answer.title}
{answer.description.trim() ? " -" : null}
</small>
<small>{answer.description.trim()}</small>
</Container>
<AnswerTitleAndDescription>
<AnswerTitle>{answer.title}</AnswerTitle>
<AnswerDescription>{answer.description.trim() ? ` - ${answer.description}` : null}</AnswerDescription>
</AnswerTitleAndDescription>
) : (
<Container>
{currentRuling !== 0 ? <small>Answer 0x{currentRuling}</small> : <small>Refuse to Arbitrate</small>}
Expand Down
1 change: 0 additions & 1 deletion web/src/components/Verdict/FinalDecision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const VerdictContainer = styled.div`

const JuryDecisionTag = styled.small`
font-weight: 400;
line-height: 19px;
color: ${({ theme }) => theme.secondaryText};
`;

Expand Down
4 changes: 3 additions & 1 deletion web/src/components/Verdict/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from "react";
import styled from "styled-components";

import { responsiveSize } from "styles/responsiveSize";

import DisputeTimeline from "./DisputeTimeline";
import FinalDecision from "./FinalDecision";

const Container = styled.div`
display: flex;
flex-wrap: wrap;
gap: 24px;
gap: ${responsiveSize(16, 24)};
`;

interface IVerdict {
Expand Down
2 changes: 1 addition & 1 deletion web/src/layout/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ExternalLink } from "components/ExternalLink";
const Container = styled.div`
height: 122px;
width: 100%;
background-color: ${({ theme }) => theme.primaryPurple};
background-color: ${({ theme }) => (theme.name === "dark" ? theme.lightBlue : theme.primaryPurple)};
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
Loading

0 comments on commit 7a27eed

Please sign in to comment.