Skip to content
Merged
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
11 changes: 3 additions & 8 deletions apps/web/src/app/(with-side-bar)/topic/[id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
"use client";
import { lazy } from "react";

import dynamic from "next/dynamic";

const TopicStickerDetailModal = dynamic(
() => import("@/components/(with-side-bar)/topic/sticker/topic-sticker-detail-modal"),
{
ssr: false,
}
const TopicStickerDetailModal = lazy(
() => import("@/components/(with-side-bar)/topic/sticker/topic-sticker-detail-modal")
);

interface TopicBoardLayoutProps {
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/components/(with-side-bar)/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { Suspense } from "react";
import dynamic from "next/dynamic";
import Link from "next/link";
import { usePathname } from "next/navigation";
Expand Down Expand Up @@ -95,9 +94,7 @@ export default function Sidebar() {
<div className="text-muted-foreground mb-4 text-sm font-semibold uppercase tracking-wider">
나의 토픽
</div>
<Suspense fallback={<Spinner className="mx-auto" />}>
<RecentTopicList />
</Suspense>
<RecentTopicList />
</div>
</aside>

Expand Down
16 changes: 4 additions & 12 deletions apps/web/src/components/(with-side-bar)/topic/add-content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Suspense, useRef, useState } from "react";
import { useRef, useState } from "react";
import dynamic from "next/dynamic";
import Link from "next/link";

Expand All @@ -20,15 +20,15 @@ const AddContentList = dynamic(() => import("./add-content-list"), {
),
});

interface AddContentListProps {
interface AddContentProps {
type: ContentTypeOptions;
id: string;
}

const MIN_WIDTH = 300;
const MAX_WIDTH = 600;

export default function AddContent({ type, id }: AddContentListProps) {
export default function AddContent({ type, id }: AddContentProps) {
const [contentPanelWidth, setContentPanelWidth] = useState(300); // Content Panel 기본 너비
const [searchQuery, setSearchQuery] = useState("");

Expand Down Expand Up @@ -90,15 +90,7 @@ export default function AddContent({ type, id }: AddContentListProps) {
<Link href={`/topic/${id}?type=${CONTENT_TYPE_OPTIONS.YOUTUBE}`}>유튜브</Link>
</Button>
</div>
<Suspense
fallback={
<div className="flex justify-center py-2">
<Spinner />
</div>
}
>
<AddContentList query={debouncedSearchQuery} id={id} type={type} />
</Suspense>
<AddContentList query={debouncedSearchQuery} id={id} type={type} />
</div>
<ResizeBar onMouseMove={onMouseMove} />
</>
Expand Down