Skip to content

Commit 48183dd

Browse files
committed
Last feedbacks. We just miss the sticky headers for the price lists
1 parent 7028a60 commit 48183dd

File tree

20 files changed

+130
-72
lines changed

20 files changed

+130
-72
lines changed

src/components/LandingPage/components/SanityContentRTF/SanityContentWidget/SanityContentWidget.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default function SanityContentWidget({ value }: SanityContentWidgetProps)
5858
case 'multipleMember':
5959
return <WidgetMultipleMember />;
6060
case 'repositories':
61+
case 'resourcesList':
6162
return <WidgetRepositories />;
6263
default:
6364
return (

src/components/LandingPage/content/_common.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ import { assertType, TypeDef } from '@/util/type-guards';
66
* @returns `true` if the type is correct.
77
*/
88
export function tryType(typeName: string, data: unknown, type: TypeDef): boolean {
9-
assertType(data, type);
10-
return true;
9+
try {
10+
assertType(data, type);
11+
return true;
12+
} catch (ex) {
13+
// eslint-disable-next-line no-console
14+
console.log('Failing type:', type);
15+
throw ex;
16+
}
1117
}
1218

1319
export type RichText = PortableTextBlock | PortableTextBlock[];

src/components/LandingPage/content/news.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface ContentForNewsItem {
1212
category: string;
1313
cardSize: string;
1414
isEPFL: boolean;
15+
link: string | null;
1516
slug: string;
1617
imageURL: string;
1718
imageWidth: number;
@@ -82,6 +83,7 @@ export function useSanityContentForNewsList(limit?: number): ContentForNewsList
8283
"content": thumbnailIntroduction,
8384
"isEPFL": isBBPEPFLNews,
8485
"slug": slug.current,
86+
"link": externalLink,
8587
category,
8688
cardSize,
8789
"imageURL": thumbnailImage.asset->url,

src/components/LandingPage/content/portals.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ export function useSanityContentForPortalsTitle(): string {
66
return (
77
useSanity(
88
`*[_type=="pages" && slug.current=="home"][0].content[_type=="portalsList"][0].title`,
9-
isString
9+
isStringOrNull
1010
) ?? ''
1111
);
1212
}
1313

14+
function isStringOrNull(data: unknown): data is string | null {
15+
if (data === null) return true;
16+
return isString(data);
17+
}
18+
1419
export interface ContentForPortalsListItem {
1520
title: string;
1621
description: string;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"features": *[_type=="featureBlocList"].featuresBloc[] {
3+
title,
4+
"available": isAvailable,
5+
features[] {
6+
title,
7+
description,
8+
"plans": linkedPlan[]{
9+
"id": plan->_id,
10+
"label": specialLabel,
11+
tooltip
12+
}
13+
}
14+
},
15+
"plans": *[_type=="plan"] | order(position) {
16+
"id": _id,
17+
title,
18+
notes,
19+
"price": {
20+
"month": monthlyPlanNormal[] {
21+
"value": price,
22+
currency
23+
},
24+
"discount": monthlyPlanDiscount[] {
25+
"value": price,
26+
currency
27+
},
28+
"yearNormal": yearlyPlanNormal[] {
29+
"value": price,
30+
currency
31+
},
32+
"yearDiscount": yearlyPlanDiscount[] {
33+
"value": price,
34+
currency
35+
}
36+
}
37+
}
38+
}

src/components/LandingPage/content/pricing.ts

+1-38
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,10 @@
22
import { tryType } from './_common';
33
import { useSanity } from './content';
44
import { typeBooleanOrNull, typeNumberOrNull, typeStringOrNull } from './types';
5+
import query from './pricing.groq';
56
import { isBoolean, TypeDef } from '@/util/type-guards';
67

78
export function useSanityContentForPricing(): ContentForPricing | undefined | null {
8-
const query = `{
9-
"features": *[_type=="featureBlocList"].featuresBloc[] {
10-
title,
11-
"available": isAvailable,
12-
features[] {
13-
title,
14-
description,
15-
"plans": linkedPlan[]{
16-
"id": plan->_id,
17-
"label": specialLabel,
18-
tooltip
19-
}
20-
}
21-
},
22-
"plans": *[_type=="plan"] | order(position) {
23-
"id": _id,
24-
title,
25-
notes,
26-
"price": {
27-
"month": monthlyPlanNormal[] {
28-
"value": price,
29-
currency
30-
},
31-
"discount": monthlyPlanDiscount[] {
32-
"value": price,
33-
currency
34-
},
35-
"yearNormal": yearlyPlanNormal[] {
36-
"value": price,
37-
currency
38-
},
39-
"yearDiscount": yearlyPlanDiscount[] {
40-
"value": price,
41-
currency
42-
}
43-
}
44-
}
45-
}`;
469
return sanityze(useSanity(query, isContentForPricing));
4710
}
4811

src/components/LandingPage/sections/SectionNews/Card/Card.module.css

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
.card.small .content {
2020
flex-direction: column;
21+
height: auto;
2122
}
2223

2324
.card > h1 {
@@ -33,6 +34,7 @@
3334
color: var(--color-neutral);
3435
gap: 2em;
3536
margin-bottom: 2em;
37+
margin-top: 0.5em;
3638
}
3739

3840
.content {

src/components/LandingPage/sections/SectionNews/Card/Card.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { classNames } from '@/util/utils';
66
import ProgressiveImage from '@/components/LandingPage/components/ProgressiveImage';
77
import { IconPlus } from '@/components/LandingPage/icons/IconPlus';
88
import { styleButtonHoverable } from '@/components/LandingPage/styles';
9-
import { sanitizeURL } from '@/components/LandingPage/utils';
9+
1010
import styles from './Card.module.css';
1111

1212
export interface CardsProps {
@@ -29,6 +29,7 @@ export default function Cards({ className, news }: CardsProps) {
2929
</div>
3030
<button
3131
type="button"
32+
title={news.link ?? ''}
3233
className={classNames(styleButtonHoverable, styles.button)}
3334
onClick={() => gotoNews(news)}
3435
>
@@ -56,6 +57,7 @@ function formatDate(d: string) {
5657
}
5758

5859
function gotoNews(news: ContentForNewsItem): void {
59-
const url = sanitizeURL(`/welcome/news/${news.slug}`);
60-
window.location.href = url;
60+
// const url = sanitizeURL(`/welcome/news/${news.slug}`);
61+
const url = news.link;
62+
if (url) window.open(url);
6163
}

src/components/LandingPage/widgets/CompanyMembers/TeamMember/TeamMember.module.css

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
content: '';
1717
background-size: cover;
1818
background-color: var(--color-primary);
19-
background-image: url(./background.jpg);
2019
}
2120

2221
.teamMember > div.image > img {
@@ -37,7 +36,6 @@
3736
.teamMember > div.name {
3837
font-family: var(--font-serif);
3938
font-size: var(--font-size-M);
40-
font-weight: bolder;
4139
background-color: var(--color-neutral-light);
4240
padding: 0 1em;
4341
margin: 0;
Binary file not shown.

src/components/LandingPage/widgets/ContributorsPanel/ContributorsList/ContributorsList.module.css

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
.contributorsList > div > .name {
2222
font-family: var(--font-serif);
2323
font-size: var(--font-size-M-plus);
24-
font-weight: bolder;
2524
line-height: 1;
2625
padding: 0.4em 0.5em;
2726
background-color: var(--color-neutral-light);

src/components/LandingPage/widgets/ContributorsPanel/ContributorsList/ContributorsList.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ export default function ContributorsList({ className, list }: ContributorsListPr
2929
{contributor.google_scholar && (
3030
<a
3131
className={styleButtonHoverable}
32+
target="_BLANK"
3233
href={`https://scholar.google.com/citations?user=${contributor.google_scholar}`}
3334
>
3435
Google Scholar
3536
</a>
3637
)}
3738
{contributor.ORCID && (
38-
<a className={styleButtonHoverable} href={`https://orcid.org/${contributor.ORCID}`}>
39+
<a
40+
className={styleButtonHoverable}
41+
target="_BLANK"
42+
href={`https://orcid.org/${contributor.ORCID}`}
43+
>
3944
Orcid
4045
</a>
4146
)}

src/components/LandingPage/widgets/FromCellToBrain/FromCellToBrain.module.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
.card {
1919
height: 240px;
20-
margin: 8px 0;
20+
margin: 24px 0;
2121
padding: 8px;
2222
border: 1px solid var(--color-neutral);
2323
display: grid;
@@ -35,6 +35,7 @@
3535
min-width: 120px;
3636
min-height: 120px;
3737
border-radius: 50%;
38+
overflow: hidden;
3839
}
3940

4041
.description {

src/components/LandingPage/widgets/MissionStatement/MissionStatement.module.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ button.missionStatement {
3434
.missionStatement > div.text > h2 {
3535
font-family: var(--font-serif);
3636
font-size: var(--font-size-XL);
37-
line-height: 1.5;
37+
line-height: 1.2;
38+
margin-left: 2em;
3839
}
3940

4041
.missionStatement > div.background {

src/components/LandingPage/widgets/News/News.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function WidgetNews() {
1818

1919
if (news.length === 0) return null;
2020

21+
console.log('🚀 [News] styleBlockSmallExpandRight = ', styleBlockSmallExpandRight); // @FIXME: Remove this line written on 2025-02-19 at 14:09
2122
return (
2223
<>
2324
<Title value="News and events" />

src/components/LandingPage/widgets/PriceList/PlanHeader/PlanHeader.module.css

+23-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.discount {
66
color: var(--color-neutral);
77
text-decoration: line-through;
8-
text-decoration-color: var(--color-neutral-light);
8+
text-decoration-color: currentColor;
99
}
1010

1111
.hide {
@@ -24,3 +24,25 @@
2424
.planHeader ul > li::marker {
2525
content: '+';
2626
}
27+
28+
.pill {
29+
content: "Launch";
30+
color: var(--color-neutral);
31+
font-size: var(--font-size-S);
32+
height: 2em;
33+
padding: 0 1em;
34+
border-radius: 99vmax;
35+
border: 1px solid currentColor;
36+
margin-left: 1em;
37+
display: grid;
38+
place-items: center;
39+
}
40+
41+
.price {
42+
display: flex;
43+
flex-wrap: wrap;
44+
flex-direction: row;
45+
justify-content: flex-start;
46+
align-items: center;
47+
gap: 0;
48+
}

src/components/LandingPage/widgets/PriceList/PlanHeader/PlanHeader.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,25 @@ export default function PlanHeader({ className, plan }: PlanHeaderProps) {
3232
</strong>
3333
<small>/month</small>
3434
</div>
35-
<div>
35+
<div className={classNames(styles.discount, discount ? styles.show : styles.hide)}>
36+
<strong>
37+
{currency} {yearNormal}
38+
</strong>
39+
<small>/year</small>
40+
</div>
41+
<div className={styles.price}>
3642
<big>
3743
{currency} {discount || month}
3844
</big>
3945
/month
46+
{discount && <div className={styles.pill}>Launch</div>}
4047
</div>
41-
<div>
48+
<div className={styles.price}>
4249
<big>
4350
{currency} {discount ? yearDiscount : yearNormal}
4451
</big>
4552
/year
53+
{discount && <div className={styles.pill}>Launch</div>}
4654
</div>
4755
<ul>
4856
{plan.notes.map((note, index) => (

src/components/LandingPage/widgets/multiple-member/hooks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function useSanityContentForMultipleMember() {
88
`*[_type=="multipleMemberBloc"].memberList[]->{
99
firstName,
1010
lastName,
11-
biography,
11+
"biography": shortBiography,
1212
"imageURL": image.asset->url,
1313
"imageWidth": image.asset->metadata.dimensions.width,
1414
"imageHeight": image.asset->metadata.dimensions.height

src/components/LandingPage/widgets/repositories/hooks.groq

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*[_type=="repositories"] {
1+
*[_type=="resourcesList"][0].resources[]-> {
22
"type": objectOfStudy,
33
title,
44
author,

0 commit comments

Comments
 (0)