diff --git a/examples/.babelrc b/examples/.babelrc index 86c445f..d56be97 100644 --- a/examples/.babelrc +++ b/examples/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["es2015", "react"] + "presets": ["es2015", "react"], + "plugins": ["transform-class-properties"] } diff --git a/examples/.eslintrc b/examples/.eslintrc index 40ad4e0..1294bca 100644 --- a/examples/.eslintrc +++ b/examples/.eslintrc @@ -1,4 +1,5 @@ { + "parser": "babel-eslint", "extends": "airbnb", "rules": { "react/prop-types": 0 diff --git a/examples/aphrodite/src/components/content/content.js b/examples/aphrodite/src/components/content/content.js index ce76057..c6699f3 100644 --- a/examples/aphrodite/src/components/content/content.js +++ b/examples/aphrodite/src/components/content/content.js @@ -25,7 +25,7 @@ const styles = StyleSheet.create({ const Content = ({ text, media }) => (

- +

diff --git a/examples/aphrodite/src/components/footer/footer.js b/examples/aphrodite/src/components/footer/footer.js index ac2264e..c66655d 100644 --- a/examples/aphrodite/src/components/footer/footer.js +++ b/examples/aphrodite/src/components/footer/footer.js @@ -79,11 +79,9 @@ class Footer extends Component { this.state = { liked: false, }; - - this.handleClick = this.handleClick.bind(this); } - handleClick() { + handleClick = () => { this.setState({ liked: !this.state.liked, }); diff --git a/examples/aphrodite/src/components/header/header.js b/examples/aphrodite/src/components/header/header.js index fbe0d7f..f100ced 100644 --- a/examples/aphrodite/src/components/header/header.js +++ b/examples/aphrodite/src/components/header/header.js @@ -42,12 +42,12 @@ const styles = StyleSheet.create({ const Header = ({ name, profileImageUrl, screenName, url }) => (
- + {name}
- + {name} @{screenName} diff --git a/examples/css-modules/src/components/content/content.css b/examples/css-modules/src/components/content/content.css index 781f8b0..0385513 100644 --- a/examples/css-modules/src/components/content/content.css +++ b/examples/css-modules/src/components/content/content.css @@ -12,6 +12,10 @@ color: accent; } +.text a:hover { + text-decoration: underline; +} + .media { border-radius: .35rem; border: 1px solid border; diff --git a/examples/css-modules/src/components/content/content.js b/examples/css-modules/src/components/content/content.js index a614c97..88c44f1 100644 --- a/examples/css-modules/src/components/content/content.js +++ b/examples/css-modules/src/components/content/content.js @@ -5,7 +5,7 @@ import styles from './content.css'; const Content = ({ text, media }) => (

- +

diff --git a/examples/css-modules/src/components/footer/footer.js b/examples/css-modules/src/components/footer/footer.js index 45f4529..e5bd6bb 100644 --- a/examples/css-modules/src/components/footer/footer.js +++ b/examples/css-modules/src/components/footer/footer.js @@ -15,11 +15,9 @@ class Footer extends Component { this.state = { liked: false, }; - - this.handleClick = this.handleClick.bind(this); } - handleClick() { + handleClick = () => { this.setState({ liked: !this.state.liked, }); diff --git a/examples/css-modules/src/components/header/header.js b/examples/css-modules/src/components/header/header.js index b70fe66..10b967c 100644 --- a/examples/css-modules/src/components/header/header.js +++ b/examples/css-modules/src/components/header/header.js @@ -5,12 +5,12 @@ import styles from './header.css'; const Header = ({ name, profileImageUrl, screenName, url }) => (
- + {name}
- + {name} @{screenName} diff --git a/examples/css/package.json b/examples/css/package.json index 6459701..13ba89d 100644 --- a/examples/css/package.json +++ b/examples/css/package.json @@ -4,7 +4,7 @@ "description": "", "main": "src/index.js", "scripts": { - "start": "../node_modules/.bin/webpack-dev-server --config ../webpack.base.babel.js" + "start": "../node_modules/.bin/webpack-dev-server --config webpack.custom.babel.js" }, "author": "Max Stoiber", "license": "MIT" diff --git a/examples/css/src/components/content/content.js b/examples/css/src/components/content/content.js index 2b01452..8c06be0 100644 --- a/examples/css/src/components/content/content.js +++ b/examples/css/src/components/content/content.js @@ -3,7 +3,7 @@ import React, { PropTypes } from 'react'; const Content = ({ text, media }) => (

- +

diff --git a/examples/css/src/components/footer/footer.js b/examples/css/src/components/footer/footer.js index 8d20f79..8acc915 100644 --- a/examples/css/src/components/footer/footer.js +++ b/examples/css/src/components/footer/footer.js @@ -13,11 +13,9 @@ class Footer extends Component { this.state = { liked: false, }; - - this.handleClick = this.handleClick.bind(this); } - handleClick() { + handleClick = () => { this.setState({ liked: !this.state.liked, }); @@ -49,7 +47,7 @@ class Footer extends Component {
-
diff --git a/examples/css/src/components/header/header.js b/examples/css/src/components/header/header.js index 1615c4c..573cee9 100644 --- a/examples/css/src/components/header/header.js +++ b/examples/css/src/components/header/header.js @@ -3,12 +3,12 @@ import React, { PropTypes } from 'react'; const Header = ({ name, profileImageUrl, screenName, url }) => (
- + {name} @{screenName} diff --git a/examples/css/src/styles/main.css b/examples/css/src/styles/main.css index a60341a..eb8bbed 100644 --- a/examples/css/src/styles/main.css +++ b/examples/css/src/styles/main.css @@ -111,6 +111,10 @@ svg { color: #1da1f2; } +.tweet__text a:hover { + text-decoration: underline; +} + .tweet__media { border-radius: .35rem; border: 1px solid #e1e8ed; diff --git a/examples/css/webpack.custom.babel.js b/examples/css/webpack.custom.babel.js new file mode 100644 index 0000000..19ac6d8 --- /dev/null +++ b/examples/css/webpack.custom.babel.js @@ -0,0 +1,13 @@ +import { extendBaseConfig } from '../webpack.base.babel'; + +export default extendBaseConfig({ + module: { + loaders: [ + { + test: /\.css$/, + exclude: /node_modules/, + loader: 'style!css', + }, + ], + }, +}); diff --git a/examples/jss/src/components/content/content.js b/examples/jss/src/components/content/content.js index 83e82f0..f7abbbc 100644 --- a/examples/jss/src/components/content/content.js +++ b/examples/jss/src/components/content/content.js @@ -8,6 +8,12 @@ const styles = { lineHeight: '1.5em', margin: 0, padding: '.65625rem 0 .98438rem', + '& a': { + color: '#1da1f2', + }, + '& a:hover': { + textDecoration: 'underline', + }, }, media: { borderRadius: '.35rem', @@ -25,7 +31,7 @@ const styles = { const Content = ({ text, media, sheet: { classes } }) => ( diff --git a/examples/jss/src/components/footer/footer.js b/examples/jss/src/components/footer/footer.js index fbd1ba3..f48c1d8 100644 --- a/examples/jss/src/components/footer/footer.js +++ b/examples/jss/src/components/footer/footer.js @@ -78,11 +78,9 @@ class Footer extends Component { this.state = { liked: false, }; - - this.handleClick = this.handleClick.bind(this); } - handleClick() { + handleClick = () => { this.setState({ liked: !this.state.liked, }); diff --git a/examples/jss/src/components/header/header.js b/examples/jss/src/components/header/header.js index 18c5824..cffad92 100644 --- a/examples/jss/src/components/header/header.js +++ b/examples/jss/src/components/header/header.js @@ -42,12 +42,12 @@ const styles = { const Header = ({ name, profileImageUrl, screenName, url, sheet }) => (
- + {name} @{screenName} diff --git a/examples/package.json b/examples/package.json index cad0b78..6dd2392 100644 --- a/examples/package.json +++ b/examples/package.json @@ -15,7 +15,9 @@ }, "devDependencies": { "babel-core": "6.11.4", + "babel-eslint": "^6.1.2", "babel-loader": "6.2.4", + "babel-plugin-transform-class-properties": "^6.11.5", "babel-preset-es2015": "6.9.0", "babel-preset-react": "6.11.1", "babel-register": "6.11.6", diff --git a/examples/radium/src/components/content/content.js b/examples/radium/src/components/content/content.js index ca4d920..ea29c37 100644 --- a/examples/radium/src/components/content/content.js +++ b/examples/radium/src/components/content/content.js @@ -25,7 +25,7 @@ const styles = { const Content = ({ text, media }) => ( diff --git a/examples/radium/src/components/footer/footer.js b/examples/radium/src/components/footer/footer.js index fed878b..a4b469d 100644 --- a/examples/radium/src/components/footer/footer.js +++ b/examples/radium/src/components/footer/footer.js @@ -79,11 +79,9 @@ class Footer extends Component { this.state = { liked: false, }; - - this.handleClick = this.handleClick.bind(this); } - handleClick() { + handleClick = () => { this.setState({ liked: !this.state.liked, }); diff --git a/examples/radium/src/components/header/header.js b/examples/radium/src/components/header/header.js index 138031a..65f5af5 100644 --- a/examples/radium/src/components/header/header.js +++ b/examples/radium/src/components/header/header.js @@ -42,12 +42,12 @@ const styles = { const Header = ({ name, profileImageUrl, screenName, url }) => (
- + {name} @{screenName} diff --git a/examples/shared/data/755481795206971392.json b/examples/shared/data/755481795206971392.json index acdba2e..f98ffe4 100644 --- a/examples/shared/data/755481795206971392.json +++ b/examples/shared/data/755481795206971392.json @@ -18,7 +18,7 @@ "user": { "name": "Max Stoiber", "screen_name": "mxstbr", - "url": "https:\/\/t.co\/uAtI6h0Zng", + "url": "https:\/\/twitter.com\/mxstbr", "profile_image_url_https": "https:\/\/mxstbr.com\/headshot.jpeg" }, "retweet_count": 32, diff --git a/examples/shared/utils/text/text.js b/examples/shared/utils/text/text.js index 32aac15..6de5cce 100644 --- a/examples/shared/utils/text/text.js +++ b/examples/shared/utils/text/text.js @@ -4,14 +4,14 @@ export const transform = data => { data.entities.user_mentions.forEach(userMention => { text = text.replace( `@${userMention.screen_name}`, - `@${userMention.screen_name}` + `@${userMention.screen_name}` ); }); data.entities.urls.forEach(url => { text = text.replace( url.url, - `${url.display_url}` + `${url.display_url}` ); }); diff --git a/examples/shared/utils/text/text.spec.js b/examples/shared/utils/text/text.spec.js index d879fe7..6bcb330 100644 --- a/examples/shared/utils/text/text.spec.js +++ b/examples/shared/utils/text/text.spec.js @@ -21,7 +21,7 @@ describe('text', () => { }, }; - const expected = '\ud83d\udc4f Love love love this article by @chantastic. CSS-in-JS isn\u2019t a campaign against CSS! medium.com/learnreact/sca…'; + const expected = '\ud83d\udc4f Love love love this article by @chantastic. CSS-in-JS isn\u2019t a campaign against CSS! medium.com/learnreact/sca…'; assert.equal(transform(data), expected); });