Skip to content

Commit a5dd66a

Browse files
committed
Merge branch 'master' into refactor(frontend)/navbar
2 parents ed6098d + edda820 commit a5dd66a

File tree

43 files changed

+363
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+363
-260
lines changed

cms-backend/src/api/for-builders-page-use-cases-section/content-types/for-builders-page-use-cases-section/schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
"useCaseDescription": {
2727
"type": "string"
2828
},
29-
"useCaseBanner": {
30-
"type": "media",
31-
"multiple": false,
32-
"required": true
33-
},
3429
"keyChallenges": {
3530
"type": "component",
3631
"repeatable": false,
@@ -45,6 +40,11 @@
4540
"type": "component",
4641
"repeatable": false,
4742
"component": "content.button-link"
43+
},
44+
"useCaseBanner": {
45+
"type": "component",
46+
"repeatable": false,
47+
"component": "content.responsive-media"
4848
}
4949
}
5050
}

cms-backend/src/api/for-lawyers-page-kleros-enterprise-section/content-types/for-lawyers-page-kleros-enterprise-section/schema.json

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@
2828
"repeatable": false,
2929
"component": "content.highlight-text"
3030
},
31-
"processDiagram": {
32-
"type": "media",
33-
"multiple": false,
34-
"required": false,
35-
"allowedTypes": [
36-
"images",
37-
"files",
38-
"videos",
39-
"audios"
40-
]
41-
},
42-
"processDiagramDesktop": {
43-
"type": "media",
44-
"multiple": false,
45-
"required": false,
46-
"allowedTypes": [
47-
"images",
48-
"files",
49-
"videos",
50-
"audios"
51-
]
52-
},
5331
"table": {
5432
"type": "component",
5533
"repeatable": false,
@@ -64,6 +42,11 @@
6442
"type": "component",
6543
"repeatable": false,
6644
"component": "content.button-link"
45+
},
46+
"processDiagram": {
47+
"type": "component",
48+
"repeatable": false,
49+
"component": "content.responsive-media"
6750
}
6851
}
6952
}

cms-backend/src/api/home-how-kleros-works-section/content-types/home-how-kleros-works-section/schema.json

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,9 @@
2525
"required": true
2626
},
2727
"explainer": {
28-
"type": "media",
29-
"multiple": false,
30-
"required": true,
31-
"allowedTypes": [
32-
"images",
33-
"files",
34-
"videos",
35-
"audios"
36-
]
37-
},
38-
"explainer_desktop": {
39-
"allowedTypes": [
40-
"images",
41-
"files",
42-
"videos",
43-
"audios"
44-
],
45-
"type": "media",
46-
"multiple": false
28+
"type": "component",
29+
"repeatable": false,
30+
"component": "content.responsive-media"
4731
}
4832
}
4933
}

cms-backend/src/api/home-page-hero/content-types/home-page-hero/schema.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@
3434
"component": "content.button-link"
3535
},
3636
"background": {
37+
"type": "media",
38+
"multiple": false,
39+
"required": false,
3740
"allowedTypes": [
3841
"images",
3942
"files",
4043
"videos",
4144
"audios"
42-
],
43-
"type": "media",
44-
"multiple": false
45+
]
46+
},
47+
"tokenStats": {
48+
"type": "relation",
49+
"relation": "oneToMany",
50+
"target": "api::token-stat.token-stat"
4551
}
4652
}
4753
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"collectionName": "components_content_responsive_medias",
3+
"info": {
4+
"displayName": "ResponsiveMedia"
5+
},
6+
"options": {},
7+
"attributes": {
8+
"mobile": {
9+
"allowedTypes": [
10+
"images",
11+
"files",
12+
"videos",
13+
"audios"
14+
],
15+
"type": "media",
16+
"multiple": false
17+
},
18+
"desktop": {
19+
"allowedTypes": [
20+
"images",
21+
"files",
22+
"videos",
23+
"audios"
24+
],
25+
"type": "media",
26+
"multiple": false
27+
}
28+
}
29+
}

cms-backend/types/generated/components.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ export interface ContentNavlink extends Struct.ComponentSchema {
8989
};
9090
}
9191

