Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
81a550b
feat: add support for extra cards on curator tab
alcercu Mar 27, 2025
8d87ef0
fix(frontend): remove integrate section from ForBuilders
alcercu Mar 27, 2025
d72bff4
fix(frontend): remove elements from for lawyers page
alcercu Mar 27, 2025
e7cef8d
fix(frontend): remove stats from home page
alcercu Mar 27, 2025
c107b2e
Merge pull request #89 from kleros/feat(frontend)/add-extra-curator-c…
alcercu Mar 27, 2025
68bcee2
Merge branch 'fix(frontend)/apply-feedback-round-1' into fix(frontend…
alcercu Mar 27, 2025
d3e6ef8
Merge pull request #88 from kleros/fix(frontend)/remove-unwanted-elem…
alcercu Mar 27, 2025
0bf61ec
fix(frontend): remove home hero enter court button
alcercu Mar 28, 2025
b7681c0
fix(frontend): second round of feedback
alcercu Mar 31, 2025
2d10990
fix(frontend): rename path for-builders and for-lawyers to web-three …
alcercu Mar 31, 2025
1fb43e1
fix(frontend): reorder fellows section
alcercu Mar 31, 2025
38de70c
feat(frontend): add new home sections
alcercu Apr 2, 2025
5983784
feat(frontend): add pagination for mobile fellowship section
alcercu Apr 2, 2025
eea4ab4
fix(frontend): remove app list from home page
alcercu Apr 2, 2025
be7e2c0
feat(frontend): add svgr and arrows to mobile pagination
alcercu Apr 3, 2025
7e4090e
fix(frontend): remove unwanted sections
alcercu Apr 3, 2025
74d98a0
fix(frontend): remove unwanted sections
alcercu Apr 4, 2025
2a1857a
fix(frontend): footer subscribe link
alcercu Apr 4, 2025
644dc2e
feat(frontend): add industries cards
alcercu Apr 4, 2025
fdafe15
Merge branch 'master' into fix(frontend)/apply-feedback-round-1
alcercu Apr 4, 2025
0d3540b
feat(frontend): add for governemnts section
alcercu Apr 4, 2025
af89a8d
Merge branch 'master' into fix(frontend)/apply-feedback-round-1
alcercu Apr 7, 2025
f3b24be
fix(frontend): add more feedback
alcercu Apr 7, 2025
72adb30
feat(frontend): add swipable carousels R&D page
alcercu Apr 7, 2025
a624af6
fix(frontend): remove pnk token tokenomics section
alcercu Apr 7, 2025
eb916d6
fix(frontend): remove links r&d
alcercu Apr 8, 2025
28ebf5f
Merge branch 'master' into fix(frontend)/apply-feedback-round-1
alcercu Apr 8, 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
25 changes: 25 additions & 0 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config) => {
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.(".svg"),
);
config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
// exclude if *.svg?url
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
use: ["@svgr/webpack"],
},
);

fileLoaderRule.exclude = /\.svg$/i;

return config;
},
images: {
minimumCacheTTL: 31536000,
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react-use": "^17.6.0"
},
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@types/node": "^22.10.5",
"@types/react": "^19.0.4",
"@types/react-dom": "^19.0.2",
Expand Down
37 changes: 37 additions & 0 deletions frontend/src/app/enterprise/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from "react";

import Image from "next/image";

import { request } from "@/utils/graphQLClient";

import { heroQuery, HeroQueryType } from "../queries/hero";

const Hero: React.FC = async () => {
const { header, subtitle, background } = (
await request<HeroQueryType>(heroQuery)
).forLawyersPageHero;

return (
<div className="relative px-6 pb-64 pt-44 md:pt-52 lg:px-32 lg:pb-80">
<div className="space-y-8">
<h1
className={
"pt-1 text-2xl font-medium text-primary-text lg:pt-3 lg:text-4xl"
}
>
{header}
</h1>
<p className="max-w-[685px] text-lg text-primary-text">{subtitle}</p>
</div>
<Image
src={background.url}
alt="Hero Image Background"
fill
unoptimized
className="absolute left-0 top-0 z-[-1] h-full object-cover"
/>
</div>
);
};

export default Hero;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import clsx from "clsx";
import Image from "next/image";

import { ArbitrationMethodTableType } from "@/app/for-lawyers/queries/kleros-dispute-resolution-section";
import { ArbitrationMethodTableType } from "@/app/enterprise/queries/kleros-dispute-resolution-section";

