Skip to content

Commit

Permalink
Upgrade modules and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drublic committed Apr 12, 2020
1 parent f30776c commit 50c8673
Show file tree
Hide file tree
Showing 9 changed files with 3,669 additions and 3,757 deletions.
17 changes: 0 additions & 17 deletions src/AppContainer/createContext.js

This file was deleted.

26 changes: 5 additions & 21 deletions src/AppContainer/withRoot.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React, { Component } from 'react'
import JssProvider from 'react-jss/lib/JssProvider'
import wrapDisplayName from 'recompose/wrapDisplayName'

import { withStyles, MuiThemeProvider } from '@material-ui/core/styles'

import createContext from './createContext'

// Apply some reset
const styles = theme => ({
'@global': {
Expand All @@ -24,28 +21,15 @@ let AppWrapper = props => props.children

AppWrapper = withStyles(styles)(AppWrapper)

const context = createContext()

const withRoot = (BaseComponent, props) => {
class WithRoot extends Component {
componentDidMount() {
// Remove the server-side injected CSS.
const jssStyles = document.querySelector('#jss-server-side')

if (jssStyles && jssStyles.parentNode) {
jssStyles.parentNode.removeChild(jssStyles)
}
}

render() {
return (
<JssProvider registry={context.sheetsRegistry} jss={context.jss}>
<MuiThemeProvider theme={props.theme}>
<AppWrapper>
<BaseComponent {...this.props} />
</AppWrapper>
</MuiThemeProvider>
</JssProvider>
<MuiThemeProvider theme={props.theme}>
<AppWrapper>
<BaseComponent {...this.props} />
</AppWrapper>
</MuiThemeProvider>
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const withBase = Component => class extends React.Component {
this.onClick = this.onClick.bind(this)
}

componentWillMount() {
componentDidMount() {
const { hasCookieInfo, menuOpen } = this.props

this.setState({
Expand Down
2 changes: 1 addition & 1 deletion src/Confirm/Confirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const withConfirm = Component => class extends React.Component {
this.handleConfirm = this.handleConfirm.bind(this)
}

componentWillMount() {
componentDidMount() {
this.setState({
isOpen: this.props.isOpen,
})
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const withForm = Component => class Form extends React.Component {
this.updateFieldData = this.updateFieldData.bind(this)
}

componentWillMount() {
componentDidMount() {
const { form, data } = this.props
this.generateFields(form, data)
this.generateMissingData(data)
Expand Down
2 changes: 1 addition & 1 deletion src/Listing/Listing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const withListing = Component => class Listing extends React.Component {
this.handleFilter = this.handleFilter.bind(this)
}

componentWillMount() {
componentDidMount() {
const {
id,
data,
Expand Down
2 changes: 1 addition & 1 deletion src/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Tabs extends React.Component {
value: 0,
}

componentWillMount() {
componentDidMount() {
const { data } = this.props
const hash = window.location.hash.replace('#/', '')
let value = 0
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Page extends React.Component {
additionalValue: null,
}

componentWillMount() {
componentDidMount() {
const { formData: newFormData, additionalValue } = this.state

newFormData[0].data[0].getAdditionalValue = value => (
Expand Down
Loading

0 comments on commit 50c8673

Please sign in to comment.