diff --git a/package.json b/package.json index 193bd39..eb3d0fa 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "my-app", + "name": "chainlib", "type": "module", "version": "0.1.0", "private": true, @@ -43,6 +43,7 @@ "recharts": "^2.15.3", "sharp": "^0.33.5", "starknet": "^6.23.1", + "starknetkit": "^2.12.1", "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7" }, diff --git a/src/app/author-profile/[authorId]/page.tsx b/src/app/author-profile/[authorId]/page.tsx deleted file mode 100644 index 0028268..0000000 --- a/src/app/author-profile/[authorId]/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -function Page() { - return

Page

; -} - -export default Page; diff --git a/src/app/books/[bookId]/RelatedBooks.tsx b/src/app/author/[bookId]/RelatedBooks.tsx similarity index 100% rename from src/app/books/[bookId]/RelatedBooks.tsx rename to src/app/author/[bookId]/RelatedBooks.tsx diff --git a/src/app/books/[bookId]/page.tsx b/src/app/author/[bookId]/page.tsx similarity index 100% rename from src/app/books/[bookId]/page.tsx rename to src/app/author/[bookId]/page.tsx diff --git a/src/app/author/analytics/page.tsx b/src/app/author/analytics/page.tsx deleted file mode 100644 index 970e76d..0000000 --- a/src/app/author/analytics/page.tsx +++ /dev/null @@ -1,12 +0,0 @@ - - - -function Page(){ - return( -

Page

- ) -} - - - -export default Page; \ No newline at end of file diff --git a/src/app/author/earnings/page.tsx b/src/app/author/earnings/page.tsx deleted file mode 100644 index fb7c9ca..0000000 --- a/src/app/author/earnings/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ - - -function Page(){ - return( -

Page

- ) -} - - - -export default Page; \ No newline at end of file diff --git a/src/app/author/publications/page.tsx b/src/app/author/publications/page.tsx deleted file mode 100644 index fb7c9ca..0000000 --- a/src/app/author/publications/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ - - -function Page(){ - return( -

Page

- ) -} - - - -export default Page; \ No newline at end of file diff --git a/src/app/books/page.tsx b/src/app/books/page.tsx new file mode 100644 index 0000000..c7d3e99 --- /dev/null +++ b/src/app/books/page.tsx @@ -0,0 +1,598 @@ +"use client"; + +import { useState } from "react"; +import Image from "next/image"; +import imgbook from "../../../public/Cover.png"; +import { Star, CheckCircle, ArrowLeft, Share, Heart } from "lucide-react"; +import author from "@/assets/images/author1.png"; +import crypto from "@/assets/icons/strk.png"; +import NavBar from "@/components/landingpage/NavBar"; +import Footer from "@/components/landingpage/Footer"; + +interface BookCard { + id: string; + title: string; + author: string; + price: number; + rating: number; + image: string; + isVerified?: boolean; +} + +interface BookDetails extends BookCard { + description: string; + fullDescription: string; + reviews: number; + genre: string[]; + pageCount: number; + language: string; + datePublished: string; + isbn: string; + publisherDescription: string; + authorBio: string; + authorImage: string; + cryptoPrice: string; +} + +const bookData: BookCard = { + id: "1", + title: "Native Invisibility", + author: "Darrin Collins", + price: 10, + rating: 4.5, + image: "/book-cover.png", + isVerified: true, +}; + +const bookDetails: BookDetails = { + ...bookData, + description: + '"Native Invisibility" delves into the complex and often insidious ways in which indigenous peoples and their unique experiences are rendered unseen and unheard in the modern era.', + fullDescription: + '"Native Invisibility" delves into the complex and often insidious ways in which indigenous peoples and their unique experiences are rendered unseen and unheard in the modern era. This comprehensive exploration examines the systematic marginalization of indigenous voices across various sectors of society, from media representation to political discourse, educational curricula to economic opportunities.', + reviews: 109, + genre: ["Fiction", "Comic"], + pageCount: 21, + language: "English", + datePublished: "12 April, 2025", + isbn: "978-3-16-148410-0", + publisherDescription: + "Native Invisibility unveils the crucial ways indigenous cultures are often unseen in our modern world. This vital book fosters understanding and action for recognition and justice.", + authorBio: + "Darrin Collins is a dedicated researcher and writer deeply committed to exploring issues of cultural visibility, marginalization, and the intersection of identity and technology. His work in Native Invisibility reflects a long-standing interest in amplifying underrepresented voices and fostering a more equitable understanding of diverse experiences in the contemporary world.", + authorImage: "/placeholder.svg?height=60&width=60", + cryptoPrice: "193 STRK", +}; + +const BookDetailsModal = ({ + book, + isOpen, + onClose, +}: { + book: BookDetails; + isOpen: boolean; + onClose: () => void; +}) => { + const [showFullDescription, setShowFullDescription] = useState(false); + + if (!isOpen) return null; + + return ( +
+
+ {/* Header */} +
+ + +
+ +
+
+ {/* Left Column - Book Cover */} +
+
+ {book.title} +
+
+ + {/* Right Column - Book Details */} +
+ {/* Title and Author */} +
+

+ {book.title} +

+
+ By {book.author} + {book.isVerified && ( + + )} +
+
+ + + {book.rating} of {book.reviews} Review + +
+
+ + {/* Description */} +
+

+ Description +

+

+ {showFullDescription + ? book.fullDescription + : book.description} +

+ +
+ + {/* Access Type */} +
+

+ Access Type +

+ + One-time Purchase + +
+ + {/* Price */} +
+ + ${book.price} + + + Crypto Icon + {book.cryptoPrice} + +
+ + {/* Action Buttons */} +
+ + +
+ + +
+
+ + {/* Book Details Grid */} +
+
+

Genre(s)

+

{book.genre.join(", ")}

+
+
+

Page count

+

{book.pageCount} Pages

+
+
+

Language

+

{book.language}

+
+
+

Date published

+

{book.datePublished}

+
+
+

ISBN

+

{book.isbn}

+
+
+ + {/* Publisher and Author Sections */} +
+ {/* From the Publisher */} +
+

+ From the Publisher +

+

{book.publisherDescription}

+
+ + {/* About the Author */} +
+

+ About the Author +

+
+ {book.author} +
+
+ + {book.author} + + {book.isVerified && ( + + )} +
+ +
+
+

{book.authorBio}

+
+
+ + {/* Related Books */} +
+
+
+

+ Related Books +

+

+ People who read this also liked +

+
+ +
+ +
+ {Array.from({ length: 4 }).map((_, index) => ( +
+
+ {book.title} +
+

+ {book.title} +

+
+ + By {book.author} + + {book.isVerified && ( + + )} +
+
+ + ${book.price} + +
+ + + {book.rating} + +
+
+
+ ))} +
+
+ + {/* Books by Author */} +
+
+
+

+ Books by {book.author} +

+

+ Explore other books published by {book.author.split(" ")[0]} +

+
+ +
+ +
+ {Array.from({ length: 4 }).map((_, index) => ( +
+
+ {book.title} +
+

+ {book.title} +

+
+ + By {book.author} + + {book.isVerified && ( + + )} +
+
+ + ${book.price} + +
+ + + {book.rating} + +
+
+
+ ))} +
+
+
+
+
+ ); +}; + +const BookCardComponent = ({ + book, + showNFTBadge = false, +}: { + book: BookCard; + showNFTBadge?: boolean; +}) => { + const [selectedBook, setSelectedBook] = useState(null); + const [isModalOpen, setIsModalOpen] = useState(false); + + const handleBookClick = () => { + setSelectedBook(bookDetails); + setIsModalOpen(true); + }; + + const closeModal = () => { + setIsModalOpen(false); + setSelectedBook(null); + }; + + return ( + <> +
+
+ {book.title} +
+ + {showNFTBadge && ( +
+ + NFT + +
+ )} + +

{book.title}

+ +
+ By {book.author} + {book.isVerified && } +
+ +
+ ${book.price} +
+ + + {book.rating} + +
+
+
+ + {/* Book Details Modal */} + {selectedBook && ( + + )} + + ); +}; + +const PaginationDots = ({ + total = 4, + active = 0, +}: { + total?: number; + active?: number; +}) => ( +
+ {Array.from({ length: total }).map((_, index) => ( +
+ ))} +
+); + +export default function BookMarketplace() { + const [activeTab, setActiveTab] = useState("New Release"); + + const tabs = ["New Release", "Trending", "NFT Edition", "Explore"]; + + return ( + <> + +
+ {/* Navigation Tabs */} +
+
+ {tabs.map((tab) => ( + + ))} +
+
+ + {/* Hero Section */} +
+

+ Dive Into a{" "} + Wide Range of Books Across + Genres +

+
+ +
+ {/* New Release Section */} +
+
+

+ New Release +

+

+ Fresh from the minds of our authors explore the latest books +

+
+ +
+ {Array.from({ length: 8 }).map((_, index) => ( + + ))} +
+
+ + {/* Trending Books Section */} +
+
+

+ Trending Books +

+

+ Discover what everyone's reading right now +

+
+ +
+ {Array.from({ length: 4 }).map((_, index) => ( + + ))} +
+
+ + {/* Exclusive NFT Edition Section */} +
+
+

+ Exclusive NFT Edition +

+

+ Own limited-edition digital books with special perks bonus + content, unique artwork, and collectible value. +

+
+ +
+ {Array.from({ length: 4 }).map((_, index) => ( + + ))} +
+ + +
+ + {/* Explore Books Section */} +
+
+

+ Explore Books +

+

+ Browse diverse genres, discover hidden gems, and find your next + great read. +

+
+ +
+ {Array.from({ length: 8 }).map((_, index) => ( + + ))} +
+
+
+
+ +