From 072b08baf7e6502d33d378b51e867f92c2d05872 Mon Sep 17 00:00:00 2001 From: nadvolod Date: Sat, 19 Feb 2022 16:01:46 -0500 Subject: [PATCH] update formatting with eslint, fix happo bug --- blockchain-app/README.md | 49 +++---- blockchain-app/client/.eslintrc | 30 +++-- blockchain-app/client/.happo.js | 52 ++++---- blockchain-app/client/package.json | 86 ++++++------- .../client/src/components/Navbar-happo.jsx | 9 -- .../client/src/components/Navbar.jsx | 120 +++++++++--------- 6 files changed, 170 insertions(+), 176 deletions(-) delete mode 100644 blockchain-app/client/src/components/Navbar-happo.jsx diff --git a/blockchain-app/README.md b/blockchain-app/README.md index bb6b23b..cd84e22 100644 --- a/blockchain-app/README.md +++ b/blockchain-app/README.md @@ -9,6 +9,7 @@ - [Install ESLint using Airbnb config](https://eslint.org/docs/user-guide/getting-started) - [Using CSShero.org for gradients on the card](https://csshero.org/mesher/) - [Deploy with Alchemy](https://www.alchemy.com/) +- [Docs on how to setup eslint and prettier](https://vicvijayakumar.com/blog/eslint-airbnb-style-guide-prettier) * Run eslint with `npx eslint .` * Automatically fix problems with `npx eslint . --fix` @@ -70,39 +71,39 @@ Context is designed to share data that can be considered “global” for a tree // Context lets us pass a value deep into the component tree // without explicitly threading it through every component. // Create a context for the current theme (with "light" as the default). -const ThemeContext = React.createContext('light'); +const ThemeContext = React.createContext("light"); class App extends React.Component { - render() { - // Use a Provider to pass the current theme to the tree below. - // Any component can read it, no matter how deep it is. - // In this example, we're passing "dark" as the current value. - return ( - // ThemeContext is the const that we defined above. We're setting a new theme value - - - - ); - } + render() { + // Use a Provider to pass the current theme to the tree below. + // Any component can read it, no matter how deep it is. + // In this example, we're passing "dark" as the current value. + return ( + // ThemeContext is the const that we defined above. We're setting a new theme value + + + + ); + } } // A component in the middle doesn't have to // pass the theme down explicitly anymore. function Toolbar() { - return ( -
- -
- ); + return ( +
+ +
+ ); } class ThemedButton extends React.Component { - // Assign a contextType to read the current theme context. - // React will find the closest theme Provider above and use its value. - // In this example, the current theme is "dark". - static contextType = ThemeContext; - render() { - return