Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8b8fadc
chore: remove styled-components and install tailwind
kyrers Oct 23, 2025
ad2c61b
refactor: migrate global styling and theme management to tailwind
kyrers Oct 23, 2025
3152560
chore: remove styled-components module declaration and update reown …
kyrers Oct 24, 2025
d2d2579
refactor: layout migration to tailwind
kyrers Oct 24, 2025
f922943
chore: remove unused react-modal and related types/react-modal depend…
kyrers Oct 30, 2025
f638cb8
style: enhance focus styles and adjust Toastify container padding
kyrers Oct 30, 2025
0bec1a7
fix: specify theme type in ThemeProvider
kyrers Oct 30, 2025
bb0901b
refactor: migrate DesktopHeader and related components to tailwind
kyrers Oct 30, 2025
318211a
fix: proper className concatenation + minor tailwind utility name fixes
kyrers Oct 31, 2025
dba15bb
fix: update className syntax
kyrers Oct 31, 2025
1846911
refactor: migrate MobileHeader and related components to tailwind
kyrers Oct 31, 2025
f3b7df3
refactor: replace Field component with TextField in FormContact
kyrers Oct 31, 2025
db24782
fix: scale NavBar properly using tailwind
kyrers Oct 31, 2025
06a80c0
fix: proper custom breakpoint definition
kyrers Nov 3, 2025
fddfec9
style: remove unnecessary breakpoint global CSS - defined in the @kle…
kyrers Nov 3, 2025
beaca69
refactor: replace custom breakpoint with lg
kyrers Nov 4, 2025
a19329a
refactor: remove unnecessary classes
kyrers Nov 4, 2025
7981c9c
fix: avoid duplicating tailwind classes
kyrers Nov 5, 2025
a1e7428
fix: address rabbitai comments
kyrers Nov 5, 2025
bf5b6d0
chore: add clsx and tailwind-merge for class management
kyrers Nov 5, 2025
5a6d51a
chore: add @tailwindcss/vite as a dev dependency
kyrers Nov 5, 2025
52538dc
chore: make tailwindcss a dev dependency
kyrers Nov 5, 2025
7512ebc
refactor: replace style string concatenation with clsx/cn
kyrers Nov 6, 2025
df464f8
style: optimize hover transition for Help component
kyrers Nov 6, 2025
41dd11c
fix: correct StatusBanner custom selectors
kyrers Nov 6, 2025
2ec1c2f
style: update CSS imports and refine Header component styles
kyrers Nov 6, 2025
6802e43
style: fix DappList component style
kyrers Nov 7, 2025
8113b4d
style: refine desktop header styles
kyrers Nov 7, 2025
90e561f
style: add custom variant for dark mode in global CSS
kyrers Nov 7, 2025
971297a
style: fix header styles
kyrers Nov 10, 2025
4474759
style: update label and input in FormContact
kyrers Nov 10, 2025
4a42db8
refactor: migrate footer to tailwindcss
kyrers Nov 11, 2025
b5b02b9
refactor: replace Link components with anchor tags in Footer
kyrers Nov 11, 2025
c733fbc
style: enhance DappList width responsiveness
kyrers Nov 11, 2025
a4c27e4
refactor: rename useToggleTheme to useTheme for clarity
kyrers Nov 11, 2025
fce76d3
fix: update key prop in navbar menu component
kyrers Nov 11, 2025
e81d068
fix: use index as key prop in navbar menu component
kyrers Nov 11, 2025
a54c5b5
refactor: migrate Home page + related components to tailwind
kyrers Nov 12, 2025
f6d3177
refactor: minor fixes to home component styles
kyrers Nov 12, 2025
7e81424
style: minor fixes + remove some unnecessary style classes
kyrers Nov 13, 2025
077af58
fix: add overlay scrollbar styles import before global
kyrers Nov 13, 2025
6e776cb
style: update OverlayScrollbarsComponent width class for better respo…
kyrers Nov 13, 2025
4b9dc11
refactor: improve maintainability of dynamic calculations
kyrers Nov 13, 2025
573a1a2
refactor: simplify Settings component
kyrers Nov 13, 2025
4e96cdc
fix: custom calculation extraction to be full classes instead of stri…
kyrers Nov 13, 2025
fdf4c0a
refactor: migrate AllLists page + registries fetcher and related comp…
kyrers Nov 14, 2025
62b2f36
refactor: replace hardcoded breakpoint values with constant
kyrers Nov 14, 2025
c5b2016
refactor: migrate ItemDisplay and related components to tailwind (WIP)
kyrers Nov 14, 2025
5c38226
fix: minor style fixes
kyrers Nov 15, 2025
d70ecb5
refactor: continue ItemDisplay and related components migration to ta…
kyrers Nov 16, 2025
f6d436b
refactor: minor accessibility fixes
kyrers Nov 16, 2025
2d565cf
refactor: finish ItemDisplay components migration
kyrers Nov 17, 2025
ef19a2c
refactor: minor fix to history display component
kyrers Nov 17, 2025
0e99882
refactor: migrate RegistryDetails and related components (WIP)
kyrers Nov 17, 2025
81b91e2
fix: minor fixes to TopInfo component
kyrers Nov 17, 2025
cea5d0c
refactor: finish RegistryDetails and related components migration
kyrers Nov 18, 2025
4157613
fix: correct grid row syntax and add key prop to ItemField in ItemCar…
kyrers Nov 18, 2025
ea5feab
fix: minor fixes to lists display migration
kyrers Nov 18, 2025
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
9 changes: 1 addition & 8 deletions web/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import {} from "styled-components";
import { lightTheme } from "./src/styles/themes";

