├── next.config.js ├── .babelrc ├── .gitignore ├── public └── assets │ └── footerAdornment.svg ├── README.md ├── package.json ├── src └── ui │ ├── Footer.js │ ├── Link.js │ ├── Header.js │ ├── Theme.js │ └── EnhancedTable.js └── pages ├── _app.js ├── _document.js └── index.js /next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["next/babel"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # misc 7 | .DS_Store 8 | .env.local 9 | .env.development.local 10 | .env.test.local 11 | .env.production.local 12 | 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # Next.js 18 | /.next 19 | -------------------------------------------------------------------------------- /public/assets/footerAdornment.svg: -------------------------------------------------------------------------------- 1 | © Arc Development 2019Wichita, KS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Next.js example 2 | 3 | ## How to use 4 | 5 | Download the example [or clone the repo](https://github.com/mui-org/material-ui): 6 | 7 | ```sh 8 | curl https://codeload.github.com/mui-org/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/nextjs 9 | cd nextjs 10 | ``` 11 | 12 | Install it and run: 13 | 14 | ```sh 15 | npm install 16 | npm run dev 17 | ``` 18 | 19 | ## The idea behind the example 20 | 21 | [Next.js](https://github.com/zeit/next.js) is a framework for server-rendered React apps. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nextjs", 3 | "version": "4.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@date-io/date-fns": "^1.3.13", 7 | "@material-ui/core": "latest", 8 | "@material-ui/icons": "^4.5.1", 9 | "@material-ui/pickers": "^3.2.8", 10 | "@material-ui/styles": "^4.7.1", 11 | "clsx": "latest", 12 | "date-fns": "^2.0.0-beta.5", 13 | "next": "latest", 14 | "prop-types": "latest", 15 | "react": "latest", 16 | "react-dom": "latest" 17 | }, 18 | "scripts": { 19 | "dev": "next", 20 | "build": "next build", 21 | "start": "next start" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/ui/Footer.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { makeStyles } from "@material-ui/core/styles"; 3 | 4 | const useStyles = makeStyles(theme => ({ 5 | footer: { 6 | backgroundColor: theme.palette.common.blue, 7 | width: "100%", 8 | zIndex: 1302, 9 | position: "relative" 10 | }, 11 | adornment: { 12 | width: "25em", 13 | verticalAlign: "bottom", 14 | [theme.breakpoints.down("md")]: { 15 | width: "21em" 16 | }, 17 | [theme.breakpoints.down("xs")]: { 18 | width: "15em" 19 | } 20 | } 21 | })); 22 | 23 | export default function Footer(props) { 24 | const classes = useStyles(); 25 | 26 | return ( 27 | 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import App from "next/app"; 3 | import Head from "next/head"; 4 | import { ThemeProvider } from "@material-ui/core/styles"; 5 | import CssBaseline from "@material-ui/core/CssBaseline"; 6 | import theme from "../src/ui/theme"; 7 | import Header from "../src/ui/Header"; 8 | import Footer from "../src/ui/Footer"; 9 | 10 | export default class MyApp extends App { 11 | componentDidMount() { 12 | // Remove the server-side injected CSS. 13 | const jssStyles = document.querySelector("#jss-server-side"); 14 | if (jssStyles) { 15 | jssStyles.parentElement.removeChild(jssStyles); 16 | } 17 | } 18 | 19 | render() { 20 | const { Component, pageProps } = this.props; 21 | 22 | return ( 23 | 24 | 25 | My page 26 | 27 | 28 | {/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} 29 | 30 |
31 | 32 |