Skip to content

Commit

Permalink
mod
Browse files Browse the repository at this point in the history
  • Loading branch information
nouzoehiroaki committed Feb 3, 2024
1 parent abfb827 commit 42eca52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default async function Home() {
<Book
key={book.id}
book={book}
user={user}
isPurchase={purchasesBookIds.includes(book.id)}
/>
))}
Expand Down
11 changes: 7 additions & 4 deletions src/components/layouts/Book/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import { useRouter } from 'next/navigation';
import { useSession } from 'next-auth/react';
import { useState } from 'react';

import type { BookType } from '@/types/types';
import type { BookType, User } from '@/types/types';

type BookProps = {
book: BookType;
isPurchase: boolean;
user: User;
}


// eslint-disable-next-line react/display-name
const Book = ({ book, isPurchase }: BookProps) => {
const Book = ({ book, isPurchase, user }: BookProps) => {
const [showModal, setShowModal] = useState(false);
const { data: session } = useSession();
const user: any = session?.user;

// const { data: session } = useSession();
// const user: any = session?.user;

const router = useRouter();
const startCheckout = async () => {
try {
Expand Down

0 comments on commit 42eca52

Please sign in to comment.