Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/author1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions public/author1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/headerEllipse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/ImageLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/author1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/footerimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/owners.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/starknet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions src/app/_components/BookCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { cn } from "@/lib/utils";
import Image from "next/image";

type BookCardProps = {
id?: string | number
title: string;
author: string;
price: string | number;
imageUrl: string;
rating: string | number;
verified?: boolean;
nft?: boolean;
};

export default function BookCard({ book, className }: { className?: string, book: BookCardProps }) {
const { imageUrl, title, author, price, rating, verified, nft } = book

return <div className={cn(className, "rounded-base overflow-hidden md:shadow-small border border-neutral-100 p-6 pt-8 min-w-54")}>
<div className="relative flex mx-auto justify-center items-center size-44 md:size-36 bg-transparent mb-8">
<Image
src={imageUrl}
alt={title}
fill
className="object-fill object-center size-4/5"
/>
{nft && (
<div className="absolute bottom-2 left-2 bg-purple-200 rounded-3xl mt-5 w-6 h-6 flex items-center justify-center">
<span className="text-xs text-purple-800">NFT</span>
</div>
)}
</div>
<h3 className="font-semibold text-gray-800">{title}</h3>
<div className="flex items-center">
<p className="text-sm text-gray-600">By {author}</p>
{verified && (
<div className="ml-1">
<Image
src="/verified.svg"
alt="Verified Author"
width={16}
height={16}
/>
</div>
)}
</div>
<div className="flex justify-between items-center mt-2">
<p className="font-bold text-gray-900">${price}</p>
<div className="flex items-center">
<span className="text-yellow-500 mr-1">β˜…</span>
<span className="text-sm text-gray-600">{rating}</span>
</div>
</div>
</div>
}
28 changes: 28 additions & 0 deletions src/app/_components/CustomLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client"

import { usePathname, useRouter } from 'next/navigation'
import React, { ReactNode } from 'react'

export default function CustomLink({ children, classname, route }: { route: string, classname: string, children: ReactNode }) {

const navigate = useRouter()
const pathname = usePathname()
const presentPath = pathname.split("/").at(-1)


const handleClick = () => {
if (!presentPath) return

if (pathname.split("/").length === 3) {
navigate.push(pathname + "/" + route)
} else {
navigate.push(pathname.replace(presentPath, route))
}
}

return (
<button onClick={handleClick} className={classname}>
{children}
</button>
)
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import Logo from "@/app/_components/Logo";
import Link from "next/link";
import { BiLogoLinkedin, BiLogoTelegram } from "react-icons/bi";
import { FaXTwitter } from "react-icons/fa6";
import Logo from "./Logo";

export interface IFooterLinks {
link: string;
href: string;
}

const FooterLink: IFooterLinks[] = [
{ link: "Explore", href: "/explore" },
{ link: "Home", href: "/" },
{ link: "Books", href: "/books" },
{ link: "How It Works", href: "/how-it-works" },
{ link: "About", href: "/about-us" },
{ link: "Legal", href: "/legal" },
{ link: "Privacy Policy", href: "/privacy-policy" },
{ link: "Terms Of Service", href: "/terms-of-service" },
];
Expand Down Expand Up @@ -43,8 +41,15 @@ export default function Footer() {
</div>
</div>

<div className="grid grid-rows-5 grid-flow-col gap-y-2 gap-x-18.5 place-content-start">
{FooterLink.map(({ link, href }, index) => <Link className="hover:opacity-75 opacity-100 whitespace-nowrap text-neutral-600 text-body-large cursor-pointer" key={index} href={href}>{link}</Link>)}
<div className="text-body-large">
<div className="grid grid-cols-2 gap-x-12.5 mb-3 items-start justify-start">
<h3 className="font-bold text-secondary-500 ">Explore</h3>
<h3 className="font-bold text-secondary-500 ">Legal</h3>
</div>
<ul className="grid grid-rows-4 grid-flow-col gap-y-2 gap-x-18.5 place-content-start">
{FooterLink.map(({ link, href }, index) => <li key={index} >
<Link className="hover:opacity-75 opacity-100 whitespace-nowrap text-neutral-600 cursor-pointer" href={href}>{link}</Link></li>)}
</ul>
</div>

<div className="space-y-4 md:hidden">
Expand Down
39 changes: 39 additions & 0 deletions src/app/_components/LazyLoadText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { useState, useEffect, useRef } from "react";

interface LazyLoadTextProps {
text: string;
}

export default function LazyLoadText({ text }: LazyLoadTextProps) {
const [isVisible, setIsVisible] = useState(false);
const textRef = useRef<HTMLDivElement | null>(null);

useEffect(() => {
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setIsVisible(true);
observer.disconnect();
}
});

if (textRef.current) {
observer.observe(textRef.current);
}

return () => {
if (observer) observer.disconnect();
};
}, []);

return (
<div ref={textRef} className="min-h-[100px]">
{isVisible ? (
<p className="text-gray-700 leading-relaxed">{text}</p>
) : (
<p className="text-gray-400" aria-live="polite">
Loading review...
</p>
)}
</div>
);
}
5 changes: 5 additions & 0 deletions src/app/_components/Loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function Loader() {
return (
<div className="rounded-full border-3 border-background size-6 animate-spin duration-300 ease-linear border-t-transparent" />
)
}
Loading
Loading