Skip to content
Open
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
9 changes: 6 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/svgs/cast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/currency.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/svgs/eth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions public/svgs/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
// basic util svg
export { default as copy } from "./copy.svg";
export { default as control } from "./control.svg";
export { default as arrowLeft } from "./arrowLeft.svg";
export { default as cast } from "./cast.svg";
export { default as chat } from "./chat.svg";
export { default as control } from "./control.svg";
export { default as copy } from "./copy.svg";
export { default as currency } from "./currency.svg";
export { default as eth } from "./eth.svg";
export { default as history } from "./history.svg";
export { default as loader } from "./loader.svg";
export { default as nvir } from "./nvir.svg";
export { default as outLink } from "./outLink.svg";
export { default as star } from "./star.svg";
export { default as wallet } from "./wallet.svg";
19 changes: 19 additions & 0 deletions public/svgs/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions public/svgs/nvir.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/svgs/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/wallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 5 additions & 9 deletions src/app/RootStyleRegistry.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
"use client";
import { useState, type PropsWithChildren } from "react";
import { useServerInsertedHTML } from "next/navigation";
import { createCache, extractStyle, StyleProvider } from "@ant-design/cssinjs";
import { useServerInsertedHTML } from "next/navigation";
import { useState, type PropsWithChildren } from "react";

export const RootStyleRegistry = ({ children }: PropsWithChildren) => {
const [cache] = useState(() => createCache());

useServerInsertedHTML(() => {
return (
<script
dangerouslySetInnerHTML={{
__html: `</script>${extractStyle(cache)}<script>`,
}}
/>
);
// Ensure extracted styles are safely inserted as HTML to prevent XSS issues
const extractedStyle = extractStyle(cache);
return <style dangerouslySetInnerHTML={{ __html: extractedStyle }} />;
});

return <StyleProvider cache={cache}>{children}</StyleProvider>;
Expand Down
Loading