diff --git a/examples/with-material-ui-next/README.md b/examples/with-material-ui-next/README.md index b8dc3519..6745543c 100644 --- a/examples/with-material-ui-next/README.md +++ b/examples/with-material-ui-next/README.md @@ -1,13 +1,13 @@ -[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-material-ui-next) +[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/callemall/material-ui/tree/v1-beta/examples/nextjs) # Material-UI example ## How to use -Download the example [or clone the repo](https://github.com/zeit/next.js): +Download the example [or clone the repo](https://github.com/callemall/material-ui): ```bash -curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-material-ui-next -cd with-material-ui-next +curl https://codeload.github.com/callemall/material-ui/tar.gz/v1-beta | tar -xz --strip=2 material-ui-1-beta/examples/nextjs +cd nextjs ``` Install it and run: @@ -25,5 +25,7 @@ now ## The idea behind the example -[material-ui](https://github.com/callemall/material-ui) is being rewritten from scratch on the [next branch](https://material-ui-1dab0.firebaseapp.com/). This example shows how you use it with Next.js. +[material-ui](https://github.com/callemall/material-ui) is being rewritten from scratch on the [v1-beta branch](https://material-ui-1dab0.firebaseapp.com/). +This example shows how you use it with Next.js. +:warning: The source code [is hosted](https://github.com/callemall/material-ui/tree/v1-beta/examples/nextjs) on the Material-UI repository. diff --git a/examples/with-material-ui-next/components/withRoot.js b/examples/with-material-ui-next/components/withRoot.js deleted file mode 100644 index 0a1282f1..00000000 --- a/examples/with-material-ui-next/components/withRoot.js +++ /dev/null @@ -1,62 +0,0 @@ -import React, { Component } from 'react' -import { JssProvider } from 'react-jss' -import { withStyles, MuiThemeProvider } from 'material-ui/styles' -import { getContext } from '../styles/context' - -// Apply some reset -const styleSheet = theme => ({ - '@global': { - html: { - background: theme.palette.background.default, - WebkitFontSmoothing: 'antialiased', // Antialiasing. - MozOsxFontSmoothing: 'grayscale' // Antialiasing. - }, - body: { - margin: 0 - } - } -}) - -let AppWrapper = props => props.children - -AppWrapper = withStyles(styleSheet)(AppWrapper) - -function withRoot (BaseComponent) { - class WithRoot extends Component { - static getInitialProps (ctx) { - if (BaseComponent.getInitialProps) { - return BaseComponent.getInitialProps(ctx) - } - - return {} - } - - componentDidMount () { - // Remove the server-side injected CSS. - const jssStyles = document.querySelector('#jss-server-side') - if (jssStyles && jssStyles.parentNode) { - jssStyles.parentNode.removeChild(jssStyles) - } - } - - render () { - const context = getContext() - - return ( - - - - - - - - ) - } - } - - WithRoot.displayName = `withRoot(${BaseComponent.displayName})` - - return WithRoot -} - -export default withRoot diff --git a/examples/with-material-ui-next/package.json b/examples/with-material-ui-next/package.json deleted file mode 100644 index bfac72be..00000000 --- a/examples/with-material-ui-next/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "with-material-ui-next", - "version": "1.0.0", - "dependencies": { - "material-ui": "next", - "next": "latest", - "react": "^15.5.4", - "react-dom": "^15.5.4", - "react-jss": "^7.0.2" - }, - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - } -} diff --git a/examples/with-material-ui-next/pages/_document.js b/examples/with-material-ui-next/pages/_document.js deleted file mode 100644 index 61e4570d..00000000 --- a/examples/with-material-ui-next/pages/_document.js +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react' -import Document, { Head, Main, NextScript } from 'next/document' -import { getContext, setContext } from '../styles/context' - -export default class MyDocument extends Document { - static async getInitialProps (ctx) { - // Reset the context for handling a new request. - setContext() - const page = ctx.renderPage() - // Get the context with the collected side effects. - const context = getContext() - return { - ...page, - styles: