Unverified Commit 7cf3c3d2 authored by TodorTotev's avatar TodorTotev Committed by GitHub

Feat/remove redundant imports from examples (#13062)

The issue is related to [12964](https://github.com/zeit/next.js/issues/12964)

Let me know if there are any changes you want me to make.

Affected examples:

**with-glamor
with-graphql-hooks
with-graphql-react
with-grommet
with-http2
with-jest
with-cookie-auth-fauna
with-context-api
with-cerebral
with-aphrodite
with-apollo-and-redux
basic-css
with-carbon-components
amp-first**

I would love to help more, so let me know if there is anything specific I can contribute to.
parent 57815c5f
import React from 'react'
import Layout from '../components/Layout' import Layout from '../components/Layout'
import AmpState from '../components/amp/AmpState' import AmpState from '../components/amp/AmpState'
import AmpScript from '../components/amp/AmpScript' import AmpScript from '../components/amp/AmpScript'
......
import React from 'react'
import Layout from '../components/Layout' import Layout from '../components/Layout'
export const config = { amp: true } export const config = { amp: true }
......
import React from 'react'
import { StyleSheet, css } from 'aphrodite' import { StyleSheet, css } from 'aphrodite'
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
......
import React from 'react'
const Layout = ({ children }) => <div className="layout">{children}</div> const Layout = ({ children }) => <div className="layout">{children}</div>
export default function App({ Component, pageProps }) { export default function App({ Component, pageProps }) {
......
import * as React from 'react' import { useReducer } from 'react'
import { API, graphqlOperation } from 'aws-amplify' import { API, graphqlOperation } from 'aws-amplify'
import nanoid from 'nanoid' import nanoid from 'nanoid'
import produce from 'immer' import produce from 'immer'
...@@ -74,7 +74,7 @@ const deleteToDo = async (dispatch, id) => { ...@@ -74,7 +74,7 @@ const deleteToDo = async (dispatch, id) => {
} }
} }
const App = (props) => { const App = (props) => {
const [state, dispatch] = React.useReducer(reducer, { const [state, dispatch] = useReducer(reducer, {
todos: props.todos, todos: props.todos,
currentName: '', currentName: '',
}) })
......
import * as React from 'react'
import { API, graphqlOperation } from 'aws-amplify' import { API, graphqlOperation } from 'aws-amplify'
import { getTodo } from '../../src/graphql/queries' import { getTodo } from '../../src/graphql/queries'
......
import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document' import Document, { Head, Main, NextScript } from 'next/document'
export default class MyDocument extends Document { export default class MyDocument extends Document {
......
import React from 'react'
import preval from 'preval.macro' import preval from 'preval.macro'
const whoami = preval` const whoami = preval`
......
import React, { Component, Fragment } from 'react' import { Component, Fragment } from 'react'
import { Button } from 'carbon-components-react' import { Button } from 'carbon-components-react'
export default class DemoApp extends Component { export default class DemoApp extends Component {
......
import React from 'react'
import NextApp from 'next/app' import NextApp from 'next/app'
import { ThemeProvider, CSSReset, ColorModeProvider } from '@chakra-ui/core' import { ThemeProvider, CSSReset, ColorModeProvider } from '@chakra-ui/core'
......
import React from 'react'
import { withTheme } from 'emotion-theming' import { withTheme } from 'emotion-theming'
import { import {
Link as ChakraLink, Link as ChakraLink,
......
import React from 'react'
import { theme as chakraTheme } from '@chakra-ui/core' import { theme as chakraTheme } from '@chakra-ui/core'
const fonts = { ...chakraTheme.fonts, mono: `'Menlo', monospace` } const fonts = { ...chakraTheme.fonts, mono: `'Menlo', monospace` }
......
import React from 'react'
import Layout from '../components/layout' import Layout from '../components/layout'
const Home = () => ( const Home = () => (
......
import React, { useState } from 'react' import { useState } from 'react'
import Router from 'next/router' import Router from 'next/router'
import Layout from '../components/layout' import Layout from '../components/layout'
......
import React, { useState } from 'react' import { useState } from 'react'
import Router from 'next/router' import Router from 'next/router'
import Layout from '../components/layout' import Layout from '../components/layout'
......
import React from 'react' import { Component } from 'react'
export default class MyLuckNo extends Component {
export default class MyLuckNo extends React.Component {
constructor(...args) { constructor(...args) {
super(...args) super(...args)
this.state = { randomNo: null } this.state = { randomNo: null }
......
import React from 'react'
import { rehydrate } from 'glamor' import { rehydrate } from 'glamor'
// Adds server generated styles to glamor cache. // Adds server generated styles to glamor cache.
......
import App from 'next/app' import App from 'next/app'
import React from 'react'
import withGraphQLClient from '../lib/with-graphql-client' import withGraphQLClient from '../lib/with-graphql-client'
import { ClientContext } from 'graphql-hooks' import { ClientContext } from 'graphql-hooks'
......
import React from 'react'
import App from 'next/app' import App from 'next/app'
import { Grommet, grommet as grommetTheme } from 'grommet' import { Grommet, grommet as grommetTheme } from 'grommet'
......
import React from 'react'
import { Anchor, Box, Heading, Paragraph } from 'grommet' import { Anchor, Box, Heading, Paragraph } from 'grommet'
export default function Home() { export default function Home() {
......
import React from 'react'
import I18n from '../lib/i18n' import I18n from '../lib/i18n'
export default function MyApp({ Component, pageProps }) { export default function MyApp({ Component, pageProps }) {
......
import Head from 'next/head' import Head from 'next/head'
import React from 'react'
import styles from './index.module.css' import styles from './index.module.css'
const Home = () => ( const Home = () => (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment