diff --git a/css-modules/src/App.js b/css-modules/src/App.js index 30d925c..f5ce012 100644 --- a/css-modules/src/App.js +++ b/css-modules/src/App.js @@ -1,13 +1,13 @@ import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; import Form from "./components/Form/Form"; import Success from "./components/Success/Success"; -import "./App.css"; +import styles from "./App.module.css"; function App() { return ( -
-
+
+

Let's connect

Who are you looking to connect with?

@@ -24,14 +24,14 @@ function App() { -
-

headquarters

+
+

headquarters

500 Sansome St. #200
San Francisco, CA 94111
-

phone

+

phone

888.987.8337
diff --git a/css-modules/src/App.css b/css-modules/src/App.module.css similarity index 100% rename from css-modules/src/App.css rename to css-modules/src/App.module.css diff --git a/css-modules/src/components/ContentWrapper/ContentWrapper.js b/css-modules/src/components/ContentWrapper/ContentWrapper.js index 04d1d54..24da949 100644 --- a/css-modules/src/components/ContentWrapper/ContentWrapper.js +++ b/css-modules/src/components/ContentWrapper/ContentWrapper.js @@ -1,6 +1,6 @@ import React from "react"; import PropTypes from "prop-types"; -import "./ContentWrapper.css"; +import styles from "./ContentWrapper.module.css"; ContentWrapper.propTypes = { className: PropTypes.string, @@ -9,7 +9,11 @@ ContentWrapper.propTypes = { function ContentWrapper({ className, children }) { return (
{children}
diff --git a/css-modules/src/components/ContentWrapper/ContentWrapper.css b/css-modules/src/components/ContentWrapper/ContentWrapper.module.css similarity index 100% rename from css-modules/src/components/ContentWrapper/ContentWrapper.css rename to css-modules/src/components/ContentWrapper/ContentWrapper.module.css diff --git a/css-modules/src/components/ControlWithLabel/ControlWithLabel.js b/css-modules/src/components/ControlWithLabel/ControlWithLabel.js index 668bff6..be9ec58 100644 --- a/css-modules/src/components/ControlWithLabel/ControlWithLabel.js +++ b/css-modules/src/components/ControlWithLabel/ControlWithLabel.js @@ -1,6 +1,6 @@ import React from "react"; import PropTypes from "prop-types"; -import "./ControlWithLabel.css"; +import styles from "./ControlWithLabel.module.css"; ControlWithLabel.propTypes = { id: PropTypes.string.isRequired, @@ -11,16 +11,21 @@ ControlWithLabel.propTypes = { }; function ControlWithLabel({ id, title, invalid, required, children }) { - const className = required && invalid ? "control invalid" : "control"; + const className = + required && invalid + ? `${styles.control} ${styles.invalid}` + : styles.control; return ( -
+
-
+
{React.cloneElement(children, { id, className })} - {required && invalid &&

{title} is required.

} + {required && invalid && ( +

{title} is required.

+ )}
); diff --git a/css-modules/src/components/ControlWithLabel/ControlWithLabel.css b/css-modules/src/components/ControlWithLabel/ControlWithLabel.module.css similarity index 100% rename from css-modules/src/components/ControlWithLabel/ControlWithLabel.css rename to css-modules/src/components/ControlWithLabel/ControlWithLabel.module.css diff --git a/css-modules/src/components/Form/Form.js b/css-modules/src/components/Form/Form.js index 2f4dd58..d0da142 100644 --- a/css-modules/src/components/Form/Form.js +++ b/css-modules/src/components/Form/Form.js @@ -5,7 +5,7 @@ import { ReactComponent as Users } from "../../icons/users.svg"; import { ReactComponent as Question } from "../../icons/question.svg"; import ContentWrapper from "../ContentWrapper/ContentWrapper"; import ControlWithLabel from "../ControlWithLabel/ControlWithLabel"; -import "./Form.css"; +import styles from "./Form.module.css"; const formTypes = [ { @@ -126,23 +126,23 @@ function Form() { return ( -