-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): Make all usage of CustomEditor dynamic
- Loading branch information
1 parent
f2d99e9
commit 2dc85dc
Showing
7 changed files
with
61 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use client" | ||
|
||
import dynamic from "next/dynamic" | ||
|
||
import { type CustomEditorProps } from "@/components/editor/editor" | ||
import { CenteredSpinner } from "@/components/loading/spinner" | ||
|
||
let DynamicCustomEditor: React.ComponentType<CustomEditorProps> | ||
if (typeof window !== "undefined") { | ||
DynamicCustomEditor = dynamic(() => import("@/components/editor/editor"), { | ||
ssr: false, | ||
loading: () => <CenteredSpinner />, | ||
}) | ||
} else { | ||
const EmptyEditor = (props: CustomEditorProps) => <></> | ||
EmptyEditor.displayName = "EmptyEditor" | ||
DynamicCustomEditor = EmptyEditor | ||
} | ||
|
||
export { DynamicCustomEditor } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters