From 14916ae3859a050844169281143565c5fd3bd3d9 Mon Sep 17 00:00:00 2001 From: alcercu <333aleix333@gmail.com> Date: Mon, 10 Feb 2025 12:03:46 +0100 Subject: [PATCH 1/2] chore(frontend): migrate with tailwind's script --- frontend/package.json | 5 +- frontend/postcss.config.mjs | 2 +- .../ResearchSection.tsx | 6 +- .../DisputeResolutionProcess.tsx | 4 +- .../LemonCashSection.tsx | 8 +- .../MethodsTable/DesktopTable.tsx | 20 +- frontend/src/app/home/components/Hero.tsx | 6 +- .../src/app/home/components/LearnPosts.tsx | 4 +- .../src/app/home/components/TrustedBy.tsx | 14 +- frontend/src/app/layout.tsx | 4 +- .../Cooperative/ReportSection/ReportCard.tsx | 4 +- frontend/src/components/DownloadButton.tsx | 2 +- .../JurorTabContent/EnterCourtSection.tsx | 4 +- frontend/src/components/Footer.tsx | 4 +- .../DAOSection/KeyChallenges/SafeSnap.tsx | 10 +- .../ForBuilders/UseCasesSection/index.tsx | 2 +- .../src/components/IntegrateSection/index.tsx | 8 +- frontend/src/components/LearnMore.tsx | 4 +- .../Navbar/ResourcesDropdownContent/index.tsx | 10 +- frontend/src/components/Navbar/index.tsx | 6 +- .../src/components/PNKToken/Explorers.tsx | 2 +- .../ResearchTabContent/KlerosBook.tsx | 6 +- frontend/src/components/Tab.tsx | 8 +- frontend/src/styles/globals.css | 158 +- frontend/tailwind.config.ts | 50 - frontend/yarn.lock | 1347 ++++------------- 26 files changed, 508 insertions(+), 1190 deletions(-) delete mode 100644 frontend/tailwind.config.ts diff --git a/frontend/package.json b/frontend/package.json index da42b2e..5844881 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,6 +23,7 @@ "react-use": "^17.6.0" }, "devDependencies": { + "@tailwindcss/postcss": "4.0.0", "@types/node": "^22.10.5", "@types/react": "^19.0.4", "@types/react-dom": "^19.0.2", @@ -34,8 +35,8 @@ "lint-staged": "^15.3.0", "postcss": "^8", "prettier": "^3.4.2", - "prettier-plugin-tailwindcss": "^0.6.9", - "tailwindcss": "^3.4.1", + "prettier-plugin-tailwindcss": "^0.6.11", + "tailwindcss": "4.0.0", "typescript": "^5" }, "volta": { diff --git a/frontend/postcss.config.mjs b/frontend/postcss.config.mjs index 1a69fd2..5d6d845 100644 --- a/frontend/postcss.config.mjs +++ b/frontend/postcss.config.mjs @@ -1,7 +1,7 @@ /** @type {import('postcss-load-config').Config} */ const config = { plugins: { - tailwindcss: {}, + '@tailwindcss/postcss': {}, }, }; diff --git a/frontend/src/app/for-lawyers/components/KlerosDisputeResolutionSection/ResearchSection.tsx b/frontend/src/app/for-lawyers/components/KlerosDisputeResolutionSection/ResearchSection.tsx index 70aeafd..63eee2e 100644 --- a/frontend/src/app/for-lawyers/components/KlerosDisputeResolutionSection/ResearchSection.tsx +++ b/frontend/src/app/for-lawyers/components/KlerosDisputeResolutionSection/ResearchSection.tsx @@ -37,17 +37,17 @@ const ResearchSection: React.FC = ({ return (
-

+

{secondHeader}

-

{secondSubtitle}

+

{secondSubtitle}

