Skip to content

Commit c049fbd

Browse files
authored
Merge pull request #295 from shnai0/feat/investor-slug
Feat/investor slug
2 parents 7759598 + c5a1750 commit c049fbd

File tree

6 files changed

+384
-36
lines changed

6 files changed

+384
-36
lines changed

app/(static)/blog/[slug]/page.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPosts, getPost } from "@/lib//content/blog";
1+
import { getPosts, getPost } from "@/lib/content/blog";
22
import { ContentBody } from "@/components/mdx/post-body";
33
import { notFound } from "next/navigation";
44
import Link from "next/link";
@@ -7,22 +7,28 @@ import { constructMetadata, formatDate } from "@/lib/utils";
77
import { Metadata } from "next";
88

99
export async function generateStaticParams() {
10-
const posts = await getPosts()
11-
return posts.map((post) => ({ slug: post?.data.slug }))
10+
const posts = await getPosts();
11+
return posts.map((post) => ({ slug: post?.data.slug }));
1212
}
1313

1414
export const generateMetadata = async ({
1515
params,
1616
}: {
1717
params: {
18-
slug: string
19-
}
18+
slug: string;
19+
};
2020
}): Promise<Metadata> => {
21-
const post = (await getPosts()).find((post) => post?.data.slug === params.slug)
22-
const { title, summary: description, image } = post?.data || {}
23-
24-
return constructMetadata({ title: `${title} - Papermark`, description, image })
25-
}
21+
const post = (await getPosts()).find(
22+
(post) => post?.data.slug === params.slug,
23+
);
24+
const { title, summary: description, image } = post?.data || {};
25+
26+
return constructMetadata({
27+
title: `${title} - Papermark`,
28+
description,
29+
image,
30+
});
31+
};
2632

2733
export default async function BlogPage({
2834
params,

app/(static)/investors/ClientPage.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import Fuse from "fuse.js";
4+
45
import { useSearchParams } from "next/navigation";
56
import { useMemo, useState } from "react";
67
import { GlobeIcon, SearchIcon } from "lucide-react";
@@ -9,6 +10,7 @@ import Link from "next/link";
910
import Image from "next/image";
1011
import PlaceholderImg from "@/public/_static/placeholder.png";
1112
import PapermarkPImg from "@/public/_static/papermark-p.svg";
13+
import { Button } from "@/components/ui/button";
1214

1315
const searchOptions = {
1416
threshold: 0.3,
@@ -182,13 +184,22 @@ export default function Dashboard({ data }: any) {
182184
>
183185
Sector
184186
</th>
187+
<th
188+
scope="col"
189+
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
190+
>
191+
Fund details
192+
</th>
185193
</tr>
186194
</thead>
195+
187196
<tbody className="md:divide-y divide-gray-200 md:bg-white grid grid-cols-1 gap-3 sm:grid-cols-2 md:table-row-group">
188197
{paginatedInvestors.map((investor: any) => (
198+
// Assuming you have a slug or some unique identifier for each investor
199+
189200
<tr
190201
key={investor.id}
191-
className="group grid grid-cols-3 gap-1 md:table-row bg-white rounded-lg md:rounded-none md:bg-transparent shadow md:shadow-none border border-gray-200 md:border-x-0 py-3 px-2 md:p-0"
202+
className="hover:bg-gray-100 group grid grid-cols-3 gap-1 md:table-row bg-white rounded-lg md:rounded-none md:bg-transparent shadow md:shadow-none border border-gray-200 md:border-x-0 py-3 px-2 md:p-0"
192203
>
193204
<td className="col-span-3 whitespace-nowrap pl-3 md:py-2 md:pl-6 text-sm sm:pl-6 md:h-24">
194205
<div className="flex items-center space-x-2">
@@ -255,6 +266,15 @@ export default function Dashboard({ data }: any) {
255266
<td className="col-span-3 md:max-w-xs px-3 md:px-2 md:py-3 text-sm text-gray-500 truncate w-40">
256267
{investor.sector ? investor.sector : "Unknown"}
257268
</td>
269+
<td className="col-span-3 md:max-w-xs px-3 md:px-2 md:py-3 text-sm text-gray-500 truncate w-40">
270+
<a
271+
href={`/investors/${encodeURIComponent(investor.slug)}`}
272+
>
273+
<Button className="rounded-3xl bg-gray-200 text-xs text-gray-800 hover:bg-[#fb7a00]]">
274+
Learn more
275+
</Button>
276+
</a>
277+
</td>
258278
</tr>
259279
))}
260280
</tbody>

0 commit comments

Comments
 (0)