Skip to content

Commit

Permalink
fix: ssr className mismatch issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyaaa committed Oct 6, 2024
1 parent ad2d579 commit 74dc3c1
Show file tree
Hide file tree
Showing 37 changed files with 12,087 additions and 21,000 deletions.
3 changes: 0 additions & 3 deletions apps/react-nextjs-example/.eslintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions apps/react-nextjs-example/postcss.config.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/react-nextjs-example/public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion apps/react-nextjs-example/public/vercel.svg

This file was deleted.

51 changes: 0 additions & 51 deletions apps/react-nextjs-example/src/components/error-boundary.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions apps/react-nextjs-example/src/components/layout.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions apps/react-nextjs-example/src/pages/_app.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions apps/react-nextjs-example/src/pages/_document.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions apps/react-nextjs-example/src/pages/index.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions apps/react-nextjs-example/src/pages/settings.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions apps/react-nextjs-example/src/styles/globals.css

This file was deleted.

2 changes: 0 additions & 2 deletions apps/react-nextjs-example/src/styles/index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/react-nextjs-example/src/styles/overrides.ts

This file was deleted.

25 changes: 0 additions & 25 deletions apps/react-nextjs-example/src/styles/theme-defs.ts

This file was deleted.

3 changes: 3 additions & 0 deletions apps/react-nextjs-pages-router/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-nextjs-example",
"name": "react-nextjs-pages-router",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -9,21 +9,19 @@
"lint": "next lint"
},
"dependencies": {
"@interchain-ui/react": "link:../../packages/react",
"clsx": "^2.1.0",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18"
"react-dom": "^18",
"next": "14.2.13",
"@interchain-ui/react": "workspace:*"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "14.2.13"
}
}
8 changes: 8 additions & 0 deletions apps/react-nextjs-pages-router/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;
26 changes: 26 additions & 0 deletions apps/react-nextjs-pages-router/public/cosmology.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions apps/react-nextjs-pages-router/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import "@/styles/globals.css";
import "@interchain-ui/react/styles";
import clsx from "clsx";
import { ThemeProvider, Box, IconButton, useTheme } from "@interchain-ui/react";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
const { theme, themeClass, setTheme } = useTheme();

return (
<ThemeProvider>
<div className={clsx("app", themeClass)}>
<Box
position="relative"
backgroundColor={theme == "dark" ? "$gray700" : "$white"}
>
<Component {...pageProps} />

<Box position="absolute" top="$4" right="$6">
<IconButton
variant="ghost"
intent="secondary"
size="sm"
icon={theme === "dark" ? "sunLine" : "moonLine"}
onClick={() => {
if (theme === "light") {
return setTheme("dark");
}
return setTheme("light");
}}
/>
</Box>
</Box>
</div>
</ThemeProvider>
);
}
Loading

0 comments on commit 74dc3c1

Please sign in to comment.