Skip to content

Commit

Permalink
Merge branch 'master' into docs/demos-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajdova committed Oct 25, 2024
2 parents c033e45 + 2359c0b commit 156c128
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ docs/src/pages/components/buttons/

#### 2. Write the demo code

We uses TypeScript to document our components.
We use TypeScript to document our components.
We prefer demos written in TypeScript (using the `.tsx` file format).

After creating a TypeScript demo, run `pnpm docs:typescript:formatted` to automatically create the JavaScript version, which is also required.
Expand Down
13 changes: 6 additions & 7 deletions docs/data/material/integrations/nextjs/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ yarn add @mui/material-nextjs @emotion/cache
Inside `app/layout.tsx`, import the `AppRouterCacheProvider` and wrap all elements under the `<body>` with it:

```diff title="app/layout.tsx"
+import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
+import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
// or `v1X-appRouter` if you are using Next.js v1X

export default function RootLayout(props) {
Expand Down Expand Up @@ -88,8 +88,7 @@ export default theme;
Finally, in `src/app/layout.tsx`, pass the theme to the `ThemeProvider`:

```diff title="app/layout.tsx"
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
+import { Roboto } from 'next/font/google';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
+import { ThemeProvider } from '@mui/material/styles';
+import theme from '../theme';

Expand Down Expand Up @@ -179,7 +178,7 @@ Inside the `pages/_document.tsx` file:
+import {
+ DocumentHeadTags,
+ documentGetInitialProps,
+} from '@mui/material-nextjs/v14-pagesRouter';
+} from '@mui/material-nextjs/v15-pagesRouter';
// or `v1X-pagesRouter` if you are using Next.js v1X

export default function MyDocument(props) {
Expand All @@ -206,7 +205,7 @@ Inside the `pages/_document.tsx` file:
Then, inside `pages/_app.tsx`, import the `AppCacheProvider` component and render it as the root element:

```diff title="pages/_app.tsx"
+import { AppCacheProvider } from '@mui/material-nextjs/v14-pagesRouter';
+import { AppCacheProvider } from '@mui/material-nextjs/v15-pagesRouter';
// Or `v1X-pages` if you are using Next.js v1X

export default function MyApp(props) {
Expand Down Expand Up @@ -311,7 +310,7 @@ MyDocument.getInitialProps = async (ctx) => {
If you are using TypeScript, add `DocumentHeadTagsProps` to the Document's props interface:

```diff
+import type { DocumentHeadTagsProps } from '@mui/material-nextjs/v14-pagesRouter';
+import type { DocumentHeadTagsProps } from '@mui/material-nextjs/v15-pagesRouter';
// or `v1X-pagesRouter` if you are using Next.js v1X

+export default function MyDocument(props: DocumentProps & DocumentHeadTagsProps) {
Expand All @@ -327,7 +326,7 @@ To integrate [Next.js font optimization](https://nextjs.org/docs/pages/building-
import * as React from 'react';
import Head from 'next/head';
import { AppProps } from 'next/app';
import { AppCacheProvider } from '@mui/material-nextjs/v14-pagesRouter';
import { AppCacheProvider } from '@mui/material-nextjs/v15-pagesRouter';
+import { ThemeProvider, createTheme } from '@mui/material/styles';
+import { Roboto } from 'next/font/google';

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@emotion/react": "^11.11.4",
"@emotion/server": "^11.11.0",
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
"next": "^13.0.0 || ^14.0.0",
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-material-nextjs/src/v15-appRouter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../v13-appRouter';
1 change: 1 addition & 0 deletions packages/mui-material-nextjs/src/v15-pagesRouter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../v13-pagesRouter';
2 changes: 1 addition & 1 deletion packages/mui-material/src/AvatarGroup/AvatarGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const AvatarGroup = React.forwardRef(function AvatarGroup(inProps, ref) {
additionalProps: {
variant,
style: {
'--AvatarRoot-spacing': marginValue ? `${marginValue}px` : undefined,
'--AvatarGroup-spacing': marginValue ? `${marginValue}px` : undefined,
...other.style,
},
},
Expand Down
90 changes: 45 additions & 45 deletions pnpm-lock.yaml

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

0 comments on commit 156c128

Please sign in to comment.