aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-25 18:24:41 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-25 18:24:41 +0530
commit0d90508977837bec25f038fe5380e6fb3bc82745 (patch)
treef3e0eac29224dc46bbcdf59881f7912000624b3d
parent6874be2c3016b872016ba32181823a8e1232a1a7 (diff)
converted all the smaller files to tsx
-rw-r--r--package-lock.json58
-rw-r--r--package.json4
-rw-r--r--src/components/App.js33
-rw-r--r--src/components/App.tsx31
-rw-r--r--src/components/Header/Header.tsx (renamed from src/components/Header/Header.js)24
-rw-r--r--src/components/Menu/HomePageMenu.tsx (renamed from src/components/Menu/HomePageMenu.js)4
-rw-r--r--src/components/Pages/HomePage.tsx (renamed from src/components/Pages/HomePage.js)6
7 files changed, 109 insertions, 51 deletions
diff --git a/package-lock.json b/package-lock.json
index 4dd975c..734a6e4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23,6 +23,10 @@
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.1"
+ },
+ "devDependencies": {
+ "@types/react-router": "^5.1.15",
+ "@types/react-router-dom": "^5.1.7"
}
},
"node_modules/@babel/code-frame": {
@@ -2895,6 +2899,12 @@
"@types/node": "*"
}
},
+ "node_modules/@types/history": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.8.tgz",
+ "integrity": "sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==",
+ "dev": true
+ },
"node_modules/@types/html-minifier-terser": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz",
@@ -2993,6 +3003,27 @@
"@types/react": "*"
}
},
+ "node_modules/@types/react-router": {
+ "version": "5.1.15",
+ "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.15.tgz",
+ "integrity": "sha512-z3UlMG/x91SFEVmmvykk9FLTliDvfdIUky4k2rCfXWQ0NKbrP8o9BTCaCTPuYsB8gDkUnUmkcA2vYlm2DR+HAA==",
+ "dev": true,
+ "dependencies": {
+ "@types/history": "*",
+ "@types/react": "*"
+ }
+ },
+ "node_modules/@types/react-router-dom": {
+ "version": "5.1.7",
+ "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.7.tgz",
+ "integrity": "sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==",
+ "dev": true,
+ "dependencies": {
+ "@types/history": "*",
+ "@types/react": "*",
+ "@types/react-router": "*"
+ }
+ },
"node_modules/@types/resolve": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz",
@@ -24102,6 +24133,12 @@
"@types/node": "*"
}
},
+ "@types/history": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.8.tgz",
+ "integrity": "sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==",
+ "dev": true
+ },
"@types/html-minifier-terser": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz",
@@ -24200,6 +24237,27 @@
"@types/react": "*"
}
},
+ "@types/react-router": {
+ "version": "5.1.15",
+ "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.15.tgz",
+ "integrity": "sha512-z3UlMG/x91SFEVmmvykk9FLTliDvfdIUky4k2rCfXWQ0NKbrP8o9BTCaCTPuYsB8gDkUnUmkcA2vYlm2DR+HAA==",
+ "dev": true,
+ "requires": {
+ "@types/history": "*",
+ "@types/react": "*"
+ }
+ },
+ "@types/react-router-dom": {
+ "version": "5.1.7",
+ "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.7.tgz",
+ "integrity": "sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==",
+ "dev": true,
+ "requires": {
+ "@types/history": "*",
+ "@types/react": "*",
+ "@types/react-router": "*"
+ }
+ },
"@types/resolve": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz",
diff --git a/package.json b/package.json
index ec08670..ebaf798 100644
--- a/package.json
+++ b/package.json
@@ -44,5 +44,9 @@
"last 1 firefox version",
"last 1 safari version"
]
+ },
+ "devDependencies": {
+ "@types/react-router": "^5.1.15",
+ "@types/react-router-dom": "^5.1.7"
}
}
diff --git a/src/components/App.js b/src/components/App.js
deleted file mode 100644
index 64057b8..0000000
--- a/src/components/App.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * OpenBills - Self hosted browser app to generate and keep track of simple invoices
- * Version - 0
- * Licensed under the MIT license - https://opensource.org/licenses/MIT
- *
- * Copyright (c) 2021 Vidhu Kant Sharma
-*/
-
-import React from "react";
-import {BrowserRouter, Route, Switch} from "react-router-dom";
-
-import Header from "./Header/Header";
-import HomePage from "./Pages/HomePage";
-import BillingPage from "./Pages/BillingPage";
-
-const App = () => {
- return (
- <>
- <BrowserRouter>
- <Header/>
- <div className={"root-content"}>
- <Switch>
- <Route exact path="/" component={HomePage}/>
- <Route exact path="/BillingPage" component={BillingPage}/>
- <Route path="/" render={() => <div>404</div>}/>
- </Switch>
- </div>
- </BrowserRouter>
- </>
- );
-}
-
-export default App;
diff --git a/src/components/App.tsx b/src/components/App.tsx
new file mode 100644
index 0000000..f7e0348
--- /dev/null
+++ b/src/components/App.tsx
@@ -0,0 +1,31 @@
+/*
+ * OpenBills - Self hosted browser app to generate and keep track of simple invoices
+ * Version - 0
+ * Licensed under the MIT license - https://opensource.org/licenses/MIT
+ *
+ * Copyright (c) 2021 Vidhu Kant Sharma
+*/
+
+import React from "react";
+import { BrowserRouter, Route, Switch } from "react-router-dom";
+
+import Header from "./Header/Header";
+import HomePage from "./Pages/HomePage";
+import BillingPage from "./Pages/BillingPage";
+
+const App: React.FC = () => (
+ <>
+ <BrowserRouter>
+ <Header/>
+ <div className={"root-content"}>
+ <Switch>
+ <Route exact path="/" component={HomePage}/>
+ <Route exact path="/BillingPage" component={BillingPage}/>
+ <Route path="/" render={() => <div>404</div>}/>
+ </Switch>
+ </div>
+ </BrowserRouter>
+ </>
+);
+
+export default App;
diff --git a/src/components/Header/Header.js b/src/components/Header/Header.tsx
index a1bd097..bff61b6 100644
--- a/src/components/Header/Header.js
+++ b/src/components/Header/Header.tsx
@@ -7,23 +7,23 @@
*/
import React from "react";
-import {Link} from "react-router-dom";
+import { Link } from "react-router-dom";
import "./Header.scss";
-const Header = () => {
- return (
- <div className={"header"}>
- <div className="placeholder">
- <p className="inlineBlock">OpenBills</p>
+const Header: React.FC = () => {
+ return (
+ <div className={"header"}>
+ <div className="placeholder">
+ <p className="inlineBlock">OpenBills</p>
+ </div>
- </div>
- <div className={"navBar"}>
- <nav>
+ <div className={"navBar"}>
+ <nav>
<Link to="/">Home</Link>
<Link to="/BillingPage">BillingPage</Link>
- </nav>
- </div>
- </div>
+ </nav>
+ </div>
+ </div>
)
}
diff --git a/src/components/Menu/HomePageMenu.js b/src/components/Menu/HomePageMenu.tsx
index 92f2a8d..db0938a 100644
--- a/src/components/Menu/HomePageMenu.js
+++ b/src/components/Menu/HomePageMenu.tsx
@@ -7,10 +7,10 @@
*/
import React from "react";
-import {Link} from "react-router-dom";
+import { Link } from "react-router-dom";
import "./HomePageMenu.scss";
-const HomePageMenu = () => {
+const HomePageMenu: React.FC = () => {
return (
<div className="HomePageMenu">
<Link className="menuItem" to="BillingPage">
diff --git a/src/components/Pages/HomePage.js b/src/components/Pages/HomePage.tsx
index face5fd..34a52bd 100644
--- a/src/components/Pages/HomePage.js
+++ b/src/components/Pages/HomePage.tsx
@@ -6,14 +6,12 @@
* Copyright (c) 2021 Vidhu Kant Sharma
*/
-import React/*, { useState, useEffect } */from "react";
+import React from "react";
import "./HomePage.scss"
-//import axios from "axios";
-//import BillingPage from "./BillingPage"
import HomePageMenu from "./../Menu/HomePageMenu"
-const HomePage = () => {
+const HomePage: React.FC = () => {
return (
<div className="HomePage">
<h1 className={"welcomeMessage"}>Welcome To OpenBills</h1>