Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
Add open source investors static page (#85)
Marc Seitz9342b4561c89
diff --git a/app/(static)/layout.tsx b/app/(static)/layout.tsxindex 9eab72af..ce74aacb 100644--- a/app/(static)/layout.tsx+++ b/app/(static)/layout.tsx@@ -43,7 +43,7 @@ export default function Layout({children}: {children: React.ReactNode}) {<Navbar /><div className="mt-8">- <div className="relative isolate overflow-hidden bg-white ">+ <div className="relative isolate overflow-hidden bg-white"><divclassName="absolute left-[calc(50%-4rem)] top-10 -z-10 transform-gpu blur-3xl sm:left-[calc(50%-18rem)] lg:left-48 lg:top-[calc(50%-30rem)] xl:left-[calc(50%-24rem)]"aria-hidden="true"diff --git a/app/(static)/open-source-investors/ClientPage.tsx b/app/(static)/open-source-investors/ClientPage.tsxnew file mode 100644index 00000000..dbdbfda0--- /dev/null+++ b/app/(static)/open-source-investors/ClientPage.tsx@@ -0,0 +1,69 @@+"use client";++import Fuse from "fuse.js";+import { useSearchParams } from "next/navigation";+import { useMemo, useState } from "react";+import InvestorTable from "@/components/investors/table";+import SearchBar from "@/components/investors/search";+import Stats from "@/components/investors/stats";++const searchOptions = {+ threshold: 0.3,+ location: 0,+ distance: 100,+ minMatchCharLength: 2,+ keys: ["fields.name", "fields.twitterUrl", "fields.company", "fields.title", "fields.openSourceInvestments"],+};+++export default function Dashboard({ data }: any) {+ const { records: allInvestors } = data;+ const [search, setSearch] = useState("");++ const searchParams = useSearchParams();+ const category = searchParams!.get("category");++ // Define filtered & sorted investor array+ const ALL_INVESTORS = allInvestors+ // .filter((angel: any) => !angel.hidden)+ // .sort(compare)+ // .filter((person: any) => {+ // return !category ? true : person.checksize_id.toString() === category;+ // });++ // Fuzzy search with highlighting+ const fuse = new Fuse(ALL_INVESTORS, searchOptions);+ const angels = useMemo(() => {+ if (search.length > 0) {+ return fuse.search(search).map((match) => match.item);+ }+ return ALL_INVESTORS;+ }, [search, ALL_INVESTORS]);++ return (+ <>+ <div className="mx-auto max-w-6xl pt-4 mb-10">+ <div className="max-w-6xl mx-auto px-4 md:px-8 sm:pt-16 pt-8 text-gray-600">+ <div className="space-y-5 max-w-4xl mx-auto text-center">+ <h1 className="text-3xl text-gray-800 font-extrabold mx-auto sm:text-6xl max-w-3xl">+ Find the next angel investor for your open-source project+ </h1>+ </div>+ </div>+ <Stats angelsLength={angels.length} />+ <div className="sm:flex flex-col md:flex-row justify-end mt-4">+ <SearchBar search={search} setSearch={setSearch} />+ </div>+ <div className="mt-8 flex flex-col">+ <div className="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">+ <div className="inline-block min-w-full py-2 align-middle px-6 lg:px-8">+ <div className="overflow-hidden md:shadow md:ring-1 md:ring-black md:ring-opacity-5 rounded-lg">+ <InvestorTable investors={angels} />+ </div>+ </div>+ </div>+ </div>+ </div>+ </>+ );+}diff --git a/app/(static)/open-source-investors/page.tsx b/app/(static)/open-source-investors/page.tsxnew file mode 100644index 00000000..c02759bb--- /dev/null+++ b/app/(static)/open-source-investors/page.tsx@@ -0,0 +1,26 @@+import Dashboard from "./ClientPage";+import { cache } from "react";++export const revalidate = 86400; // revalidate the data at most every 24 hours++const getInvestors = cache(async () => {+ const response = await fetch(+ "https://api.airtable.com/v0/appAxYMTCbZ1hGTmg/tblvBs5aqTt8qkb6h?fields%5B%5D=name&fields%5B%5D=title&fields%5B%5D=company&fields%5B%5D=checkSize&fields%5B%5D=openSourceInvestments&fields%5B%5D=twitterUrl&fields%5B%5D=websiteUrl&fields%5B%5D=twitterImageUrl&filterByFormula=AND(%7Bpublished%7D%3D1%2C%7Btype%7D%3D%22Angel%22)",+ {+ headers: {+ Authorization: `Bearer ${process.env.AIRTABLE_API_KEY}`,+ },+ }+ );+ if (!response.ok) {+ throw new Error("Network response was not ok " + response.statusText);+ }+ const data = await response.json();+ return data;+});++export default async function HomePage() {+ const data = await getInvestors();++ return <Dashboard data={data} />;+}diff --git a/app/sitemap.ts b/app/sitemap.tsindex eadd2a0d..5809c883 100644--- a/app/sitemap.ts+++ b/app/sitemap.ts@@ -30,6 +30,14 @@ export default function sitemap(): MetadataRoute.Sitemap {url: "https://www.papermark.io/privacy",lastModified: new Date(),},+ {+ url: "https://www.papermark.io/open-source-investors",+ lastModified: new Date(),+ },+ {+ url: "https://www.papermark.io/oss-friends",+ lastModified: new Date(),+ },{url: "https://vc.papermark.io",lastModified: new Date(),diff --git a/components/investors/search.tsx b/components/investors/search.tsxnew file mode 100644index 00000000..39116c92--- /dev/null+++ b/components/investors/search.tsx@@ -0,0 +1,28 @@+import { Dispatch, SetStateAction } from "react";+import SearchIcon from "@/components/shared/icons/search";++export default function SearchBar({+ search,+ setSearch,+}: {+ search: string;+ setSearch: Dispatch<SetStateAction<string>>;+}) {+ return (+ <div className="relative mt-5">+ <SearchIcon+ className="h-5 w-5 absolute z-20 left-3 bottom-2"+ aria-hidden="true"+ />+ <input+ type="text"+ id="search"+ name="search"+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ className="w-full rounded-xl shadow-sm inline-flex relative items-center border border-gray-300 px-4 py-2 text-sm text-gray-700 placeholder:text-gray-400 focus:z-10 focus:outline-none focus:ring-gray-500 md:w-72 pl-10 xs:pl-12"+ placeholder="Search by name"+ />+ </div>+ );+}diff --git a/components/investors/stats.tsx b/components/investors/stats.tsxnew file mode 100644index 00000000..c3b4e2bc--- /dev/null+++ b/components/investors/stats.tsx@@ -0,0 +1,43 @@+export default function Stats({ angelsLength }: { angelsLength: any; }) {+ return (+ <div className="relative mt-10">+ <div className="absolute inset-0 h-1/2" />+ <div className="relative mx-auto max-w-7xl">+ <dl className="rounded-lg bg-white shadow-lg sm:grid sm:grid-cols-4">+ <div className="flex flex-col border-b border-gray-100 p-6 text-center sm:border-0 sm:border-r">+ <dt className="order-2 mt-2 text-lg font-medium leading-6 text-gray-500">+ Angel Investors+ </dt>+ <dd className="order-1 text-5xl font-bold tracking-tight text-black">+ {angelsLength}+ </dd>+ </div>+ <div className="flex flex-col border-t border-b border-gray-100 p-6 text-center sm:border-0 sm:border-l sm:border-r">+ <dt className="order-2 mt-2 text-lg font-medium leading-6 text-gray-500">+ Average Check Size+ </dt>+ <dd className="order-1 text-5xl font-bold tracking-tight text-black">+ $45k+ </dd>+ </div>+ <div className="flex flex-col border-t border-b border-gray-100 p-6 text-center sm:border-0 sm:border-l sm:border-r">+ <dt className="order-2 mt-2 text-lg font-medium leading-6 text-gray-500">+ Confirmed Investments+ </dt>+ <dd className="order-1 text-5xl font-bold tracking-tight text-black">+ {(angelsLength * 1.5).toFixed(0)}++ </dd>+ </div>+ <div className="flex flex-col border-t border-gray-100 p-6 text-center sm:border-0 sm:border-l">+ <dt className="order-2 mt-2 text-lg font-medium leading-6 text-gray-500">+ Open Source Projects+ </dt>+ <dd className="order-1 text-5xl font-bold tracking-tight text-black">+ 18+ </dd>+ </div>+ </dl>+ </div>+ </div>+ );+}diff --git a/components/investors/table.tsx b/components/investors/table.tsxnew file mode 100644index 00000000..e701ddf8--- /dev/null+++ b/components/investors/table.tsx@@ -0,0 +1,155 @@+import Image from "next/image";+import TwitterIcon from "@/components/shared/icons/twitter";+import WebsiteIcon from "@/components/shared/icons/globe";+import { cn } from "@/lib/utils";++interface Investor {+ id: string;+ createdTime: string;+ fields: Fields;+}++interface Fields {+ name: string;+ type: string;+ title: string;+ company: string;+ twitterUrl: string;+ websiteUrl: string;+ twitterImageUrl: string;+ openSourceInvestments: string;+ checkSize:+ | "Unknown"+ | "$2-5k"+ | "$5-15k"+ | "$15-25k"+ | "$25-50k"+ | "$50-100k"+ | "$100k+";+}++export default function Table({ investors }: { investors: Investor[]; }) {+ return (+ <div>+ <table className="min-w-full md:divide-y bg-gray-100 md:bg-transparent divide-gray-300 rounded-lg overflow-hidden md:rounded-none">+ <thead className="bg-gray-50 hidden md:table-header-group">+ <tr>+ <th+ scope="col"+ className="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"+ >+ Name+ </th>+ <th+ scope="col"+ className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"+ >+ Company+ </th>+ <th+ scope="col"+ className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"+ >+ Title+ </th>+ <th+ scope="col"+ className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"+ >+ Check Size+ </th>+ <th+ scope="col"+ className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"+ >+ Investments+ </th>+ </tr>+ </thead>+ <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">+ {investors.map((person: Investor) => (+ <tr+ key={person.id}+ className="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"+ >+ <td className="col-span-3 whitespace-nowrap pl-3 md:py-2 md:pl-6 text-sm sm:pl-6 h-24">+ <div className="flex items-center">+ <div className="h-10 w-10 flex-shrink-0">+ <Image+ className="rounded-full"+ width={40}+ height={40}+ src={person.fields.twitterImageUrl}+ alt="twitter avatar"+ />+ </div>+ <div className="ml-4">+ <div className="font-medium text-gray-900">+ {person.fields.name}+ </div>+ <div className="flex space-x-2 items-center mt-1">+ {person.fields.twitterUrl && (+ <a+ className="text-black"+ href={person.fields.twitterUrl}+ target="_blank"+ rel="noopener noreferrer"+ >+ <span className="sr-only">Twitter</span>+ <TwitterIcon className="w-4 h-4" />+ </a>+ )}+ {person.fields.websiteUrl && (+ <a+ className="text-black"+ href={person.fields.websiteUrl}+ target="_blank"+ rel="noopener noreferrer"+ >+ <span className="sr-only">Website</span>+ <WebsiteIcon className="w-4 h-4" />+ </a>+ )}+ </div>+ </div>+ </div>+ </td>+ <td className="col-span-1 row-start-2 whitespace-nowrap px-3 md:px-2 md:py-3 text-sm text-gray-500 font-bold md:font-normal">+ {person.fields.company ?? "Unknown"}+ </td>+ <td className="col-span-3 whitespace-nowrap px-3 md:px-2 md:py-3 text-sm text-gray-500 -mt-2 md:mt-0">+ {person.fields.title ?? "Software Engineer"}+ </td>+ <td className="col-span-3 row-start-2 whitespace-nowrap px-0 md:px-2 md:py-3 text-sm text-gray-500 justify-self-end">+ <span+ className={cn(+ person.fields.checkSize === "Unknown"+ ? "bg-green-100 text-green-800"+ : person.fields.checkSize === "$2-5k"+ ? "bg-blue-100 text-blue-800"+ : person.fields.checkSize === "$5-15k"+ ? "bg-red-100 text-red-800"+ : person.fields.checkSize === "$15-25k"+ ? "bg-cyan-100 text-cyan-800"+ : person.fields.checkSize === "$25-50k"+ ? "bg-yellow-100 text-yellow-800"+ : "bg-orange-100 text-orange-800",+ "inline-flex rounded-full px-[9px] py-[2px] text-xs font-semibold leading-5"+ )}+ >+ {person.fields.checkSize}+ </span>+ </td>+ <td className="col-span-3 md:max-w-xs px-3 md:px-2 md:py-3 text-sm text-gray-500">+ {person.fields.openSourceInvestments ?? "Unknown"}+ </td>+ </tr>+ ))}+ </tbody>+ </table>+ {investors.length === 0 && (+ <div className="text-center my-10">No results found</div>+ )}+ </div>+ );+}diff --git a/components/shared/icons/globe.tsx b/components/shared/icons/globe.tsxnew file mode 100644index 00000000..de33dfab--- /dev/null+++ b/components/shared/icons/globe.tsx@@ -0,0 +1,20 @@+export default function Globe({ className }: { className?: string }) {+ return (+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className={className}+ shapeRendering="geometricPrecision"+ >+ <circle cx="12" cy="12" r="10" />+ <line x1="2" x2="22" y1="12" y2="12" />+ <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />+ </svg>+ );+}\ No newline at end of filediff --git a/components/shared/icons/search.tsx b/components/shared/icons/search.tsxnew file mode 100644index 00000000..6d072f51--- /dev/null+++ b/components/shared/icons/search.tsx@@ -0,0 +1,19 @@+export default function Search({ className }: { className?: string }) {+ return (+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ className={className}+ shapeRendering="geometricPrecision"+ >+ <circle cx="11" cy="11" r="8" />+ <path d="m21 21-4.3-4.3" />+ </svg>+ );+}\ No newline at end of filediff --git a/components/web/footer.tsx b/components/web/footer.tsxindex ad6ddb62..9e5183f9 100644--- a/components/web/footer.tsx+++ b/components/web/footer.tsx@@ -59,6 +59,8 @@ const navigation = {legal: [{ name: "Privacy", href: "/privacy" }],tools: [{ name: "VC-generator", href: "https://vc.papermark.io" },+ { name: "Open Source Friends", href: "/oss-friends" },+ { name: "Open Source Investors", href: "/open-source-investors" },// { name: "Pitchdeck Summariser", href: "#" },],alternatives: [diff --git a/middleware.ts b/middleware.tsindex 02301b5d..767b045d 100644--- a/middleware.ts+++ b/middleware.ts@@ -32,6 +32,7 @@ export default async function middleware(req: NextRequest, ev: NextFetchEvent) {path !== "/" &&path !== "/privacy" &&path !== "/oss-friends" &&+ path !== "/open-source-investors" &&!path.startsWith("/alternatives/") &&!path.startsWith("/blog/") &&!path.startsWith("/view/")diff --git a/next.config.js b/next.config.jsindex ecdbfe74..7596a169 100644--- a/next.config.js+++ b/next.config.js@@ -4,8 +4,10 @@ const nextConfig = {images: {domains: ["dknlay9ljaq1f.cloudfront.net",- "lh3.googleusercontent.com",+ "lh3.googleusercontent.com", // google img"dev-to-uploads.s3.amazonaws.com",+ "pbs.twimg.com", // twitter img+ "media.licdn.com", // linkedin img],},};diff --git a/package-lock.json b/package-lock.jsonindex 2122988e..94d6594d 100644--- a/package-lock.json+++ b/package-lock.json@@ -42,6 +42,7 @@"eslint": "^8.50.0","eslint-config-next": "^13.5.3","framer-motion": "^10.16.4",+ "fuse.js": "^6.6.2","js-cookie": "^3.0.5","lucide-react": "^0.279.0","ms": "^2.1.3",@@ -5724,6 +5725,14 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/fuse.js": {+ "version": "6.6.2",+ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",+ "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==",+ "engines": {+ "node": ">=10"+ }+ },"node_modules/gauge": {"version": "3.0.2","resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",@@ -14540,6 +14549,11 @@"resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz","integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ=="},+ "fuse.js": {+ "version": "6.6.2",+ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",+ "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA=="+ },"gauge": {"version": "3.0.2","resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",diff --git a/package.json b/package.jsonindex 7b1ae741..6706b8cf 100644--- a/package.json+++ b/package.json@@ -48,6 +48,7 @@"eslint": "^8.50.0","eslint-config-next": "^13.5.3","framer-motion": "^10.16.4",+ "fuse.js": "^6.6.2","js-cookie": "^3.0.5","lucide-react": "^0.279.0","ms": "^2.1.3",