aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/registry.tsx
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-04-12 22:14:05 -0700
committerPinapelz <yukais@pinapelz.com>2026-04-12 22:14:05 -0700
commit8cfa334717481bc2fcfa716b546304924157abff (patch)
treec49dc578124991920ebc072be86275b71dee9795 /src/app/registry.tsx
parent851d48fbf341e0f9f5f7d734666822976ab06a0e (diff)
make windows re-sizeable general lint/formatting
Diffstat (limited to 'src/app/registry.tsx')
-rw-r--r--src/app/registry.tsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/app/registry.tsx b/src/app/registry.tsx
new file mode 100644
index 0000000..4a5a4e1
--- /dev/null
+++ b/src/app/registry.tsx
@@ -0,0 +1,26 @@
+"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;
+}) {
+ const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
+
+ useServerInsertedHTML(() => {
+ const styles = styledComponentsStyleSheet.getStyleElement();
+ styledComponentsStyleSheet.instance.clearTag();
+ return <>{styles}</>;
+ });
+
+ if (typeof window !== "undefined") return <>{children}</>;
+
+ return (
+ <StyleSheetManager sheet={styledComponentsStyleSheet.instance}>
+ {children as React.ReactElement}
+ </StyleSheetManager>
+ );
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage