diff --git a/.gitignore b/.gitignore
index 16d8d68..705ca36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
build/
-node_modules/
\ No newline at end of file
+node_modules/
+/.idea
\ No newline at end of file
diff --git a/README.md b/README.md
index fa528ff..e5f4129 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,9 @@ Free meal planner for cooks short on ideas! (like me …)
## Feature list
- Random meal suggestion ✓
-- Search by name: you're look for a recipe? Ours are easy to make and Yummy! ✓
+- Search by name: you look for a recipe? Ours are easy to make and Yummy! ✓
- What's in the fridge ? Choose your main ingredient and get a meal suggestion
-- Choose by category: ✓
+- Choose by a category: ✓
- Beef
- Breakfast
- Chicken
diff --git a/jsconfig.json b/jsconfig.json
deleted file mode 100644
index 5875dc5..0000000
--- a/jsconfig.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "compilerOptions": {
- "baseUrl": "src"
- },
- "include": ["src"]
-}
diff --git a/package.json b/package.json
index 6dc9c9a..2fcae70 100644
--- a/package.json
+++ b/package.json
@@ -33,5 +33,10 @@
"last 1 firefox version",
"last 1 safari version"
]
+ },
+ "devDependencies": {
+ "@types/node": "^14.14.37",
+ "@types/react": "^17.0.3",
+ "typescript": "^4.2.3"
}
}
diff --git a/src/App.test.js b/src/App.test.js
deleted file mode 100644
index 4db7ebc..0000000
--- a/src/App.test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react';
-import { render } from '@testing-library/react';
-import App from './App';
-
-test('renders learn react link', () => {
- const { getByText } = render();
- const linkElement = getByText(/learn react/i);
- expect(linkElement).toBeInTheDocument();
-});
diff --git a/src/App.jsx b/src/App.tsx
similarity index 100%
rename from src/App.jsx
rename to src/App.tsx
diff --git a/src/components/CardEntry.jsx b/src/components/CardEntry.tsx
similarity index 100%
rename from src/components/CardEntry.jsx
rename to src/components/CardEntry.tsx
diff --git a/src/components/CategoryEntry.jsx b/src/components/CategoryEntry.tsx
similarity index 100%
rename from src/components/CategoryEntry.jsx
rename to src/components/CategoryEntry.tsx
diff --git a/src/components/ContactForm.jsx b/src/components/ContactForm.tsx
similarity index 100%
rename from src/components/ContactForm.jsx
rename to src/components/ContactForm.tsx
diff --git a/src/components/CopyrightText.jsx b/src/components/CopyrightText.tsx
similarity index 100%
rename from src/components/CopyrightText.jsx
rename to src/components/CopyrightText.tsx
diff --git a/src/components/Footer.jsx b/src/components/Footer.tsx
similarity index 100%
rename from src/components/Footer.jsx
rename to src/components/Footer.tsx
diff --git a/src/components/FooterLink.jsx b/src/components/FooterLink.tsx
similarity index 100%
rename from src/components/FooterLink.jsx
rename to src/components/FooterLink.tsx
diff --git a/src/components/GitHubLink.jsx b/src/components/GitHubLink.tsx
similarity index 100%
rename from src/components/GitHubLink.jsx
rename to src/components/GitHubLink.tsx
diff --git a/src/components/IngredientList.jsx b/src/components/IngredientList.tsx
similarity index 100%
rename from src/components/IngredientList.jsx
rename to src/components/IngredientList.tsx
diff --git a/src/components/LogInButton.jsx b/src/components/LogInButton.tsx
similarity index 100%
rename from src/components/LogInButton.jsx
rename to src/components/LogInButton.tsx
diff --git a/src/components/LogOutButton.jsx b/src/components/LogOutButton.tsx
similarity index 100%
rename from src/components/LogOutButton.jsx
rename to src/components/LogOutButton.tsx
diff --git a/src/components/Logo.jsx b/src/components/Logo.tsx
similarity index 100%
rename from src/components/Logo.jsx
rename to src/components/Logo.tsx
diff --git a/src/components/MealPresentation.jsx b/src/components/MealPresentation.tsx
similarity index 100%
rename from src/components/MealPresentation.jsx
rename to src/components/MealPresentation.tsx
diff --git a/src/components/Navbar.jsx b/src/components/Navbar.tsx
similarity index 100%
rename from src/components/Navbar.jsx
rename to src/components/Navbar.tsx
diff --git a/src/components/PreLoader.jsx b/src/components/PreLoader.tsx
similarity index 100%
rename from src/components/PreLoader.jsx
rename to src/components/PreLoader.tsx
diff --git a/src/components/PrivateRoute.jsx b/src/components/PrivateRoute.tsx
similarity index 100%
rename from src/components/PrivateRoute.jsx
rename to src/components/PrivateRoute.tsx
diff --git a/src/components/RandomButton.jsx b/src/components/RandomButton.tsx
similarity index 100%
rename from src/components/RandomButton.jsx
rename to src/components/RandomButton.tsx
diff --git a/src/components/Recipe.jsx b/src/components/Recipe.tsx
similarity index 100%
rename from src/components/Recipe.jsx
rename to src/components/Recipe.tsx
diff --git a/src/components/SearchBar.jsx b/src/components/SearchBar.tsx
similarity index 100%
rename from src/components/SearchBar.jsx
rename to src/components/SearchBar.tsx
diff --git a/src/components/SearchResult.jsx b/src/components/SearchResult.tsx
similarity index 100%
rename from src/components/SearchResult.jsx
rename to src/components/SearchResult.tsx
diff --git a/src/components/SideNav.jsx b/src/components/SideNav.tsx
similarity index 100%
rename from src/components/SideNav.jsx
rename to src/components/SideNav.tsx
diff --git a/src/controllers/CategoryController.jsx b/src/controllers/CategoryController.tsx
similarity index 100%
rename from src/controllers/CategoryController.jsx
rename to src/controllers/CategoryController.tsx
diff --git a/src/controllers/CategoryListController.jsx b/src/controllers/CategoryListController.tsx
similarity index 100%
rename from src/controllers/CategoryListController.jsx
rename to src/controllers/CategoryListController.tsx
diff --git a/src/controllers/HomeController.jsx b/src/controllers/HomeController.tsx
similarity index 100%
rename from src/controllers/HomeController.jsx
rename to src/controllers/HomeController.tsx
diff --git a/src/controllers/MainRouter.jsx b/src/controllers/MainRouter.tsx
similarity index 78%
rename from src/controllers/MainRouter.jsx
rename to src/controllers/MainRouter.tsx
index 523e312..90ee109 100644
--- a/src/controllers/MainRouter.jsx
+++ b/src/controllers/MainRouter.tsx
@@ -1,11 +1,11 @@
import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
-import { SearchController } from "../controllers/SearchController";
-import { HomeController } from "../controllers/HomeController";
-import { MealController } from "../controllers/MealController";
-import { CategoryController } from "../controllers/CategoryController";
-import { CategoryListController } from "../controllers/CategoryListController";
-import { ProfileController } from "../controllers/ProfileController";
+import { SearchController } from "./SearchController";
+import { HomeController } from "./HomeController";
+import { MealController } from "./MealController";
+import { CategoryController } from "./CategoryController";
+import { CategoryListController } from "./CategoryListController";
+import { ProfileController } from "./ProfileController";
import { ContactPage } from "../pages/Contact";
import { NotFoundPage } from "../pages/NotFoundPage";
import { PrivateRoute } from "../components/PrivateRoute";
diff --git a/src/controllers/MealController.jsx b/src/controllers/MealController.tsx
similarity index 100%
rename from src/controllers/MealController.jsx
rename to src/controllers/MealController.tsx
diff --git a/src/controllers/ProfileController.jsx b/src/controllers/ProfileController.tsx
similarity index 100%
rename from src/controllers/ProfileController.jsx
rename to src/controllers/ProfileController.tsx
diff --git a/src/controllers/SearchController.jsx b/src/controllers/SearchController.tsx
similarity index 100%
rename from src/controllers/SearchController.jsx
rename to src/controllers/SearchController.tsx
diff --git a/src/index.js b/src/index.tsx
similarity index 96%
rename from src/index.js
rename to src/index.tsx
index a53a556..b1fcddf 100644
--- a/src/index.js
+++ b/src/index.tsx
@@ -1,7 +1,7 @@
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
-import { App } from "./App.jsx";
+import {App} from "./App";
import * as serviceWorker from "./serviceWorker";
import { Auth0Provider } from "./utils/auth0-spa";
import history from "./utils/history";
diff --git a/src/layouts/MainLayout.jsx b/src/layouts/MainLayout.tsx
similarity index 100%
rename from src/layouts/MainLayout.jsx
rename to src/layouts/MainLayout.tsx
diff --git a/src/layouts/PageLayout.jsx b/src/layouts/PageLayout.tsx
similarity index 100%
rename from src/layouts/PageLayout.jsx
rename to src/layouts/PageLayout.tsx
diff --git a/src/pages/CategoryListPage.jsx b/src/pages/CategoryListPage.tsx
similarity index 100%
rename from src/pages/CategoryListPage.jsx
rename to src/pages/CategoryListPage.tsx
diff --git a/src/pages/CategoryPage.jsx b/src/pages/CategoryPage.tsx
similarity index 100%
rename from src/pages/CategoryPage.jsx
rename to src/pages/CategoryPage.tsx
diff --git a/src/pages/Contact.jsx b/src/pages/Contact.tsx
similarity index 100%
rename from src/pages/Contact.jsx
rename to src/pages/Contact.tsx
diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.tsx
similarity index 100%
rename from src/pages/HomePage.jsx
rename to src/pages/HomePage.tsx
diff --git a/src/pages/MealPage.jsx b/src/pages/MealPage.tsx
similarity index 100%
rename from src/pages/MealPage.jsx
rename to src/pages/MealPage.tsx
diff --git a/src/pages/NotFoundPage.jsx b/src/pages/NotFoundPage.tsx
similarity index 100%
rename from src/pages/NotFoundPage.jsx
rename to src/pages/NotFoundPage.tsx
diff --git a/src/pages/ProfilePage.jsx b/src/pages/ProfilePage.tsx
similarity index 100%
rename from src/pages/ProfilePage.jsx
rename to src/pages/ProfilePage.tsx
diff --git a/src/pages/SearchPage.jsx b/src/pages/SearchPage.tsx
similarity index 100%
rename from src/pages/SearchPage.jsx
rename to src/pages/SearchPage.tsx
diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts
new file mode 100644
index 0000000..6431bc5
--- /dev/null
+++ b/src/react-app-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/src/serviceWorker.js b/src/serviceWorker.ts
similarity index 100%
rename from src/serviceWorker.js
rename to src/serviceWorker.ts
diff --git a/src/setupTests.js b/src/setupTests.ts
similarity index 100%
rename from src/setupTests.js
rename to src/setupTests.ts
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..4a501cc
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "allowSyntheticDefaultImports": true,
+ "strict": false,
+ "forceConsistentCasingInFileNames": true,
+ "noFallthroughCasesInSwitch": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "include": [
+ "src"
+ ]
+}
diff --git a/yarn.lock b/yarn.lock
index 400ab1f..537efc8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2099,6 +2099,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.47.tgz#6eca42c3462821309b26edbc2eff0db1e37ab9bc"
integrity sha512-R6851wTjN1YJza8ZIeX6puNBSi/ZULHVh4WVleA7q256l+cP2EtXnKbO455fTs2ytQk3dL9qkU+Wh8l/uROdKg==
+"@types/node@^14.14.37":
+ version "14.14.37"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
+ integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==
+
"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
@@ -2114,11 +2119,25 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0"
integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA==
+"@types/prop-types@*":
+ version "15.7.3"
+ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
+ integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
+
"@types/q@^1.5.1":
version "1.5.4"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==
+"@types/react@^17.0.3":
+ version "17.0.3"
+ resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.3.tgz#ba6e215368501ac3826951eef2904574c262cc79"
+ integrity sha512-wYOUxIgs2HZZ0ACNiIayItyluADNbONl7kt8lkLjVK8IitMH5QMyAh75Fwhmo37r1m7L2JaFj03sIfxBVDvRAg==
+ dependencies:
+ "@types/prop-types" "*"
+ "@types/scheduler" "*"
+ csstype "^3.0.2"
+
"@types/resolve@0.0.8":
version "0.0.8"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194"
@@ -2126,6 +2145,11 @@
dependencies:
"@types/node" "*"
+"@types/scheduler@*":
+ version "0.16.1"
+ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
+ integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
+
"@types/source-list-map@*":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
@@ -4217,6 +4241,11 @@ cssstyle@^2.3.0:
dependencies:
cssom "~0.3.6"
+csstype@^3.0.2:
+ version "3.0.7"
+ resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.7.tgz#2a5fb75e1015e84dd15692f71e89a1450290950b"
+ integrity sha512-KxnUB0ZMlnUWCsx2Z8MUsr6qV6ja1w9ArPErJaJaF8a5SOWoHLIszeCTKGRGRgtLgYrs1E8CHkNSP1VZTTPc9g==
+
cyclist@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
@@ -11324,6 +11353,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
+typescript@^4.2.3:
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
+ integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==
+
unbox-primitive@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.0.tgz#eeacbc4affa28e9b3d36b5eaeccc50b3251b1d3f"