Skip to content

Commit

Permalink
format: sort-imports in src/ js files
Browse files Browse the repository at this point in the history
for #789
  • Loading branch information
jorgeorpinel committed Dec 27, 2019
1 parent 5726ac9 commit b633778
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 114 deletions.
9 changes: 5 additions & 4 deletions src/Diagram/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* eslint jsx-a11y/anchor-is-valid: off */

import React, { Component } from 'react'
import PropTypes from 'prop-types'
import NextLink from 'next/link'
import styled from 'styled-components'
import {
OnlyDesktop,
OnlyMobile,
Expand All @@ -12,8 +8,13 @@ import {
container,
media
} from '../styles'
import React, { Component } from 'react'

import { Element } from 'react-scroll'
import NextLink from 'next/link'
import PropTypes from 'prop-types'
import Slider from 'react-slick'
import styled from 'styled-components'

const LearnMore = ({ href }) => (
<LearnMoreArea>
Expand Down
3 changes: 1 addition & 2 deletions src/Documentation/HeadInjector.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Head from 'next/head'
import { META_BASE_TITLE } from '../consts'
import PropTypes from 'prop-types'
import React from 'react'

import { META_BASE_TITLE } from '../consts'

export const HeadInjector = ({ sectionName = 'Documentation' }) => (
<Head>
<title>
Expand Down
37 changes: 16 additions & 21 deletions src/Documentation/Markdown/Markdown.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import React from 'react'
import PropTypes from 'prop-types'
import Collapsible from 'react-collapsible'
import { LightButton } from '../LightButton'
import NextLink from 'next/link'
import Router from 'next/router'
// components
import { PAGE_DOC } from '../../consts'
import PropTypes from 'prop-types'
import React from 'react'
import ReactMarkdown from 'react-markdown'
import { LightButton } from '../LightButton'
import Tutorials from '../Tutorials'
import Tooltip from '../../Tooltip'
import Collapsible from 'react-collapsible'
// syntax highlighter
import Router from 'next/router'
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
import { docco } from 'react-syntax-highlighter/dist/cjs/styles/hljs'
import python from 'react-syntax-highlighter/dist/cjs/languages/hljs/python'
import yaml from 'react-syntax-highlighter/dist/cjs/languages/hljs/yaml'
import ini from 'react-syntax-highlighter/dist/cjs/languages/hljs/ini'
import Tooltip from '../../Tooltip'
import Tutorials from '../Tutorials'
import bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash'
import diff from 'react-syntax-highlighter/dist/cjs/languages/hljs/diff'
import vim from 'react-syntax-highlighter/dist/cjs/languages/hljs/vim'
import usage from './lang/usage'
import { docco } from 'react-syntax-highlighter/dist/cjs/styles/hljs'
import dvc from './lang/dvc'
import linker from './utils/remark-linker'
// consts
import { PAGE_DOC } from '../../consts'
// utils
import ini from 'react-syntax-highlighter/dist/cjs/languages/hljs/ini'
import kebabCase from 'lodash.kebabcase'
// styles
import styled from 'styled-components'
import linker from './utils/remark-linker'
import { media } from '../../../src/styles'
import python from 'react-syntax-highlighter/dist/cjs/languages/hljs/python'
import styled from 'styled-components'
import usage from './lang/usage'
import vim from 'react-syntax-highlighter/dist/cjs/languages/hljs/vim'
import yaml from 'react-syntax-highlighter/dist/cjs/languages/hljs/yaml'

SyntaxHighlighter.registerLanguage('dvc', dvc)
SyntaxHighlighter.registerLanguage('python', python)
Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/Markdown/utils/remark-linker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;`use strict`

import visit from 'unist-util-visit'
import { getItemByPath } from '../../../utils/sidebar'
import visit from 'unist-util-visit'

const DVC_REGEXP = /dvc\s+[a-z][a-z-.]*/
const COMMAND_REGEXP = /^[a-z][a-z-]*$/
Expand Down
7 changes: 3 additions & 4 deletions src/Documentation/RightPanel/RightPanel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { LightButton } from '../LightButton'
import PropTypes from 'prop-types'
import React from 'react'
import Tutorials from '../Tutorials'
// utils
import styled from 'styled-components'
import throttle from 'lodash.throttle'

const ROOT_ELEMENT = 'bodybag'
Expand Down
18 changes: 7 additions & 11 deletions src/Documentation/SidebarMenu/SidebarMenu.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { OnlyDesktop, media } from '../../styles'
import React, { useEffect, useRef, useState } from 'react'
import PerfectScrollbar from 'perfect-scrollbar'
import scrollIntoView from 'dom-scroll-into-view'
import PropTypes from 'prop-types'

import DownloadButton from '../../DownloadButton'
import NextLink from 'next/link'
// consts
import { PAGE_DOC } from '../../consts'
// components
import DownloadButton from '../../DownloadButton'
// utils
import PerfectScrollbar from 'perfect-scrollbar'
import PropTypes from 'prop-types'
import { getParentsListFromPath } from '../../utils/sidebar'
import includes from 'lodash.includes'
// styles
import scrollIntoView from 'dom-scroll-into-view'
import styled from 'styled-components'
import { OnlyDesktop, media } from '../../styles'
// sidebar helpers
import { getParentsListFromPath } from '../../utils/sidebar'

/** Height of each menu child items (to calc Element weight for animations) */
const heightMap = {}
Expand Down
7 changes: 3 additions & 4 deletions src/Documentation/Tutorials.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react'
import { LightButton } from './LightButton'
import PropTypes from 'prop-types'
import topairs from 'lodash.topairs'
import React from 'react'
import startCase from 'lodash.startcase'
import styled from 'styled-components'

import { LightButton } from './LightButton'
import topairs from 'lodash.topairs'

export default function Tutorials({ compact, tutorials }) {
const tutorialsData = topairs(tutorials)
Expand Down
2 changes: 1 addition & 1 deletion src/DownloadButton/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styled, { css } from 'styled-components'

import PropTypes from 'prop-types'
import isClient from '../utils/isClient'
import { logEvent } from '../utils/ga'

Expand Down
7 changes: 4 additions & 3 deletions src/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react'
import { columns, container, media } from '../styles'

import NextLink from 'next/link'
import PropTypes from 'prop-types'
import React from 'react'
import styled from 'styled-components'
import NextLink from 'next/link'
import { columns, container, media } from '../styles'

const SocialLink = ({ src, href, children }) => (
<Link src={src} href={href}>
Expand Down
4 changes: 2 additions & 2 deletions src/Hamburger/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
import React from 'react'
import styled from 'styled-components'

const WIDTH = 30
Expand Down Expand Up @@ -55,7 +55,7 @@ const Line = styled.div`
props.open &&
props.third &&
`
transform: rotate(45deg) translate(-5px,-5px);
`};
`
8 changes: 4 additions & 4 deletions src/HamburgerMenu/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import NextLink from 'next/link'
import { media } from '../styles'

import Hamburger from '../Hamburger'
import NextLink from 'next/link'
import PropTypes from 'prop-types'
import { logEvent } from '../utils/ga'
import { media } from '../styles'
import styled from 'styled-components'

const SocialLink = ({ src, href, click, children }) => (
<Link src={src} href={href} onClick={click}>
Expand Down
4 changes: 2 additions & 2 deletions src/Hero/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import React from 'react'
import { container } from '../styles'
import styled from 'styled-components'

export default function Hero({ children }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/LandingHero/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OnlyDesktop, OnlyMobile, media } from '../styles'
import React, { Component } from 'react'
import styled, { css } from 'styled-components'

import { OnlyDesktop, OnlyMobile, media } from '../styles'
import DownloadButton from '../DownloadButton'
import GithubLine from '../GithubLine'
import { logEvent } from '../utils/ga'
Expand Down
11 changes: 5 additions & 6 deletions src/Layout/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { useEffect } from 'react'
import { initGA, logPageView } from '../utils/ga'

import Footer from '../Footer'
import HamburgerMenu from '../HamburgerMenu'
import PropTypes from 'prop-types'
import TopMenu from '../TopMenu'
import styled from 'styled-components'
import { useRouter } from 'next/router'
// components
import TopMenu from '../TopMenu'
import Footer from '../Footer'
import HamburgerMenu from '../HamburgerMenu'
// utils
import { initGA, logPageView } from '../utils/ga'

export default function Layout({ children, enableSmoothScroll }) {
const router = useRouter()
Expand Down
5 changes: 3 additions & 2 deletions src/LearnMore/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react'
import styled, { keyframes } from 'styled-components'

import React from 'react'
import { logEvent } from '../utils/ga'
import { media } from '../styles'
import { scroller } from 'react-scroll'
import { logEvent } from '../utils/ga'

const scrollToDiagram = () => {
logEvent('hero', 'learn-more')
Expand Down
2 changes: 1 addition & 1 deletion src/Modal/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom'

const Modal = ({ children }) =>
ReactDOM.createPortal(children, document.getElementById('modal-root'))
Expand Down
10 changes: 5 additions & 5 deletions src/Nav/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { media } from '../styles'
import { logEvent } from '../utils/ga'
import NextLink from 'next/link'
import PropTypes from 'prop-types'
import React from 'react'
import Router from 'next/router'
import { logEvent } from '../utils/ga'
import { media } from '../styles'
import styled from 'styled-components'

const getStarted = () => {
logEvent('menu', 'get-started')
Expand Down
6 changes: 3 additions & 3 deletions src/Page/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from 'react'

import Layout from '../Layout'
import PropTypes from 'prop-types'
import { createGlobalStyle } from 'styled-components'
import reset from 'styled-reset'

import { global } from '../styles'
import Layout from '../Layout'
import reset from 'styled-reset'

const GlobalStyle = createGlobalStyle`
${reset}
Expand Down
7 changes: 3 additions & 4 deletions src/PromoSection/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { PAGE_DOC } from '../consts'
import React from 'react'
import styled from 'styled-components'
import Router from 'next/router'
import { media } from '../styles'
import { logEvent } from '../utils/ga'
// consts
import { PAGE_DOC } from '../consts'
import { media } from '../styles'
import styled from 'styled-components'

function goToDocGetStarted() {
logEvent('promo', 'get-started')
Expand Down
5 changes: 2 additions & 3 deletions src/Subscribe/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import { media } from '../styles'

import SubscribeForm from '../SubscribeForm'
import { media } from '../styles'
import styled from 'styled-components'

export default function Subscribe() {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/SubscribeForm/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import styled from 'styled-components'
import { media } from '../styles'
import styled from 'styled-components'

export default function SubscribeForm() {
return (
Expand All @@ -23,7 +23,7 @@ export default function SubscribeForm() {
/>

{/*
real people should not fill this in and expect good things -
real people should not fill this in and expect good things -
do not remove this or risk form bot signups
*/}
<div style={{ position: 'absolute', left: '-5000px' }} aria-hidden="true">
Expand Down
5 changes: 3 additions & 2 deletions src/TextCollapse/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'

import Collapse from 'react-collapse'
import PropTypes from 'prop-types'
import { presets } from 'react-motion'
import styled from 'styled-components'

class TextCollapse extends Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions src/Tooltip/desktop-view.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from 'react'

import { HEADER } from '../consts'
import PropTypes from 'prop-types'
import ReactMarkdown from 'react-markdown'
import styled from 'styled-components'

import { HEADER } from '../consts'

class DesktopView extends Component {
state = {
hover: false,
Expand Down
8 changes: 4 additions & 4 deletions src/Tooltip/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { OnlyDesktop, OnlyMobile } from '../styles'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import includes from 'lodash.includes'

import glossary from '../../public/docs/glossary'
import { OnlyDesktop, OnlyMobile } from '../styles'
import DesktopView from './desktop-view'
import MobileView from './mobile-view'
import PropTypes from 'prop-types'
import glossary from '../../public/docs/glossary'
import includes from 'lodash.includes'

class Tooltip extends Component {
state = {
Expand Down
6 changes: 3 additions & 3 deletions src/Tooltip/mobile-view.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Component } from 'react'
import ReactMarkdown from 'react-markdown'
import PropTypes from 'prop-types'
import styled from 'styled-components'

import Modal from '../Modal'
import PropTypes from 'prop-types'
import ReactMarkdown from 'react-markdown'
import styled from 'styled-components'

class MobileView extends Component {
state = {
Expand Down
Loading

0 comments on commit b633778

Please sign in to comment.