From 18e60ce803be143947829c763453b309ad3e3939 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Thu, 21 May 2020 10:02:39 -0400 Subject: [PATCH 1/4] Upgrade react-with-styles to version 4 --- examples/with-react-with-styles/package.json | 4 +-- examples/with-react-with-styles/pages/_app.js | 27 +++++++++++++++++++ .../with-react-with-styles/pages/index.js | 2 +- examples/with-react-with-styles/withStyles.js | 9 ------- 4 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 examples/with-react-with-styles/pages/_app.js delete mode 100644 examples/with-react-with-styles/withStyles.js diff --git a/examples/with-react-with-styles/package.json b/examples/with-react-with-styles/package.json index d5c27860354ed..6c83e727ad145 100644 --- a/examples/with-react-with-styles/package.json +++ b/examples/with-react-with-styles/package.json @@ -11,8 +11,8 @@ "next": "latest", "react": "^16.7.0", "react-dom": "^16.7.0", - "react-with-styles": "^2.2.0", - "react-with-styles-interface-aphrodite": "^3.1.1" + "react-with-styles": "^4.1.0", + "react-with-styles-interface-aphrodite": "^6.0.1" }, "license": "MIT" } diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js new file mode 100644 index 0000000000000..91d09a2a9a677 --- /dev/null +++ b/examples/with-react-with-styles/pages/_app.js @@ -0,0 +1,27 @@ +import App from 'next/app' +import React from 'react' +import WithStylesContext from 'react-with-styles/lib/WithStylesContext' +import AphroditeInterface from 'react-with-styles-interface-aphrodite' +import { DIRECTIONS } from 'react-with-direction' + +import defaultTheme from '../defaultTheme' + +class MyApp extends App { + render() { + const { Component, pageProps } = this.props + + return ( + + + + ) + } +} + +export default MyApp diff --git a/examples/with-react-with-styles/pages/index.js b/examples/with-react-with-styles/pages/index.js index 49f3a719b2a21..19c7c35976b51 100644 --- a/examples/with-react-with-styles/pages/index.js +++ b/examples/with-react-with-styles/pages/index.js @@ -1,5 +1,5 @@ import React from 'react' -import { css, withStyles } from '../withStyles' +import { css, withStyles } from 'react-with-styles' function Home({ styles }) { return ( diff --git a/examples/with-react-with-styles/withStyles.js b/examples/with-react-with-styles/withStyles.js deleted file mode 100644 index 76c424abffcd4..0000000000000 --- a/examples/with-react-with-styles/withStyles.js +++ /dev/null @@ -1,9 +0,0 @@ -import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet' -import aphroditeInterface from 'react-with-styles-interface-aphrodite' -import { css, withStyles } from 'react-with-styles' -import MyDefaultTheme from './defaultTheme' - -ThemedStyleSheet.registerTheme(MyDefaultTheme) -ThemedStyleSheet.registerInterface(aphroditeInterface) - -export { css, withStyles, ThemedStyleSheet } From 6678e64821c5982d08784cbf2582aa47eab59fea Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Thu, 21 May 2020 10:19:49 -0400 Subject: [PATCH 2/4] add react-with-direction to package.json --- examples/with-react-with-styles/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/with-react-with-styles/package.json b/examples/with-react-with-styles/package.json index 6c83e727ad145..fc2e89ba379c9 100644 --- a/examples/with-react-with-styles/package.json +++ b/examples/with-react-with-styles/package.json @@ -11,6 +11,7 @@ "next": "latest", "react": "^16.7.0", "react-dom": "^16.7.0", + "react-with-direction": "^1.3.1", "react-with-styles": "^4.1.0", "react-with-styles-interface-aphrodite": "^6.0.1" }, From ed8a3cf246e5b7bc534ab9c2ad21447f5737d926 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Fri, 22 May 2020 12:15:52 -0400 Subject: [PATCH 3/4] Apply suggestions from code review --- examples/with-react-with-styles/pages/_app.js | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js index 91d09a2a9a677..1da17df9de2d3 100644 --- a/examples/with-react-with-styles/pages/_app.js +++ b/examples/with-react-with-styles/pages/_app.js @@ -1,4 +1,3 @@ -import App from 'next/app' import React from 'react' import WithStylesContext from 'react-with-styles/lib/WithStylesContext' import AphroditeInterface from 'react-with-styles-interface-aphrodite' @@ -6,22 +5,21 @@ import { DIRECTIONS } from 'react-with-direction' import defaultTheme from '../defaultTheme' -class MyApp extends App { - render() { - const { Component, pageProps } = this.props +function MyApp(props) { + const { Component, pageProps } = props; - return ( - - - - ) - } + return ( + + + + ); } + export default MyApp From d2b529041b441887c4cc26ab552d702d1245f5f6 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Fri, 22 May 2020 12:17:03 -0400 Subject: [PATCH 4/4] Linting --- examples/with-react-with-styles/pages/_app.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js index 1da17df9de2d3..42856d46fd53d 100644 --- a/examples/with-react-with-styles/pages/_app.js +++ b/examples/with-react-with-styles/pages/_app.js @@ -1,12 +1,11 @@ import React from 'react' -import WithStylesContext from 'react-with-styles/lib/WithStylesContext' -import AphroditeInterface from 'react-with-styles-interface-aphrodite' import { DIRECTIONS } from 'react-with-direction' - +import AphroditeInterface from 'react-with-styles-interface-aphrodite' +import WithStylesContext from 'react-with-styles/lib/WithStylesContext' import defaultTheme from '../defaultTheme' function MyApp(props) { - const { Component, pageProps } = props; + const { Component, pageProps } = props return ( - ); + ) } - export default MyApp