Skip to content

Commit 6b83033

Browse files
authored
Merge pull request #7 from NERDDAO/fix/fix-1
hyperblogs
2 parents 1e1c608 + d5f14d2 commit 6b83033

File tree

2 files changed

+40
-28
lines changed

2 files changed

+40
-28
lines changed

packages/nextjs/app/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useEffect, useState } from "react";
44
import Link from "next/link";
55
import { HyperBlogFeed } from "@/components/HyperBlogFeed";
66
import { WhatIsHyperBlogsModal } from "@/components/WhatIsHyperBlogsModal";
7-
import { ConnectButton } from "@rainbow-me/rainbowkit";
87
import type { NextPage } from "next";
98
import { ClockIcon, CurrencyDollarIcon, SparklesIcon } from "@heroicons/react/24/outline";
109

@@ -35,8 +34,7 @@ const Home: NextPage = () => {
3534
</p>
3635
</div>
3736

38-
<div className="flex flex-col sm:flex-row justify-center items-center gap-6">
39-
<ConnectButton />
37+
<div className="flex justify-center items-center">
4038
<button
4139
className="btn btn-ghost btn-sm text-base-content/60 hover:text-primary hover:bg-transparent"
4240
onClick={() => setIsInfoModalOpen(true)}

packages/nextjs/components/HyperBlogDetail.tsx

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { useCallback, useEffect, useRef, useState } from "react";
44
import Image from "next/image";
5+
import Link from "next/link";
56
import { MarkdownRenderer } from "./MarkdownRenderer";
67
import { HyperBlogInfo } from "@/lib/types/delve-api";
78
import { calculateReadingTime } from "@/lib/utils";
@@ -609,35 +610,34 @@ export const HyperBlogDetail = ({ blog, onBack, showBackButton = true, initialSe
609610
)}
610611

611612
{/* Main Content Area */}
612-
<div className="flex-1 overflow-hidden flex flex-col lg:flex-row relative max-w-full">
613+
<div className="flex-1 flex flex-col lg:flex-row relative max-w-full">
613614
{/* Table of Contents Sidebar */}
614615
{currentBlog.blog_content?.sections && (
615616
<>
616617
{/* Desktop TOC */}
617-
<div
618-
ref={tocRef}
619-
className="hidden lg:block lg:w-64 lg:border-r lg:border-base-300 lg:overflow-y-auto lg:h-[calc(100vh-100px)] sticky top-[80px] z-10"
620-
>
621-
<div className="p-4">
622-
<h4 className="text-sm font-semibold uppercase tracking-wide opacity-70 mb-3">Table of Contents</h4>
623-
<nav className="space-y-1">
624-
{currentBlog.blog_content.sections
625-
.sort((a, b) => a.order - b.order)
626-
.map((section, index) => (
627-
<button
628-
key={section.htn_node_id}
629-
onClick={() => handleScrollToSection(section.htn_node_id)}
630-
className={`toc-item w-full text-left text-sm py-2 px-4 rounded transition-all min-h-[44px] flex items-center gap-2 focus:ring-2 focus:ring-primary focus:outline-none ${
631-
activeSection === section.htn_node_id
632-
? "toc-item active bg-base-200 border-l-4 border-primary font-semibold"
633-
: "border-l-4 border-transparent hover:bg-base-200"
634-
}`}
635-
>
636-
<span className="text-xs opacity-60 flex-shrink-0">{index + 1}.</span>
637-
<span className="flex-1 line-clamp-2">{section.title}</span>
638-
</button>
639-
))}
640-
</nav>
618+
<div ref={tocRef} className="hidden lg:block lg:w-64 lg:flex-shrink-0">
619+
<div className="fixed top-[140px] w-64 h-[calc(100vh-160px)] overflow-y-auto border-r border-base-300 bg-base-100 z-10">
620+
<div className="p-4">
621+
<h4 className="text-sm font-semibold uppercase tracking-wide opacity-70 mb-3">Table of Contents</h4>
622+
<nav className="space-y-1">
623+
{currentBlog.blog_content.sections
624+
.sort((a, b) => a.order - b.order)
625+
.map((section, index) => (
626+
<button
627+
key={section.htn_node_id}
628+
onClick={() => handleScrollToSection(section.htn_node_id)}
629+
className={`toc-item w-full text-left text-sm py-2 px-4 rounded transition-all min-h-[44px] flex items-center gap-2 focus:ring-2 focus:ring-primary focus:outline-none ${
630+
activeSection === section.htn_node_id
631+
? "toc-item active bg-base-200 border-l-4 border-primary font-semibold"
632+
: "border-l-4 border-transparent hover:bg-base-200"
633+
}`}
634+
>
635+
<span className="text-xs opacity-60 flex-shrink-0">{index + 1}.</span>
636+
<span className="flex-1 line-clamp-2">{section.title}</span>
637+
</button>
638+
))}
639+
</nav>
640+
</div>
641641
</div>
642642
</div>
643643

@@ -924,6 +924,20 @@ export const HyperBlogDetail = ({ blog, onBack, showBackButton = true, initialSe
924924
</span>
925925
</div>
926926
</div>
927+
<div className="bg-base-50 rounded-lg p-3">
928+
<Link
929+
href={`/data-rooms/${currentBlog.dataroom_id}`}
930+
className="flex items-center gap-2 text-sm hover:text-primary transition-colors group"
931+
title="Visit this DataRoom to create your own HyperBlog"
932+
>
933+
<span className="text-base">🗂️</span>
934+
<span className="truncate">
935+
<strong>DataRoom:</strong>{" "}
936+
{currentBlog.dataroom_description || truncateAddress(currentBlog.dataroom_id, 8)}
937+
</span>
938+
<ExternalLink className="w-3 h-3 opacity-0 group-hover:opacity-60 transition-opacity" />
939+
</Link>
940+
</div>
927941
<div className="bg-base-50 rounded-lg p-3">
928942
<div className="flex items-center gap-2 text-sm">
929943
<Calendar className="w-4 h-4 opacity-60" />

0 commit comments

Comments
 (0)