92+
export interface ContentResponsiveMedia extends Struct.ComponentSchema {
93+
collectionName: 'components_content_responsive_medias';
94+
info: {
95+
displayName: 'ResponsiveMedia';
96+
};
97+
attributes: {
98+
desktop: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
99+
mobile: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
100+
};
101+
}
102+
92103
export interface ContentSection extends Struct.ComponentSchema {
93104
collectionName: 'components_content_sections';
94105
info: {
@@ -403,6 +414,7 @@ declare module '@strapi/strapi' {
403414
'content.highlight-text': ContentHighlightText;
404415
'content.link-card': ContentLinkCard;
405416
'content.navlink': ContentNavlink;
417+
'content.responsive-media': ContentResponsiveMedia;
406418
'content.section': ContentSection;
407419
'content.stat-display': ContentStatDisplay;
408420
'cooperative-report-page.learn-more-section': CooperativeReportPageLearnMoreSection;

cms-backend/types/generated/contentTypes.d.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,10 @@ export interface ApiForBuildersPageUseCasesSectionForBuildersPageUseCasesSection
12551255
updatedAt: Schema.Attribute.DateTime;
12561256
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
12571257
Schema.Attribute.Private;
1258-
useCaseBanner: Schema.Attribute.Media & Schema.Attribute.Required;
1258+
useCaseBanner: Schema.Attribute.Component<
1259+
'content.responsive-media',
1260+
false
1261+
>;
12591262
useCaseDescription: Schema.Attribute.String;
12601263
useCases: Schema.Attribute.Relation<'oneToMany', 'api::use-case.use-case'>;
12611264
useCaseTitle: Schema.Attribute.String;
@@ -1408,11 +1411,9 @@ export interface ApiForLawyersPageKlerosEnterpriseSectionForLawyersPageKlerosEnt
14081411
'api::for-lawyers-page-kleros-enterprise-section.for-lawyers-page-kleros-enterprise-section'
14091412
> &
14101413
Schema.Attribute.Private;
1411-
processDiagram: Schema.Attribute.Media<
1412-
'images' | 'files' | 'videos' | 'audios'
1413-
>;
1414-
processDiagramDesktop: Schema.Attribute.Media<
1415-
'images' | 'files' | 'videos' | 'audios'
1414+
processDiagram: Schema.Attribute.Component<
1415+
'content.responsive-media',
1416+
false
14161417
>;
14171418
publishedAt: Schema.Attribute.DateTime;
14181419
subtitle: Schema.Attribute.Component<'content.highlight-text', false>;
@@ -1611,13 +1612,7 @@ export interface ApiHomeHowKlerosWorksSectionHomeHowKlerosWorksSection
16111612
createdAt: Schema.Attribute.DateTime;
16121613
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
16131614
Schema.Attribute.Private;
1614-
explainer: Schema.Attribute.Media<
1615-
'images' | 'files' | 'videos' | 'audios'
1616-
> &
1617-
Schema.Attribute.Required;
1618-
explainer_desktop: Schema.Attribute.Media<
1619-
'images' | 'files' | 'videos' | 'audios'
1620-
>;
1615+
explainer: Schema.Attribute.Component<'content.responsive-media', false>;
16211616
label: Schema.Attribute.String & Schema.Attribute.Required;
16221617
locale: Schema.Attribute.String & Schema.Attribute.Private;
16231618
localizations: Schema.Attribute.Relation<
@@ -1697,6 +1692,10 @@ export interface ApiHomePageHeroHomePageHero extends Struct.SingleTypeSchema {
16971692
secondaryButton: Schema.Attribute.Component<'content.button-link', false>;
16981693
subtitle: Schema.Attribute.String;
16991694
title: Schema.Attribute.String;
1695+
tokenStats: Schema.Attribute.Relation<
1696+
'oneToMany',
1697+
'api::token-stat.token-stat'
1698+
>;
17001699
updatedAt: Schema.Attribute.DateTime;
17011700
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
17021701
Schema.Attribute.Private;

frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/DisputeResolutionProcess.tsx

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
"use client";
2-
3-
import Image from "next/image";
4-
5-
import { useScreenSize } from "@/hooks/useScreenSize";
1+
import ResponsiveImage from "@/components/ResponsiveImage";
62

73
import { ForLawyersPageKlerosEnterpiseSectionType } from "../../queries/kleros-enterprise-section";
84

95
import HighlightedText from "./HighlightedText";
106

117
type IDisputeResolutionProcess = Pick<
128
ForLawyersPageKlerosEnterpiseSectionType["forLawyersPageKlerosEnterpriseSection"],
13-
"disputeResolutionProcessHeader" | "processDiagram" | "processDiagramDesktop"
9+
"disputeResolutionProcessHeader" | "processDiagram"
1410
>;
1511

1612
const DisputeResolutionProcess: React.FC<IDisputeResolutionProcess> = ({
1713
disputeResolutionProcessHeader,
1814
processDiagram,
19-
processDiagramDesktop,
2015
}) => {
21-
const screenSize = useScreenSize();
2216
return (
2317
<div className="flex flex-col gap-8">
2418
<HighlightedText
@@ -28,21 +22,20 @@ const DisputeResolutionProcess: React.FC<IDisputeResolutionProcess> = ({
2822
/>
2923

3024
<div className="relative flex w-full justify-center">
31-
{screenSize === "lg" ? (
32-
<Image
33-
src={processDiagramDesktop.url}
34-
width={1182}
35-
height={707}
36-
alt="Process diagram"
37-
/>
38-
) : (
39-
<Image
40-
src={processDiagram.url}
41-
width={342}
42-
height={864}
43-
alt="Process diagram"
44-
/>
45-
)}
25+
<ResponsiveImage
26+
mobileProps={{
27+
src: processDiagram.mobile.url,
28+
alt: "Process diagram",
29+
width: 342,
30+
height: 864,
31+
}}
32+
desktopProps={{
33+
src: processDiagram.desktop.url,
34+
alt: "Process diagram",
35+
width: 1182,
36+
height: 707,
37+
}}
38+
/>
4639
</div>
4740
</div>
4841
);

frontend/src/app/for-lawyers/components/KlerosEnterpriseSection/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const KlerosEnterpriseSection: React.FC = async () => {
2222
cards,
2323
disputeResolutionProcessHeader,
2424
processDiagram,
25-
processDiagramDesktop,
2625
table,
2726
arrowLink,
2827
} = (
@@ -56,7 +55,6 @@ const KlerosEnterpriseSection: React.FC = async () => {
5655
{...{
5756
disputeResolutionProcessHeader,
5857
processDiagram,
59-
processDiagramDesktop,
6058
}}
6159
/>
6260

frontend/src/app/for-lawyers/queries/kleros-enterprise-section.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export const forLawyersPageKlerosEnterpriseSectionQuery = gql`
3333
}
3434
3535
processDiagram {
36-
url
37-
}
38-
39-
processDiagramDesktop {
40-
url
36+
mobile {
37+
url
38+
}
39+
desktop {
40+
url
41+
}
4142
}
4243
4344
table {
@@ -90,11 +91,10 @@ export type ForLawyersPageKlerosEnterpiseSectionType = {
9091
cards: Card[];
9192
arrowLink: ArrowLink;
9293
disputeResolutionProcessHeader: HighlightedText;
94+
9395
processDiagram: {
94-
url: string;
95-
};
96-
processDiagramDesktop: {
97-
url: string;
96+
mobile: { url: string };
97+
desktop: { url: string };
9898
};
9999
table: Table;
100100
};

frontend/src/app/home/components/Hero.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { request } from "@/utils/graphQLClient";
99

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

12+
import TokenStats from "./TokenStats";
13+
1214
const Hero: React.FC = async () => {
1315
const heroData = await request<HeroQueryType>(heroQuery);
1416
const {
@@ -18,10 +20,11 @@ const Hero: React.FC = async () => {
1820
secondaryButton,
1921
arrowLink,
2022
background,
23+
tokenStats,
2124
} = heroData.homePageHero;
2225

2326
return (
24-
<div className="relative px-6 pb-28 pt-44 md:pt-52 lg:px-32 lg:pb-60">
27+
<div className="relative px-6 pb-28 pt-44 md:pt-52 lg:px-32 lg:pb-20">
2528
<div className="space-y-8">
2629
<h1 className="text-2xl font-medium lg:text-3xl">{title}</h1>
2730
<p className="text-lg">{subtitle}</p>
@@ -44,6 +47,7 @@ const Hero: React.FC = async () => {
4447
text={arrowLink.text}
4548
className="[&>span]:text-base [&>span]:text-primary-text"
4649
/>
50+
<TokenStats {...{ tokenStats }} />
4751
</div>
4852
<Image
4953
src={background.url}

0 commit comments

Comments
 (0)