From dbe28e1471d381a517c236d2c6c07e56542cf406 Mon Sep 17 00:00:00 2001 From: Jerome Fitzgerald Date: Mon, 21 May 2018 16:14:31 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=EF=B8=8FRestructure=20`with-materi?= =?UTF-8?q?al-ui`=20per=20#4439=20(#4444)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restructure with-material-ui (patch) --- examples/with-material-ui-next/README.md | 46 ----------- examples/with-material-ui/README.md | 11 +-- examples/with-material-ui/next.config.js | 11 --- examples/with-material-ui/package.json | 16 ---- examples/with-material-ui/pages/index.js | 98 ------------------------ 5 files changed, 6 insertions(+), 176 deletions(-) delete mode 100644 examples/with-material-ui-next/README.md delete mode 100644 examples/with-material-ui/next.config.js delete mode 100644 examples/with-material-ui/package.json delete mode 100644 examples/with-material-ui/pages/index.js diff --git a/examples/with-material-ui-next/README.md b/examples/with-material-ui-next/README.md deleted file mode 100644 index 03417995..00000000 --- a/examples/with-material-ui-next/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/mui-org/material-ui/tree/v1-beta/examples/nextjs) -# Material-UI example - -## How to use - -### Using `create-next-app` - -Execute [`create-next-app`](https://github.com/segmentio/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: - -```bash -npx create-next-app --example with-material-ui-next with-material-ui-next-app -# or -yarn create next-app --example with-material-ui-next with-material-ui-next-app -``` - -### Download manually - -Download the example [or clone the repo](https://github.com/mui-org/material-ui): - -```bash -curl https://codeload.github.com/mui-org/material-ui/tar.gz/v1-beta | tar -xz --strip=2 material-ui-1-beta/examples/nextjs -cd nextjs -``` - -Install it and run: - -```bash -npm install -npm run dev -# or -yarn -yarn dev -``` - -Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download)) - -```bash -now -``` - -## The idea behind the example - -[material-ui](https://github.com/mui-org/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/mui-org/material-ui/tree/v1-beta/examples/nextjs) on the Material-UI repository. diff --git a/examples/with-material-ui/README.md b/examples/with-material-ui/README.md index 2b6f9a8d..212dac5e 100644 --- a/examples/with-material-ui/README.md +++ b/examples/with-material-ui/README.md @@ -1,4 +1,4 @@ -[![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) +[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/mui-org/material-ui/tree/master/examples/nextjs) # Material-UI example ## How to use @@ -15,11 +15,11 @@ yarn create next-app --example with-material-ui with-material-ui-app ### Download manually -Download the example [or clone the repo](https://github.com/zeit/next.js): +Download the example [or clone the repo](https://github.com/mui-org/material-ui): ```bash -curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-material-ui -cd with-material-ui +curl https://codeload.github.com/mui-org/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/nextjs +cd nextjs ``` Install it and run: @@ -40,5 +40,6 @@ now ## The idea behind the example -This example features how you use [material-ui](https://github.com/callemall/material-ui) (Material components that implement Google's Material Design) with Next.js. +This example features how you use [material-ui](https://github.com/mui-org/material-ui) (Material components that implement Google's Material Design) with Next.js. +:warning: The source code [is hosted](https://github.com/mui-org/material-ui/tree/master/examples/nextjs) on the Material-UI repository. diff --git a/examples/with-material-ui/next.config.js b/examples/with-material-ui/next.config.js deleted file mode 100644 index 1270adda..00000000 --- a/examples/with-material-ui/next.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - webpack: (config) => { - // Remove minifed react aliases for material-ui so production builds work - if (config.resolve.alias) { - delete config.resolve.alias.react - delete config.resolve.alias['react-dom'] - } - - return config - } -} diff --git a/examples/with-material-ui/package.json b/examples/with-material-ui/package.json deleted file mode 100644 index 6972a047..00000000 --- a/examples/with-material-ui/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "with-material-ui", - "version": "1.0.0", - "dependencies": { - "material-ui": "^0.18.0", - "next": "latest", - "react": "^15.5.4", - "react-dom": "^15.5.4", - "react-tap-event-plugin": "^2.0.1" - }, - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - } -} diff --git a/examples/with-material-ui/pages/index.js b/examples/with-material-ui/pages/index.js deleted file mode 100644 index 3f9a6be5..00000000 --- a/examples/with-material-ui/pages/index.js +++ /dev/null @@ -1,98 +0,0 @@ -import React, {Component} from 'react' -import RaisedButton from 'material-ui/RaisedButton' -import Dialog from 'material-ui/Dialog' -import {deepOrange500} from 'material-ui/styles/colors' -import FlatButton from 'material-ui/FlatButton' -import getMuiTheme from 'material-ui/styles/getMuiTheme' -import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' -import injectTapEventPlugin from 'react-tap-event-plugin' - -// Make sure react-tap-event-plugin only gets injected once -// Needed for material-ui -if (!process.tapEventInjected) { - injectTapEventPlugin() - process.tapEventInjected = true -} - -const styles = { - container: { - textAlign: 'center', - paddingTop: 200 - } -} - -const muiTheme = { - palette: { - accent1Color: deepOrange500 - } -} - -class Index extends Component { - static getInitialProps ({ req }) { - // Ensures material-ui renders the correct css prefixes server-side - let userAgent - if (process.browser) { - userAgent = navigator.userAgent - } else { - userAgent = req.headers['user-agent'] - } - - return { userAgent } - } - - constructor (props, context) { - super(props, context) - - this.state = { - open: false - } - } - - handleRequestClose = () => { - this.setState({ - open: false - }) - } - - handleTouchTap = () => { - this.setState({ - open: true - }) - } - - render () { - const { userAgent } = this.props - - const standardActions = ( - - ) - - return ( - -
- - 1-2-3-4-5 - -

Material-UI

-

example project

- -
-
- ) - } -} - -export default Index