Skip to content

Commit 8ddd2b1

Browse files
authored
Merge branch 'main' into lib-react-native-share
2 parents 52930a0 + 2846a5a commit 8ddd2b1

File tree

8 files changed

+425
-214
lines changed

8 files changed

+425
-214
lines changed

libraries.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@
207207
"maintainersUsernames": [],
208208
"notes": "Additional OSS libs used internally"
209209
},
210+
"@sentry/react-native": {
211+
"description": "Official Sentry SDK for React Native",
212+
"installCommand": "@sentry/react-native",
213+
"android": true,
214+
"ios": true,
215+
"maintainersUsernames": [],
216+
"notes": "One of top most used libraries according to the npm stats"
217+
},
218+
"react-native-edge-to-edge": {
219+
"description": "Enable edge-to-edge display in React Native",
220+
"installCommand": "react-native-edge-to-edge",
221+
"android": true,
222+
"maintainersUsernames": [],
223+
"notes": "One of top most used libraries according to the npm stats"
224+
},
210225
"react-native-share": {
211226
"description": "Social share, sending simple data to other apps",
212227
"installCommand": "react-native-share",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import GitHubLogo from "~/public/github.svg";
2+
3+
type Props = { repositoryURL?: string };
4+
5+
export function GitHubRepoLink({ repositoryURL }: Props) {
6+
if (!repositoryURL) {
7+
return null;
8+
}
9+
10+
return (
11+
<a
12+
href={repositoryURL}
13+
target="_blank"
14+
className="ml-auto transition-opacity hover:opacity-70"
15+
>
16+
<GitHubLogo className="size-3.5 text-secondary" />
17+
</a>
18+
);
19+
}

website/components/Table.tsx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import {
1010
} from "@tanstack/react-table";
1111
import { twMerge } from "tailwind-merge";
1212

13+
import { GitHubRepoLink } from "~/components/GitHubRepoLink";
1314
import { useSearch } from "~/context/SearchContext";
1415
import data from "~/public/data.json";
1516
import { type LibraryType } from "~/types/data-types";
17+
import getCleanPackageName from "~/utils/getCleanPackageName";
1618

1719
const columnHelper = createColumnHelper<LibraryType>();
1820

@@ -35,18 +37,34 @@ export default function Table({ platform }: Props) {
3537
const { query } = useSearch();
3638

3739
const columns = [
38-
columnHelper.accessor(`library`, {
40+
columnHelper.accessor(`installCommand`, {
3941
header: () => <span className="block">Library</span>,
4042
cell: (info) => {
4143
const entry = info.getValue();
44+
4245
if (!entry.includes(" ")) {
43-
return entry;
46+
const repositoryURL =
47+
info.row.original.repositoryURLs?.[getCleanPackageName(entry)];
48+
return (
49+
<div className="flex items-center">
50+
{entry}
51+
<GitHubRepoLink repositoryURL={repositoryURL} />
52+
</div>
53+
);
4454
}
55+
4556
return (
4657
<div className="flex flex-col">
47-
{entry.split(" ").map((lib: string) => (
48-
<span key={lib}>{lib}</span>
49-
))}
58+
{entry.split(" ").map((lib: string) => {
59+
const repositoryURL =
60+
info.row.original.repositoryURLs?.[getCleanPackageName(lib)];
61+
return (
62+
<div className="flex items-center" key={lib}>
63+
{lib}
64+
<GitHubRepoLink repositoryURL={repositoryURL} />
65+
</div>
66+
);
67+
})}
5068
</div>
5169
);
5270
},

website/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default defineConfig([
3232
Buffer: "readonly",
3333
console: "readonly",
3434
process: "readonly",
35+
fetch: "readonly",
3536
},
3637
},
3738
rules: {

0 commit comments

Comments
 (0)