Skip to content

Commit 87e83e9

Browse files
Initial App Structure created. More Refined later
1 parent 87e712e commit 87e83e9

File tree

10 files changed

+139
-7
lines changed

10 files changed

+139
-7
lines changed

src/components/App.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from "react";
2+
import { Route, Switch } from "react-router-dom";
3+
import HomePage from "./home/HomePage";
4+
import AboutPage from "./about/AboutPage";
5+
import Header from "./common/Header";
6+
import PageNotFound from "./PageNotFound";
7+
import DashboardPage from "./dashboard/DashboardPage";
8+
9+
const App = () => {
10+
return (
11+
<React.Fragment>
12+
<Header />
13+
<div className="container">
14+
<Switch>
15+
<Route exact path="/" component={HomePage}></Route>
16+
<Route path="/about" component={AboutPage}></Route>
17+
<Route path="/dashboard" component={DashboardPage}></Route>
18+
<Route component={PageNotFound}></Route>
19+
</Switch>
20+
</div>
21+
</React.Fragment>
22+
);
23+
};
24+
25+
export default App;

src/components/PageNotFound.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
3+
const PageNotFound = () => {
4+
return (
5+
<div>
6+
<h1>Oops! Page Not Found</h1>
7+
</div>
8+
);
9+
};
10+
11+
export default PageNotFound;

src/components/about/AboutPage.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
3+
const AboutPage = () => {
4+
return (
5+
<div>
6+
<h2>About</h2>
7+
<p>
8+
This is a task management application that allows you to manage projects
9+
and tasks along with pomodoro features inbuilt.
10+
</p>
11+
</div>
12+
);
13+
};
14+
15+
export default AboutPage;

src/components/common/Header.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import { NavLink } from "react-router-dom";
3+
4+
const Header = () => {
5+
return (
6+
<div className="container-fluid">
7+
<nav className="navbar navbar-dark bg-dark">
8+
<NavLink className="navbar-brand" to="/">
9+
<img src="./src/favicon.ico" width="30" height="30" alt="" />
10+
{" "}
11+
StayProductive
12+
</NavLink>
13+
<NavLink to="/" activeStyle={{ color: "#ff0055" }} exact>
14+
Home
15+
</NavLink>
16+
<NavLink to="/about" activeStyle={{ color: "#ff0055" }} exact>
17+
About
18+
</NavLink>
19+
<NavLink to="/dashboard" activeStyle={{ color: "#ff0055" }} exact>
20+
Dashboard
21+
</NavLink>
22+
</nav>
23+
</div>
24+
);
25+
};
26+
27+
export default Header;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from "react";
2+
3+
const DashboardPage = () => {
4+
return (
5+
<div className="container-fluid">
6+
<div className="row">
7+
<div className="col-2" style={{ textAlign: "left" }}>
8+
<ul>
9+
<li>Project 1</li>
10+
<li>Project 2</li>
11+
</ul>
12+
</div>
13+
<div className="col">
14+
This is just a dummy sentence insidde the body content section
15+
areadmThis is just a dummy sentence insidde the body content section
16+
aread This is just a dummy sentence insidde the body content section
17+
aread This is just a dummy sentence insidde the body content section
18+
aread
19+
</div>
20+
</div>
21+
</div>
22+
);
23+
};
24+
25+
export default DashboardPage;

src/components/home/HomePage.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
import { Link } from "react-router-dom";
3+
4+
const HomePage = () => {
5+
const btnStyle = {
6+
marginLeft: ".5rem",
7+
};
8+
return (
9+
<div className="jumbotron">
10+
<h1>Stay Productive Application</h1>
11+
<p>Manage Your Tasks/ Projects</p>
12+
<Link to="/login" className="btn btn-primary btn-md">
13+
Login
14+
</Link>
15+
<Link to="/register" className="btn btn-primary btn-md" style={btnStyle}>
16+
Register
17+
</Link>
18+
</div>
19+
);
20+
};
21+
22+
export default HomePage;

src/favicon.ico

100755100644
320 Bytes
Binary file not shown.

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.navbar {
2+
margin-bottom: 1rem;
3+
}

src/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import React from "react";
22
import { render } from "react-dom";
3-
4-
function Hi() {
5-
return <p>Hi. there</p>;
6-
}
7-
8-
render(<Hi />, document.getElementById("app"));
3+
import { BrowserRouter as Router } from "react-router-dom";
4+
import "bootstrap/dist/css/bootstrap.min.css";
5+
import App from "./components/App";
6+
import "./index.css";
7+
render(
8+
<Router>
9+
<App />
10+
</Router>,
11+
document.getElementById("app")
12+
);

webpack.config.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const webpack = require("webpack");
1+
// const webpack = require("webpack");
22
const path = require("path");
33
const HtmlWebpackPlugin = require("html-webpack-plugin");
44

0 commit comments

Comments
 (0)