diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c3bf7a3..826dbbd 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,4 +6,3 @@ - [x] ... - [ ] ... - diff --git a/README.md b/README.md index f0a19bc..827dd22 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ ## Copilot profile manager - diff --git a/next.config.js b/next.config.js index 658404a..9377308 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,13 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + webpack(config) { + config.module.rules.push({ + test: /\.svg$/i, + issuer: /\.[jt]sx?$/, + use: ['@svgr/webpack'], + }); + return config; + }, +}; module.exports = nextConfig; diff --git a/package.json b/package.json index 4f54a65..46ff062 100644 --- a/package.json +++ b/package.json @@ -18,18 +18,25 @@ "postinstall": "prisma generate" }, "dependencies": { + "@emotion/react": "^11.11.3", + "@emotion/styled": "^11.11.0", + "@mui/icons-material": "^5.14.5", + "@mui/material": "^5.15.4", "@prisma/client": "^5.7.1", "@vercel/postgres": "^0.5.1", "copilot-node-sdk": "^0.0.45", - "next": "14.0.4", + "ag-grid-react": "^31.0.2", + "next": "14.1.0", "prisma": "^5.7.1", "react": "^18", "react-dom": "^18", "zod": "^3.22.4" }, "devDependencies": { + "@svgr/webpack": "^8.1.0", "@types/node": "^20", "@types/react": "^18", + "@types/react-custom-scrollbars": "^4.0.13", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "eslint": "^8", @@ -38,7 +45,6 @@ "lint-staged": "^15.2.0", "postcss": "^8", "prettier": "^3.1.1", - "tailwindcss": "^3.3.0", "typescript": "^5" }, "lint-staged": { diff --git a/postcss.config.js b/postcss.config.js index 12a703d..a47ef4f 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,5 @@ module.exports = { plugins: { - tailwindcss: {}, autoprefixer: {}, }, }; diff --git a/src/app/ThemeRegistry.tsx b/src/app/ThemeRegistry.tsx new file mode 100644 index 0000000..9d35922 --- /dev/null +++ b/src/app/ThemeRegistry.tsx @@ -0,0 +1,61 @@ +'use client'; +import createCache from '@emotion/cache'; +import { useServerInsertedHTML } from 'next/navigation'; +import { CacheProvider } from '@emotion/react'; +import { ThemeProvider } from '@mui/material/styles'; +import CssBaseline from '@mui/material/CssBaseline'; +import { theme } from '@/theme/theme'; +import React from 'react'; + +export default function ThemeRegistry(props: any) { + const { options, children } = props; + + const [{ cache, flush }] = React.useState(() => { + const cache = createCache(options); + cache.compat = true; + const prevInsert = cache.insert; + let inserted: string[] = []; + cache.insert = (...args) => { + const serialized = args[1]; + if (cache.inserted[serialized.name] === undefined) { + inserted.push(serialized.name); + } + return prevInsert(...args); + }; + const flush = () => { + const prevInserted = inserted; + inserted = []; + return prevInserted; + }; + return { cache, flush }; + }); + + useServerInsertedHTML(() => { + const names = flush(); + if (names.length === 0) { + return null; + } + let styles = ''; + for (const name of names) { + styles += cache.inserted[name]; + } + return ( +