Skip to content

Commit

Permalink
Import withStyles directly in components
Browse files Browse the repository at this point in the history
There was an issue where it caused storybook compilation issues. For more info: storybookjs/storybook#4796
  • Loading branch information
Josh Bassett committed Dec 7, 2018
1 parent 36e2258 commit 8a97c20
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Dropdown/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import FormHelperText from '@material-ui/core/FormHelperText'
import InputBase from '@material-ui/core/InputBase'
import React from 'react'
import Select from '@material-ui/core/Select'
import withStyles from '@material-ui/core/styles/withStyles'

import FormLabel from '../form/FormLabel'
import { withStyles } from '../index'

const styles = theme => {
const light = theme.palette.type === 'light'
Expand Down
4 changes: 2 additions & 2 deletions src/TextField/TextField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import FormHelperText from '@material-ui/core/FormHelperText'
import InputBase from '@material-ui/core/InputBase'
import PropTypes from 'prop-types'
import React from 'react'
import withStyles from '@material-ui/core/styles/withStyles'

import FormLabel from '../form/FormLabel'
import { withStyles } from '../index'

const styles = theme => {
const light = theme.palette.type === 'light'
Expand Down Expand Up @@ -51,7 +51,7 @@ const styles = theme => {
* />
* ```
*/
const TextField = ({
export const TextField = ({
disabled,
error,
fullWidth,
Expand Down
2 changes: 1 addition & 1 deletion src/TextField/stories/overview.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import ComponentOverview from '../../ComponentOverview'
import { TextField } from '../../index'
import { TextField } from '../TextField'

export default () => <ComponentOverview component={TextField} />
3 changes: 2 additions & 1 deletion src/colours/Swatch.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import withStyles from '@material-ui/core/styles/withStyles'

import { Paper, Typography, withStyles } from '../index'
import { Paper, Typography } from '../index'

const size = 120
const margin = 16
Expand Down
3 changes: 1 addition & 2 deletions src/dialog/DialogActions.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import MaterialDialogActions from '@material-ui/core/DialogActions'
import React from 'react'

import { withStyles } from '../index'
import withStyles from '@material-ui/core/styles/withStyles'

const styles = {
root: {
Expand Down
3 changes: 1 addition & 2 deletions src/dialog/DialogContent.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import MaterialDialogContent from '@material-ui/core/DialogContent'
import React from 'react'

import { withStyles } from '../index'
import withStyles from '@material-ui/core/styles/withStyles'

const styles = {
root: {
Expand Down
3 changes: 2 additions & 1 deletion src/dialog/DialogTitle.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import MaterialDialogTitle from '@material-ui/core/DialogTitle'
import React from 'react'
import withStyles from '@material-ui/core/styles/withStyles'

import { Typography, withStyles } from '../index'
import { Typography } from '../index'

const styles = theme => ({
root: {
Expand Down
3 changes: 1 addition & 2 deletions src/form/FormLabel.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import FormLabel from '@material-ui/core/FormLabel'

import { withStyles } from '../index'
import withStyles from '@material-ui/core/styles/withStyles'

const styles = theme => ({
root: {
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export { default as Grid } from '@material-ui/core/Grid'
export { default as MenuItem } from '@material-ui/core/MenuItem'
export { default as Paper } from '@material-ui/core/Paper'
export { default as Typography } from '@material-ui/core/Typography'
export { default as withStyles } from '@material-ui/core/styles/withStyles'
export { default as withTheme } from '@material-ui/core/styles/withTheme'

// Our API.
export { ThemeProvider, defaultTheme, withStyles, withTheme } from './styles'
export { ThemeProvider, defaultTheme } from './styles'
export { default as Button } from './Button'
export { default as Card } from './card/Card'
export { default as CardAction } from './card/CardAction'
Expand Down
3 changes: 0 additions & 3 deletions src/styles/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
export { default as withStyles } from '@material-ui/core/styles/withStyles'
export { default as withTheme } from '@material-ui/core/styles/withTheme'

export { default as ThemeProvider } from './ThemeProvider'
export { default as defaultTheme } from './defaultTheme'

0 comments on commit 8a97c20

Please sign in to comment.