diff --git a/next.config.mjs b/next.config.mjs
index 2ab4c6a..b4f5ba2 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -15,6 +15,9 @@ const nextConfig = {
images: {
domains: ["kr.object.ncloudstorage.com"],
},
+ compiler: {
+ styledComponents: true,
+ },
};
export default withPlugins(
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 9523bb8..c7fb6e2 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -5,8 +5,8 @@ import { theme } from "@/styles/theme";
import { QueryClient, QueryClientProvider } from "react-query";
import { Provider } from "react-redux";
import { store } from "@/redux/store";
-import "./global.css";
-import NOSSR from "@/components/common/NOSSR";
+import StyledJsxRegistry from "./registry";
+import GlobalStyles from "@/styles/GlobalStyles";
const queryClient = new QueryClient();
@@ -23,9 +23,10 @@ export default function RootLayout({
-
- {children}
-
+
+
+ {children}
+
diff --git a/src/app/registry.tsx b/src/app/registry.tsx
new file mode 100644
index 0000000..fa12293
--- /dev/null
+++ b/src/app/registry.tsx
@@ -0,0 +1,29 @@
+"use client";
+
+import React, { useState } from "react";
+import { useServerInsertedHTML } from "next/navigation";
+import { ServerStyleSheet, StyleSheetManager } from "styled-components";
+
+export default function StyledComponentsRegistry({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ // Only create stylesheet once with lazy initial state
+ // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state
+ const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
+
+ useServerInsertedHTML(() => {
+ const styles = styledComponentsStyleSheet.getStyleElement();
+ styledComponentsStyleSheet.instance.clearTag();
+ return <>{styles}>;
+ });
+
+ if (typeof window !== "undefined") return <>{children}>;
+
+ return (
+
+ {children}
+
+ );
+}
diff --git a/src/components/common/NOSSR.tsx b/src/components/common/NOSSR.tsx
deleted file mode 100644
index 818e60d..0000000
--- a/src/components/common/NOSSR.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import dynamic from "next/dynamic";
-import React from "react";
-
-const NOSSR: React.FC = (props) => (
- <>{props.children}>
-);
-
-export default dynamic(() => Promise.resolve(NOSSR), {
- ssr: false,
-});
diff --git a/src/stories/Configure.mdx b/src/stories/Configure.mdx
deleted file mode 100644
index 055a3c5..0000000
--- a/src/stories/Configure.mdx
+++ /dev/null
@@ -1,446 +0,0 @@
-import { Meta } from "@storybook/blocks";
-import Image from "next/image";
-
-import Github from "./assets/github.svg";
-import Discord from "./assets/discord.svg";
-import Youtube from "./assets/youtube.svg";
-import Tutorials from "./assets/tutorials.svg";
-import Styling from "./assets/styling.png";
-import Context from "./assets/context.png";
-import Assets from "./assets/assets.png";
-import Docs from "./assets/docs.png";
-import Share from "./assets/share.png";
-import FigmaPlugin from "./assets/figma-plugin.png";
-import Testing from "./assets/testing.png";
-import Accessibility from "./assets/accessibility.png";
-import Theming from "./assets/theming.png";
-import AddonLibrary from "./assets/addon-library.png";
-
-export const RightArrow = () =>
-
-
-
-
-
- # Configure your project
-
- Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
-
-
-
-
-
Add styling and CSS
-
Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.
To link static files (like fonts) to your projects and stories, use the
- `staticDirs` configuration option to specify folders to load when
- starting Storybook.
- # Do more with Storybook
-
- Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
-
-
-
-
-
-
-
Autodocs
-
Auto-generate living,
- interactive reference documentation from your components and stories.