Skip to content

Commit af351d9

Browse files
committed
Merge branch 'feature/storage-providers-tab-redesign' of https://github.com/fidlabs/filecoin-plus-webapp-next into feature/rpa-filter-type
2 parents fd03609 + 89fc3a0 commit af351d9

File tree

101 files changed

+4891
-1615
lines changed

Some content is hidden

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

101 files changed

+4891
-1615
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "filecoin-plus-webapp-next",
3-
"version": "1.20.0",
3+
"version": "1.24.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
@@ -48,7 +48,7 @@
4848
"react-simple-maps": "^3.0.0",
4949
"recharts": "^2.13.0-alpha.5",
5050
"schema-dts": "^1.1.2",
51-
"semver": "^7.7.2",
51+
"semver": "^7.7.3",
5252
"sonner": "^1.5.0",
5353
"swr": "^2.3.5",
5454
"tailwind-merge": "^2.5.2",

src/app/(dashboard)/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Charts } from "@/app/(dashboard)/components/charts";
22
import { DatacapFlow } from "@/app/(dashboard)/components/datacap-flow";
33
import { Stats } from "@/app/(dashboard)/components/stats";
4+
import { Container } from "@/components/container";
45
import { JsonLd } from "@/components/json.ld";
5-
import { PageHeader, PageSubTitle, PageTitle } from "@/components/ui/title";
6+
import { PageHeader, PageSubtitle, PageTitle } from "@/components/page-header";
67
import {
78
getAllocators,
89
getDataCapAllocationsWeekly,
@@ -37,14 +38,14 @@ export default async function Home() {
3738

3839
return (
3940
<JsonLd data={page}>
40-
<main className="main-content flex flex-col gap-8 items-start">
41+
<main className="flex flex-col gap-8">
4142
<PageHeader>
4243
<PageTitle>State of Fil+</PageTitle>
43-
<PageSubTitle>
44+
<PageSubtitle>
4445
Quick statistics and metrics about the Filecoin Plus program.
45-
</PageSubTitle>
46+
</PageSubtitle>
4647
</PageHeader>
47-
<div className="flex flex-col gap-6 w-full">
48+
<Container className="flex flex-col gap-6 w-full">
4849
<Stats />
4950
<Charts
5051
stats={stats}
@@ -53,7 +54,7 @@ export default async function Home() {
5354
allocators={allocators}
5455
/>
5556
<DatacapFlow />
56-
</div>
57+
</Container>
5758
</main>
5859
</JsonLd>
5960
);

src/app/about/page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
CardHeader,
77
} from "@/components/ui/card";
88
import { buttonVariants } from "@/components/ui/button";
9-
import { PageTitle } from "@/components/ui/title";
109
import {
1110
BookIcon,
1211
CodeIcon,
@@ -17,6 +16,8 @@ import { StatsLink } from "@/components/ui/stats-link";
1716
import Link from "next/link";
1817
import { WebPage, WithContext } from "schema-dts";
1918
import { JsonLd } from "@/components/json.ld";
19+
import { Container } from "@/components/container";
20+
import { PageHeader, PageTitle } from "@/components/page-header";
2021

2122
const page: WithContext<WebPage> = {
2223
"@context": "https://schema.org",
@@ -85,8 +86,10 @@ const contentLink = {
8586
export default function AboutPage() {
8687
return (
8788
<JsonLd data={page}>
88-
<main className="main-content flex flex-col gap-8 row-start-2 items-start">
89+
<PageHeader>
8990
<PageTitle>About</PageTitle>
91+
</PageHeader>
92+
<Container className="flex flex-col gap-8 row-start-2 items-start">
9093
<div className="space-y-12">
9194
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-9">
9295
<Card className="flex flex-col">
@@ -207,7 +210,7 @@ export default function AboutPage() {
207210
</div>
208211
</div>
209212
</div>
210-
</main>
213+
</Container>
211214
</JsonLd>
212215
);
213216
}

src/app/alerts/layout.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import { Container } from "@/components/container";
12
import { JsonLd } from "@/components/json.ld";
3+
import { PageHeader, PageSubtitle, PageTitle } from "@/components/page-header";
24
import {
35
Card,
46
CardContent,
57
CardDescription,
68
CardHeader,
79
CardTitle,
810
} from "@/components/ui/card";
9-
import { PageHeader, PageSubTitle, PageTitle } from "@/components/ui/title";
1011
import {
1112
fetchAllocatorsDailyReportChecks,
1213
fetchAllocatorsReportChecksWeeks,
@@ -117,15 +118,15 @@ export default async function AlertsLayout({ children }: PropsWithChildren) {
117118

118119
return (
119120
<JsonLd data={jsonLdData}>
120-
<main className="main-content flex flex-col gap-8">
121+
<main className="flex flex-col gap-8">
121122
<PageHeader>
122123
<PageTitle>Alerts</PageTitle>
123-
<PageSubTitle>
124+
<PageSubtitle>
124125
Alerts regarding the state of Filecoin Plus program.
125-
</PageSubTitle>
126+
</PageSubtitle>
126127
</PageHeader>
127128

128-
<div className="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 content-evenly">
129+
<Container className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 content-evenly">
129130
{stats.map(({ heading, subtext, content }, index) => (
130131
<Card key={index}>
131132
<CardHeader>
@@ -135,7 +136,7 @@ export default async function AlertsLayout({ children }: PropsWithChildren) {
135136
<CardContent>{content}</CardContent>
136137
</Card>
137138
))}
138-
</div>
139+
</Container>
139140

140141
{children}
141142
</main>

src/app/alerts/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Container } from "@/components/container";
12
import {
23
Card,
34
CardDescription,
@@ -100,7 +101,7 @@ export default async function AlertsPage({ searchParams }: PageProps) {
100101
const maybeSelectedWeek = safeWeekFromString(searchParams.week);
101102

102103
return (
103-
<div className="flex flex-col gap-12">
104+
<Container className="flex flex-col gap-12">
104105
<Card>
105106
<CardHeader className="flex-col items-start">
106107
<CardTitle>Alerts Over Time</CardTitle>
@@ -116,6 +117,6 @@ export default async function AlertsPage({ searchParams }: PageProps) {
116117
</Card>
117118

118119
<AlertsList data={alertsData} />
119-
</div>
120+
</Container>
120121
);
121122
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { Container } from "@/components/container";
12
import { Card } from "@/components/ui/card";
23
import { type PropsWithChildren } from "react";
34

45
export default function AllocatorsListLayout({ children }: PropsWithChildren) {
56
return (
6-
<main className="main-content">
7+
<Container>
78
<Card className="mt-[50px]">{children}</Card>
8-
</main>
9+
</Container>
910
);
1011
}

src/app/allocators/(pages)/[id]/(pages)/over-time/components/allocations-over-time-chart.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ const AllocationsOverTimeChart = ({
9797
href: `/allocators/${allocatorId}/reports`,
9898
value: "reports",
9999
},
100+
{
101+
label: "Score",
102+
href: `/allocators/${allocatorId}/score`,
103+
value: "score",
104+
},
100105
] as ITabNavigatorTab[];
101106
}, [allocatorId]);
102107

src/app/allocators/(pages)/[id]/(pages)/over-time/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AllocationsOverTimeChart } from "@/app/allocators/(pages)/[id]/(pages)/over-time/components/allocations-over-time-chart";
2+
import { Container } from "@/components/container";
23
import { getAllocatorById } from "@/lib/api";
34
import { Suspense } from "react";
45

@@ -10,11 +11,11 @@ const AllocatorOverTimeDetailsPage = async (props: IPageProps) => {
1011
const data = await getAllocatorById(props.params.id);
1112

1213
return (
13-
<div className="main-content">
14+
<Container>
1415
<Suspense>
1516
<AllocationsOverTimeChart data={data} allocatorId={props.params.id} />
1617
</Suspense>
17-
</div>
18+
</Container>
1819
);
1920
};
2021

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client";
2+
3+
import { AllocatorScoreBadge } from "@/components/allocator-score-badge";
4+
import { useScrollObserver } from "@/lib/hooks/useScrollObserver";
5+
import { cn } from "@/lib/utils";
6+
import { useReportsDetails } from "../providers/reports-details.provider";
7+
import { Button } from "@/components/ui/button";
8+
import Link from "next/link";
9+
10+
export function AllocatorReportScoringSection() {
11+
const { colsStyle, colsSpanStyle, reports } = useReportsDetails();
12+
const { top, ref } = useScrollObserver();
13+
14+
return (
15+
<div className="grid" style={colsStyle}>
16+
<div
17+
ref={ref}
18+
className={cn(
19+
"p-4 border-b sticky top-[147px] bg-white",
20+
top > 90 && "z-[5]",
21+
top === 147 && "shadow-md"
22+
)}
23+
style={colsSpanStyle}
24+
>
25+
<h2 className="font-semibold text-lg">Allocator Score</h2>
26+
</div>
27+
28+
{reports.map((report, index) => {
29+
return (
30+
<div
31+
key={index}
32+
className="p-4 border-b [&:not(:last-child)]:border-r-2 flex items-center space-x-2"
33+
>
34+
<AllocatorScoreBadge
35+
scoringResults={report.scoring_results}
36+
averageScore={report.all_allocators_score_avg}
37+
/>
38+
<div>
39+
<p className="text-sm text-muted-foreground">
40+
Total Allocator Score
41+
</p>
42+
<Button variant="link" asChild>
43+
<Link
44+
href={`/allocators/${report.allocator}/score/${report.id}`}
45+
>
46+
View Score Breakdown
47+
</Link>
48+
</Button>
49+
</div>
50+
</div>
51+
);
52+
})}
53+
</div>
54+
);
55+
}

0 commit comments

Comments
 (0)