aboutsummaryrefslogtreecommitdiff
path: root/src/components
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 /src/components
parent6874be2c3016b872016ba32181823a8e1232a1a7 (diff)
converted all the smaller files to tsx
Diffstat (limited to 'src/components')
-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
5 files changed, 47 insertions, 51 deletions
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>