From b4948680bbf633f62caa865832601c03d186d70e Mon Sep 17 00:00:00 2001 From: Candy Wang Date: Sun, 21 Feb 2021 16:20:41 -0800 Subject: [PATCH 1/4] Convert to TypeScript --- .../block/ProgramCard/ProgramCard.js | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/components/block/ProgramCard/ProgramCard.js diff --git a/src/components/block/ProgramCard/ProgramCard.js b/src/components/block/ProgramCard/ProgramCard.js deleted file mode 100644 index 670ad5f6..00000000 --- a/src/components/block/ProgramCard/ProgramCard.js +++ /dev/null @@ -1,26 +0,0 @@ -import PropTypes from "prop-types"; -import React from "react"; -import s from "./ProgramCard.module.css"; - -const ProgramCard = ({ theme, image, imageAlt, title, description }) => ( -
-
- {imageAlt} -
-
{title}
-
{description}
-
-); - -ProgramCard.propTypes = { - theme: PropTypes.string.isRequired, - image: PropTypes.string.isRequired, - imageAlt: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, -}; - -export default ProgramCard; From a78c53f8a31e361e17dca9f411573d7696e827df Mon Sep 17 00:00:00 2001 From: Candy Wang Date: Sun, 21 Feb 2021 16:22:07 -0800 Subject: [PATCH 2/4] Add esModuleInterop flag --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 526a69ab..b32a27b6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "allowJs": true, // Allow a mix of JS and TS until we fully migrate to TS. "jsx": "react", "noEmit": true, // No need to emit .d.ts files, since we're not publishing a package. + "esModuleInterop": true, // Strict Checks "strict": true, From f6a55e1740e8d2d9c9213fcebdbf6e18e4ce2af1 Mon Sep 17 00:00:00 2001 From: Candy Wang Date: Sun, 21 Feb 2021 17:13:34 -0800 Subject: [PATCH 3/4] Change file extension to tsx --- .../block/ProgramCard/ProgramCard.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/block/ProgramCard/ProgramCard.tsx diff --git a/src/components/block/ProgramCard/ProgramCard.tsx b/src/components/block/ProgramCard/ProgramCard.tsx new file mode 100644 index 00000000..24d2fac1 --- /dev/null +++ b/src/components/block/ProgramCard/ProgramCard.tsx @@ -0,0 +1,31 @@ +import React from "react"; +import s from "./ProgramCard.module.css"; + +type ProgramCardProps = { + theme: string; + image: string; + imageAlt: string; + title: string; + description: string; +}; + +const ProgramCard = ({ + theme, + image, + imageAlt, + title, + description, +}: ProgramCardProps) => ( +
+
+ {imageAlt} +
+
{title}
+
{description}
+
+); + +export default ProgramCard; From 15739d630665d71e8b76fec0c08a0f46f2b86112 Mon Sep 17 00:00:00 2001 From: Candy Wang Date: Sun, 21 Feb 2021 23:29:32 -0800 Subject: [PATCH 4/4] Revert tsconfig.json --- src/components/block/ProgramCard/ProgramCard.tsx | 2 +- tsconfig.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/block/ProgramCard/ProgramCard.tsx b/src/components/block/ProgramCard/ProgramCard.tsx index 24d2fac1..f6ac47e8 100644 --- a/src/components/block/ProgramCard/ProgramCard.tsx +++ b/src/components/block/ProgramCard/ProgramCard.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import * as React from "react"; import s from "./ProgramCard.module.css"; type ProgramCardProps = { diff --git a/tsconfig.json b/tsconfig.json index b32a27b6..526a69ab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,6 @@ "allowJs": true, // Allow a mix of JS and TS until we fully migrate to TS. "jsx": "react", "noEmit": true, // No need to emit .d.ts files, since we're not publishing a package. - "esModuleInterop": true, // Strict Checks "strict": true,