declare global {
module "*.svg" {
const content: React.FC<React.SVGAttributes<SVGElement>>;
Expand All @@ -12,8 +9,4 @@ declare global {
}
}

declare module "styled-components" {
type Theme = typeof lightTheme;
//eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultTheme extends Theme {}
}
export {};
10 changes: 5 additions & 5 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
"@graphql-codegen/client-preset": "^4.2.0",
"@kleros/curate-v2-tsconfig": "workspace:^",
"@kleros/kleros-v2-contracts": "^0.10.0",
"@tailwindcss/vite": "^4.1.16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-modal": "^3.16.3",
"@types/styled-components": "^5.1.34",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/utils": "^5.62.0",
Expand All @@ -61,6 +60,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"lru-cache": "^7.18.3",
"tailwindcss": "^4.1.16",
"typescript": "^5.3.3",
"vite": "^5.4.2",
"vite-plugin-node-polyfills": "^0.22.0",
Expand All @@ -71,7 +71,7 @@
"@cyntler/react-doc-viewer": "^1.17.0",
"@kleros/curate-v2-templates": "workspace:^",
"@kleros/kleros-app": "^2.0.2",
"@kleros/ui-components-library": "^2.20.0",
"@kleros/ui-components-library": "^3.6.0",
"@reown/appkit": "^1.6.6",
"@reown/appkit-adapter-wagmi": "^1.6.6",
"@sentry/react": "^7.93.0",
Expand All @@ -82,6 +82,7 @@
"@yornaath/batshit": "^0.9.0",
"chart.js": "^3.9.1",
"chartjs-adapter-moment": "^1.0.1",
"clsx": "^2.1.1",
"core-js": "^3.35.0",
"graphql": "^16.9.0",
"graphql-request": "^7.1.2",
Expand All @@ -98,13 +99,12 @@
"react-is": "^18.2.0",
"react-loading-skeleton": "^3.3.1",
"react-markdown": "^8.0.7",
"react-modal": "^3.16.1",
"react-router-dom": "^6.21.2",
"react-scripts": "^5.0.1",
"react-toastify": "^9.1.3",
"react-use": "^17.4.3",
"styled-components": "^5.3.11",
"subgraph-status": "^1.2.4",
"tailwind-merge": "^3.3.1",
"viem": "^2.27.2",
"wagmi": "^2.14.10",
"zod": "^3.24.2"
Expand Down
8 changes: 5 additions & 3 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { Route } from "react-router-dom";
import { SentryRoutes } from "./utils/sentry";
import "react-loading-skeleton/dist/skeleton.css";
import "react-toastify/dist/ReactToastify.css";
import "overlayscrollbars/styles/overlayscrollbars.css";
import "./global.css";
import ThemeProvider from "context/ThemeProvider";
import Web3Provider from "context/Web3Provider";
import IsListViewProvider from "context/IsListViewProvider";
import QueryClientProvider from "context/QueryClientProvider";
import StyledComponentsProvider from "context/StyledComponentsProvider";
import Layout from "layout/index";
import Home from "./pages/Home";
import AllLists from "./pages/AllLists";
Expand All @@ -22,7 +24,7 @@ import Settings from "./pages/Settings";

const App: React.FC = () => {
return (
<StyledComponentsProvider>
<ThemeProvider>
<Web3Provider>
<GraphqlBatcherProvider>
<QueryClientProvider>
Expand Down Expand Up @@ -55,7 +57,7 @@ const App: React.FC = () => {
</QueryClientProvider>
</GraphqlBatcherProvider>
</Web3Provider>
</StyledComponentsProvider>
</ThemeProvider>
);
};

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ActionButton/ExecuteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ExecuteButton: React.FC<IExecuteButton> = ({ registryAddress, itemId, refe
<EnsureChain>
<Button
text="Execute"
disabled={isLoading || isError || isExecuting || isPreparingConfig || disabled}
isDisabled={isLoading || isError || isExecuting || isPreparingConfig || disabled}
isLoading={isLoading || isExecuting}
onClick={() => {
if (!executeRequest || !config || !publicClient) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import styled from "styled-components";
import React from "react";

export const ErrorButtonMessage = styled.div`
display: flex;
align-items: center;
gap: 4px;
justify-content: center;
margin: 12px;
color: ${({ theme }) => theme.error};
font-size: 14px;
`;
export const ErrorButtonMessage: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return (
<div className="flex gap-1 items-center justify-center m-3 text-klerosUIComponentsError text-sm">{children}</div>
);
};
25 changes: 5 additions & 20 deletions web/src/components/ActionButton/Modal/Buttons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import React from "react";
import styled from "styled-components";
import { Button } from "@kleros/ui-components-library";
import { EnsureChain } from "components/EnsureChain";
import EnsureAuth from "components/EnsureAuth";
import ClosedCircleIcon from "components/StyledIcons/ClosedCircleIcon";
import { ErrorButtonMessage } from "./ErrorButtonMessage";

const Container = styled.div`
display: flex;
width: 100%;
justify-content: space-between;
flex-wrap: wrap;
gap: 16px;
`;

const ButtonsContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`;

interface IButtons {
toggleModal: () => void;
callback: () => void;
Expand All @@ -38,28 +23,28 @@ const Buttons: React.FC<IButtons> = ({
insufficientBalance,
}) => {
return (
<Container>
<div className="flex flex-wrap gap-4 justify-between w-full">
<Button variant="secondary" text="Return" onClick={toggleModal} />
<EnsureChain>
<EnsureAuth>
<ButtonsContainer>
<div className="flex flex-col items-center">
<Button
text={buttonText}
onClick={() => {
callback();
}}
isLoading={isLoading}
disabled={isDisabled}
isDisabled={isDisabled}
/>
{insufficientBalance ? (
<ErrorButtonMessage>
<ClosedCircleIcon /> Insufficient balance
</ErrorButtonMessage>
) : null}
</ButtonsContainer>
</div>
</EnsureAuth>
</EnsureChain>
</Container>
</div>
);
};
export default Buttons;
9 changes: 2 additions & 7 deletions web/src/components/ActionButton/Modal/ChallengeItemModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useMemo, useState } from "react";
import styled from "styled-components";
import Header from "./Header";
import Buttons from "./Buttons";
import DepositRequired from "./DepositRequired";
Expand All @@ -19,10 +18,6 @@ import {
} from "hooks/useContract";
import { useReadKlerosCoreArbitrationCost } from "hooks/contracts/generated";

const ReStyledModal = styled(Modal)`
gap: 32px;
`;

export enum ChallengeType {
Submission,
Removal,
Expand Down Expand Up @@ -129,7 +124,7 @@ const ChallengeItemModal: React.FC<IChallengeItemModal> = ({
);

return (
<ReStyledModal {...{ toggleModal }}>
<Modal className="gap-8" {...{ toggleModal }}>
<Header text={`Challenge ${isItem ? "Item" : "List"}`} />
<DepositRequired value={depositRequired} />
<EvidenceUpload {...{ setEvidence, setIsEvidenceUploading }} />
Expand All @@ -153,7 +148,7 @@ const ChallengeItemModal: React.FC<IChallengeItemModal> = ({
{...{ insufficientBalance, toggleModal }}
/>
</div>
</ReStyledModal>
</Modal>
);
};

Expand Down
35 changes: 4 additions & 31 deletions web/src/components/ActionButton/Modal/DepositRequired.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
import React from "react";
import { Card } from "@kleros/ui-components-library";
import styled from "styled-components";
import { formatETH } from "utils/format";

const StyledCard = styled(Card)`
display: flex;
flex-direction: column;
background-color: ${({ theme }) => theme.mediumBlue};
height: 87px;
width: 100%;
border: none;
justify-content: center;
align-items: center;
padding: 15px;
gap: 5px;
`;

const StyledHeader = styled.p`
font-size: 14px;
margin: 0;
color: ${({ theme }) => theme.primaryBlue};
`;

const StyledQuantity = styled.p`
font-size: 24px;
margin: 0;
color: ${({ theme }) => theme.primaryBlue};
font-weight: 600;
`;

const FeeRequired: React.FC<{ value: bigint }> = ({ value }) => {
return (
<StyledCard>
<StyledHeader>Deposit required</StyledHeader>
<StyledQuantity>{formatETH(value ?? 1, 5)} ETH</StyledQuantity>
</StyledCard>
<Card className="flex flex-col bg-klerosUIComponentsMediumBlue h-22 w-full border-none justify-center items-center p-4 gap-1.5">
<p className="text-sm text-klerosUIComponentsPrimaryBlue m-0">Deposit required</p>
<p className="text-2xl font-semibold text-klerosUIComponentsPrimaryBlue m-0">{formatETH(value ?? 1, 5)} ETH</p>
</Card>
);
};

Expand Down
67 changes: 17 additions & 50 deletions web/src/components/ActionButton/Modal/EvidenceUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,13 @@
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
import styled from "styled-components";
import { FileUploader, Textarea } from "@kleros/ui-components-library";
import { FileUploader, TextArea } from "@kleros/ui-components-library";
import LabeledInput from "components/LabeledInput";
import { responsiveSize } from "styles/responsiveSize";
import { errorToast, infoToast, successToast } from "utils/wrapWithToast";
import { Roles, useAtlasProvider } from "@kleros/kleros-app";
import { getFileUploaderMsg } from "src/utils";
import useIsDesktop from "hooks/useIsDesktop";
import clsx from "clsx";

const Container = styled.div`
width: 100%;
display: flex;
flex-direction: column;
gap: 38px;
margin: 6px 0px;
`;

const TitleField = styled(LabeledInput)`
width: 100%;
`;

const DescriptionContainer = styled.div`
display: flex;
flex-direction: column;
gap: 12px;
`;

const DescriptionField = styled(Textarea)`
width: 100%;
height: 180px;
`;

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

const StyledFileUploader = styled(FileUploader)`
width: 100%;
margin-bottom: ${responsiveSize(150, 72)};
path {
fill: ${({ theme }) => theme.primaryBlue};
}
small {
white-space: pre-line;
text-align: start;
}
`;
const fileUploaderMarginBottomCalc = "mb-[calc(150px+(72-150)*(min(max(100vw,375px),1250px)-375px)/(1250-375))]";

export type Evidence = {
name: string;
Expand Down Expand Up @@ -92,29 +54,34 @@ const EvidenceUpload: React.FC<IEvidenceUpload> = ({ setEvidence, setIsEvidenceU
};

return (
<Container>
<TitleField
<div className="flex flex-col gap-9 w-full py-1.5">
<LabeledInput
topLeftLabel={{ text: "Title" }}
placeholder="eg. The item is not legit."
value={title}
onChange={(event) => setTitle(event.target.value)}
/>
<DescriptionContainer>
<StyledLabel>Description</StyledLabel>
<DescriptionField
<div className="flex flex-col gap-3">
<label htmlFor="evidence-description" className="text-klerosUIComponentsPrimaryText">
Description
</label>
<TextArea
id="evidence-description"
className="w-full h-[180px]"
placeholder="Explain what motivates you to challenge it. Why do you think the item is not compliant with the Policy?"
value={description}
onChange={(event) => setDescription(event.target.value)}
onChange={(value) => setDescription(value)}
/>
</DescriptionContainer>
<StyledFileUploader
</div>
<FileUploader
className={clsx("w-full [&_small]:whitespace-pre-line [&_small]:text-start", fileUploaderMarginBottomCalc)}
callback={handleFileUpload}
variant={isDesktop ? "info" : undefined}
msg={
"Additionally, you can add an external file.\n" + (getFileUploaderMsg(Roles.Evidence, roleRestrictions) ?? "")
}
/>
</Container>
</div>
);
};

Expand Down
7 changes: 1 addition & 6 deletions web/src/components/ActionButton/Modal/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import React from "react";
import styled from "styled-components";

const StyledHeader = styled.h1`
margin: 0;
`;

interface IHeader {
text: string;
}

const Header: React.FC<IHeader> = ({ text }) => {
return <StyledHeader>{text}</StyledHeader>;
return <h1 className="m-0">{text}</h1>;
};

export default Header;
Loading
Loading