Skip to content

Commit

Permalink
Feat/remove redundant imports from examples (#13062)
Browse files Browse the repository at this point in the history
The issue is related to [12964](#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.
  • Loading branch information
todortotev authored May 20, 2020
1 parent 57815c5 commit 7cf3c3d
Show file tree
Hide file tree
Showing 22 changed files with 7 additions and 26 deletions.
1 change: 0 additions & 1 deletion examples/amp-first/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Layout from '../components/Layout'
import AmpState from '../components/amp/AmpState'
import AmpScript from '../components/amp/AmpScript'
Expand Down
1 change: 0 additions & 1 deletion examples/amp-first/pages/offline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Layout from '../components/Layout'

export const config = { amp: true }
Expand Down
1 change: 0 additions & 1 deletion examples/with-aphrodite/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { StyleSheet, css } from 'aphrodite'

if (typeof window !== 'undefined') {
Expand Down
2 changes: 0 additions & 2 deletions examples/with-app-layout/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

const Layout = ({ children }) => <div className="layout">{children}</div>

export default function App({ Component, pageProps }) {
Expand Down
4 changes: 2 additions & 2 deletions examples/with-aws-amplify/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react'
import { useReducer } from 'react'
import { API, graphqlOperation } from 'aws-amplify'
import nanoid from 'nanoid'
import produce from 'immer'
Expand Down Expand Up @@ -74,7 +74,7 @@ const deleteToDo = async (dispatch, id) => {
}
}
const App = (props) => {
const [state, dispatch] = React.useReducer(reducer, {
const [state, dispatch] = useReducer(reducer, {
todos: props.todos,
currentName: '',
})
Expand Down
1 change: 0 additions & 1 deletion examples/with-aws-amplify/pages/todo/[id].js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import { API, graphqlOperation } from 'aws-amplify'

import { getTodo } from '../../src/graphql/queries'
Expand Down
1 change: 0 additions & 1 deletion examples/with-babel-macros/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
Expand Down
1 change: 0 additions & 1 deletion examples/with-babel-macros/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import preval from 'preval.macro'

const whoami = preval`
Expand Down
2 changes: 1 addition & 1 deletion examples/with-carbon-components/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component, Fragment } from 'react'
import { Component, Fragment } from 'react'
import { Button } from 'carbon-components-react'

export default class DemoApp extends Component {
Expand Down
1 change: 0 additions & 1 deletion examples/with-chakra-ui/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import NextApp from 'next/app'
import { ThemeProvider, CSSReset, ColorModeProvider } from '@chakra-ui/core'

Expand Down
1 change: 0 additions & 1 deletion examples/with-chakra-ui/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { withTheme } from 'emotion-theming'
import {
Link as ChakraLink,
Expand Down
1 change: 0 additions & 1 deletion examples/with-chakra-ui/src/theme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { theme as chakraTheme } from '@chakra-ui/core'

const fonts = { ...chakraTheme.fonts, mono: `'Menlo', monospace` }
Expand Down
1 change: 0 additions & 1 deletion examples/with-cookie-auth-fauna/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Layout from '../components/layout'

const Home = () => (
Expand Down
2 changes: 1 addition & 1 deletion examples/with-cookie-auth-fauna/pages/login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import Router from 'next/router'
import Layout from '../components/layout'

Expand Down
2 changes: 1 addition & 1 deletion examples/with-cookie-auth-fauna/pages/signup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import Router from 'next/router'
import Layout from '../components/layout'

Expand Down
5 changes: 2 additions & 3 deletions examples/with-custom-babel-config/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'

export default class MyLuckNo extends React.Component {
import { Component } from 'react'
export default class MyLuckNo extends Component {
constructor(...args) {
super(...args)
this.state = { randomNo: null }
Expand Down
1 change: 0 additions & 1 deletion examples/with-glamor/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { rehydrate } from 'glamor'

// Adds server generated styles to glamor cache.
Expand Down
1 change: 0 additions & 1 deletion examples/with-graphql-hooks/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import App from 'next/app'
import React from 'react'
import withGraphQLClient from '../lib/with-graphql-client'
import { ClientContext } from 'graphql-hooks'

Expand Down
1 change: 0 additions & 1 deletion examples/with-grommet/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import App from 'next/app'
import { Grommet, grommet as grommetTheme } from 'grommet'

Expand Down
1 change: 0 additions & 1 deletion examples/with-grommet/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { Anchor, Box, Heading, Paragraph } from 'grommet'

export default function Home() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-i18n-rosetta/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import I18n from '../lib/i18n'

export default function MyApp({ Component, pageProps }) {
Expand Down
1 change: 0 additions & 1 deletion examples/with-jest/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from 'next/head'
import React from 'react'
import styles from './index.module.css'

const Home = () => (
Expand Down

0 comments on commit 7cf3c3d

Please sign in to comment.