const TableCardContent: React.FC<ArbitrationMethodTableType> = ({
name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clsx from "clsx";

import { ArbitrationMethodTableType } from "@/app/for-lawyers/queries/kleros-dispute-resolution-section";
import { ArbitrationMethodTableType } from "@/app/enterprise/queries/kleros-dispute-resolution-section";

import TableCardContent from "./TabelCardContent";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ import {
} from "../../queries/kleros-dispute-resolution-section";

import ArbitrationMethodTable from "./ArbitrationMethodTable";
import KlerosEscrowSection from "./KlerosEscrowSection";
import ResearchSection from "./ResearchSection";
// import ResearchSection from "./ResearchSection";

const KlerosDisputeResolutionSection: React.FC = async () => {
const {
headerSubtitle,
header,
subtitle,
secondHeader,
secondSubtitle,
thirdHeader,
thirdSubtitle,
arbitrationMethodTable,
publications,
} = (
await request<ForLawyersPageDisputeResolutionSectionQueryType>(
forLawyersPageDisputeResolutionSectionQuery,
Expand All @@ -46,16 +42,13 @@ const KlerosDisputeResolutionSection: React.FC = async () => {
</div>

<ArbitrationMethodTable table={arbitrationMethodTable} />
<ResearchSection {...{ secondHeader, secondSubtitle, publications }} />

<div className="my-4 lg:px-32">
<h2 className="mb-6 text-lg font-medium text-primary-text lg:text-xl">
{thirdHeader}
</h2>
<p className="text-secondary-text lg:text-lg">{thirdSubtitle}</p>
</div>

<KlerosEscrowSection />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";

import clsx from "clsx";

import { Table } from "@/app/for-lawyers/queries/kleros-enterprise-section";
import { Table } from "@/app/enterprise/queries/kleros-enterprise-section";
import Divider from "@/components/Divider";
import Pagination from "@/components/Pagination";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { Table } from "@/app/for-lawyers/queries/kleros-enterprise-section";
import { Table } from "@/app/enterprise/queries/kleros-enterprise-section";
import { useScreenSize } from "@/hooks/useScreenSize";

import DesktopTable from "./DesktopTable";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ import {
import Card from "../Card";

import DisputeResolutionProcess from "./DisputeResolutionProcess";
import HighlightedText from "./HighlightedText";
import LemonCashSection from "./LemonCashSection";
import MethodsTable from "./MethodsTable";

const KlerosEnterpriseSection: React.FC = async () => {
const {
headerSubtitle,
header,
subtitle,
cards,
disputeResolutionProcessHeader,
processDiagram,
Expand All @@ -37,14 +33,6 @@ const KlerosEnterpriseSection: React.FC = async () => {
"px-6 py-12 lg:py-24",
)}
>
<div className="flex flex-col gap-6 lg:px-32">
<h3 className="text-primary-purple lg:text-lg">{headerSubtitle}</h3>
<h1 className="text-xl font-medium text-primary-text lg:text-3xl">
{header}
</h1>
<HighlightedText {...subtitle} />
</div>

<div className="grid grid-cols-1 gap-6 lg:grid-cols-3 lg:px-32">
{cards.map((card) => (
<Card key={card.title} {...card} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import clsx from "clsx";

import ExternalLink from "@/components/ExternalLink";
import Flowchart from "@/components/Flowchart";
import { request } from "@/utils/graphQLClient";

import {
forLawyersPageMediationSectionQuery,
ForLawyersPageMediationSectionType,
} from "../../queries/kleros-mediation-section";
import Card from "../Card";
import Flowchart from "../Flowchart";

const KlerosMediationSection: React.FC = async () => {
const { header, subtitle, cards, flowchart, benefitsHeader, arrowLink } = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { getPageMetadata } from "@/utils/seo";
import Hero from "./components/Hero";
import KlerosDisputeResolutionSection from "./components/KlerosDisputeResolutionSection";
import KlerosEnterpriseSection from "./components/KlerosEnterpriseSection";
import KlerosFellowSection from "./components/KlerosFellowSection";
import KlerosMediationSection from "./components/KlerosMediationSection";
import KlerosParticipateSection from "./components/KlerosParticipateSection";
// import KlerosMediationSection from "./components/KlerosMediationSection";

export const generateMetadata = async (): Promise<Metadata> => {
return getPageMetadata("forLawyersPageSeo");
Expand All @@ -18,10 +16,7 @@ const ForLawyers: React.FC = async () => {
<>
<Hero />
<KlerosEnterpriseSection />
<KlerosMediationSection />
<KlerosDisputeResolutionSection />
<KlerosParticipateSection />
<KlerosFellowSection />
</>
);
};
Expand Down
50 changes: 0 additions & 50 deletions frontend/src/app/for-lawyers/components/Hero.tsx

This file was deleted.

41 changes: 41 additions & 0 deletions frontend/src/app/home/components/Enterprise/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";

import clsx from "clsx";

import CtaCard from "@/components/CtaCard";
import { request } from "@/utils/graphQLClient";

import { enterpriseQuery, IEnterpriseQuery } from "./queries";

const Web3: React.FC = async () => {
const { title, subtitle, cards } = await request<IEnterpriseQuery>(
enterpriseQuery,
).then(({ homeEnterprise }) => homeEnterprise);
Comment on lines +10 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Component naming doesn't match folder structure.

The component is named Web3 but is located in the Enterprise folder and uses enterprise data. This is confusing and should be corrected for maintainability.

-const Web3: React.FC = async () => {
+const Enterprise: React.FC = async () => {

Also, remember to update the export at the bottom of the file:

-export default Web3;
+export default Enterprise;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Web3: React.FC = async () => {
const { title, subtitle, cards } = await request<IEnterpriseQuery>(
enterpriseQuery,
).then(({ homeEnterprise }) => homeEnterprise);
const Enterprise: React.FC = async () => {
const { title, subtitle, cards } = await request<IEnterpriseQuery>(
enterpriseQuery,
).then(({ homeEnterprise }) => homeEnterprise);
// ... (rest of the component code)
};
export default Enterprise;


Comment on lines +10 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for GraphQL request.

The component lacks error handling for the GraphQL request. Consider adding try/catch to handle potential network failures or server errors.

-const Web3: React.FC = async () => {
-  const { title, subtitle, cards } = await request<IEnterpriseQuery>(
-    enterpriseQuery,
-  ).then(({ homeEnterprise }) => homeEnterprise);
+const Enterprise: React.FC = async () => {
+  try {
+    const { title, subtitle, cards } = await request<IEnterpriseQuery>(
+      enterpriseQuery,
+    ).then(({ homeEnterprise }) => homeEnterprise);
+    
+    // Component rendering code...
+  } catch (error) {
+    console.error("Failed to fetch Enterprise data:", error);
+    return <div>Failed to load Enterprise section. Please try again later.</div>;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Web3: React.FC = async () => {
const { title, subtitle, cards } = await request<IEnterpriseQuery>(
enterpriseQuery,
).then(({ homeEnterprise }) => homeEnterprise);
const Enterprise: React.FC = async () => {
try {
const { title, subtitle, cards } = await request<IEnterpriseQuery>(
enterpriseQuery,
).then(({ homeEnterprise }) => homeEnterprise);
// Component rendering code...
} catch (error) {
console.error("Failed to fetch Enterprise data:", error);
return <div>Failed to load Enterprise section. Please try again later.</div>;
}
}

return (
<div className="bg-background-1 px-6 pb-12 pt-6 lg:px-32 lg:pb-24 lg:pt-12">
<div className="flex flex-col gap-8">
<h3 className="text-xl font-medium text-primary-text lg:text-3xl">
{title}
</h3>
<p className="text-base text-primary-text lg:text-lg">{subtitle}</p>
<div
className={clsx(
"mx-auto mb-12 mt-4 flex flex-wrap gap-4",
"xl:mt-16 xl:grid xl:grid-cols-3",
)}
>
{cards.map(({ icon, title, subtitle }) => (
<CtaCard
className="flex-grow"
key={title}
{...{ icon, title, description: subtitle }}
/>
))}
</div>
</div>
</div>
);
};

export default Web3;
31 changes: 31 additions & 0 deletions frontend/src/app/home/components/Enterprise/queries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { gql } from "graphql-request";

export const enterpriseQuery = gql`
{
homeEnterprise {
title
subtitle
cards {
icon {
url
}
title
subtitle
}
}
}
`;

export type IEnterpriseQuery = {
homeEnterprise: {
title: string;
subtitle: string;
cards: Array<{
icon: {
url: string;
};
title: string;
subtitle: string;
}>;
};
};
28 changes: 6 additions & 22 deletions frontend/src/app/home/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,26 @@ import Image from "next/image";

import Button from "@/components/Button";
import CustomLink from "@/components/CustomLink";
import ExternalLink from "@/components/ExternalLink";
import { request } from "@/utils/graphQLClient";

import { HeroQueryType, heroQuery } from "../queries/hero";

import TokenStats from "./TokenStats";

const Hero: React.FC = async () => {
const heroData = await request<HeroQueryType>(heroQuery);
const {
title,
subtitle,
primaryButton,
secondaryButton,
arrowLink,
background,
tokenStats,
} = heroData.homePageHero;
const { title, subtitle, primaryButton, secondaryButton, background } =
heroData.homePageHero;

return (
<div className="relative px-6 pb-28 pt-44 md:pt-52 lg:px-32 lg:pb-20">
<div className="relative px-6 pb-56 pt-44 md:pt-52 lg:px-32 lg:pb-72">
<div className="space-y-8">
<h1 className="text-2xl font-medium text-primary-text lg:text-4xl">
{title}
</h1>
<p className="text-lg text-primary-text">{subtitle}</p>
<div className="lg:hidden">
<div>
<CustomLink href={primaryButton.link.url}>
<Button>
<span className="text-background-2"> {primaryButton.text} </span>
<Button variant="secondary">
<span> {primaryButton.text} </span>
</Button>
</CustomLink>
</div>
Expand All @@ -44,12 +34,6 @@ const Hero: React.FC = async () => {
</Button>
</CustomLink>
</div>
<ExternalLink
url={arrowLink.link.url}
text={arrowLink.text}
className="text-start [&>span]:text-base [&>span]:text-primary-text"
/>
<TokenStats {...{ tokenStats }} />
</div>
<Image
src={background.url}
Expand Down
Loading