{items.map((publication, index) => ( ))}
diff --git a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/DisputeResolutionProcess.tsx b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/DisputeResolutionProcess.tsx index 63941bb..83b6179 100644 --- a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/DisputeResolutionProcess.tsx +++ b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/DisputeResolutionProcess.tsx @@ -17,8 +17,8 @@ const DisputeResolutionProcess: React.FC = ({
diff --git a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/LemonCashSection.tsx b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/LemonCashSection.tsx index 14311d5..746da68 100644 --- a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/LemonCashSection.tsx +++ b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/LemonCashSection.tsx @@ -21,17 +21,17 @@ const LemonCashSection: React.FC = async () => { return (
-

+

{header}

{primarySubtitle}

-

+

{secondarySubtitle}

@@ -40,7 +40,7 @@ const LemonCashSection: React.FC = async () => { height={180} src={icon.url} alt="Lemon cash" - className="flex-shrink-0" + className="shrink-0" />

{testimony}

diff --git a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/MethodsTable/DesktopTable.tsx b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/MethodsTable/DesktopTable.tsx index 050e892..8779a21 100644 --- a/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/MethodsTable/DesktopTable.tsx +++ b/frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/MethodsTable/DesktopTable.tsx @@ -10,8 +10,8 @@ const DesktopTable: React.FC = ({ table }) => { return (
= ({ table }) => {
- + {heading}
@@ -38,11 +38,11 @@ const DesktopTable: React.FC = ({ table }) => { key={rowHeading} className={clsx( "py-4", - rowIndex !== tableRows.length - 1 && "border-b border-b-stroke", + rowIndex !== tableRows.length - 1 && "border-b-stroke border-b", )} > {rowHeading} @@ -52,7 +52,7 @@ const DesktopTable: React.FC = ({ table }) => {
= ({ table }) => { rowIndex === tableRows.length - 1 && "rounded-bl-2xl border-none", // last element of each row - index === rowData.length - 1 && "!pr-8", + index === rowData.length - 1 && "pr-8!", //last row rowIndex === tableRows.length - 1 && "border-none", )} > -

+

{primaryValue}

-

+

{secondaryValue}

diff --git a/frontend/src/app/home/components/Hero.tsx b/frontend/src/app/home/components/Hero.tsx index f8ab394..09f1852 100644 --- a/frontend/src/app/home/components/Hero.tsx +++ b/frontend/src/app/home/components/Hero.tsx @@ -24,7 +24,7 @@ const Hero: React.FC = async () => { } = heroData.homePageHero; return ( -
+

{title}

{subtitle}

@@ -45,7 +45,7 @@ const Hero: React.FC = async () => {
@@ -54,7 +54,7 @@ const Hero: React.FC = async () => { alt="Hero Image Background" fill priority - className="absolute left-0 top-0 z-[-1] h-full object-cover" + className="absolute top-0 left-0 z-[-1] h-full object-cover" />
); diff --git a/frontend/src/app/home/components/LearnPosts.tsx b/frontend/src/app/home/components/LearnPosts.tsx index 9164466..d1130f4 100644 --- a/frontend/src/app/home/components/LearnPosts.tsx +++ b/frontend/src/app/home/components/LearnPosts.tsx @@ -22,12 +22,12 @@ const LearnPosts: React.FC = async () => {

{subtitle}

{cards.map(({ icon, title, subtitle, link }) => ( diff --git a/frontend/src/app/home/components/TrustedBy.tsx b/frontend/src/app/home/components/TrustedBy.tsx index f4dd972..c82b13b 100644 --- a/frontend/src/app/home/components/TrustedBy.tsx +++ b/frontend/src/app/home/components/TrustedBy.tsx @@ -14,7 +14,7 @@ const TrustedBy: React.FC = async () => { return (
-

+

Trusted By

@@ -57,7 +57,7 @@ interface IPartnersCarousel { const PartnersCarousel: React.FC = ({ partners }) => ( <> {[...Array(4)].map((_, i) => ( -
+
{partners.map(({ name, icon_svg }) => (
= ({ partners }) => ( width="42" height="42" className={ - "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" + "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" } />
@@ -86,14 +86,14 @@ const BlurredBorders: React.FC = () => ( <>
diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 7ad4e63..455995c 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -23,10 +23,10 @@ export default async function RootLayout({ return ( - +
-
{children}
+
{children}
diff --git a/frontend/src/components/Cooperative/ReportSection/ReportCard.tsx b/frontend/src/components/Cooperative/ReportSection/ReportCard.tsx index a28a0b5..b1fbc69 100644 --- a/frontend/src/components/Cooperative/ReportSection/ReportCard.tsx +++ b/frontend/src/components/Cooperative/ReportSection/ReportCard.tsx @@ -66,7 +66,7 @@ const ReportCard: React.FC = ({ )} >
-

+

{title}

{subtitle}

@@ -92,7 +92,7 @@ const ReportCard: React.FC = ({