Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Dec 26, 2023
1 parent bf67ee1 commit 3ceb9cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
37 changes: 18 additions & 19 deletions components/InfoColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { useEffect, useState } from "react";
import { format } from "timeago.js";
import InfoColumnItem from "~/components/InfoColumnItem";
import { Link } from "~/components/Link";
import { BASE_API_URL } from "~/utils/constants";
import { Package, User } from "~/utils/types";

interface Props {
Expand Down Expand Up @@ -78,24 +77,24 @@ export default function InfoColumn(props: Props): JSX.Element {
const { hasCopied, onCopy } = useClipboard(installSnippet);
const [owners, setOwners] = useState<User[]>([]);

useEffect(() => {
fetch(`${BASE_API_URL}/packages/${props.package.name}/owners`)
.then((res) => {
res.json().then((data) => {
const users: User[] = [];
for (const rawUser of data.data) {
users.push({
id: rawUser.id,
name: rawUser.name,
user_name: rawUser.user_name,
avatar_url: rawUser.avatar_url,
});
}
setOwners(users);
});
})
.catch((err) => console.error(err));
}, [props.package.name]);
// useEffect(() => {
// fetch(`${BASE_API_URL}/packages/${props.package.name}/owners`)
// .then((res) => {
// res.json().then((data) => {
// const users: User[] = [];
// for (const rawUser of data.data) {
// users.push({
// id: rawUser.id,
// name: rawUser.name,
// user_name: rawUser.user_name,
// avatar_url: rawUser.avatar_url,
// });
// }
// setOwners(users);
// });
// })
// .catch((err) => console.error(err));
// }, [props.package.name]);

return (
<VStack spacing={5} maxWidth={300} divider={<StackDivider />}>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"prebuild": "yarn generate",
"build": "next build",
"postbuild": "next-sitemap",
"start": "next start",
Expand Down

0 comments on commit 3ceb9cf

Please sign in to comment.