Skip to content

Commit

Permalink
Initial App Structure created. More Refined later
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetchaulagain committed Jun 8, 2020
1 parent 87e712e commit 87e83e9
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 7 deletions.
25 changes: 25 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import { Route, Switch } from "react-router-dom";
import HomePage from "./home/HomePage";
import AboutPage from "./about/AboutPage";
import Header from "./common/Header";
import PageNotFound from "./PageNotFound";
import DashboardPage from "./dashboard/DashboardPage";

const App = () => {
return (
<React.Fragment>
<Header />
<div className="container">
<Switch>
<Route exact path="/" component={HomePage}></Route>
<Route path="/about" component={AboutPage}></Route>
<Route path="/dashboard" component={DashboardPage}></Route>
<Route component={PageNotFound}></Route>
</Switch>
</div>
</React.Fragment>
);
};

export default App;
11 changes: 11 additions & 0 deletions src/components/PageNotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";

const PageNotFound = () => {
return (
<div>
<h1>Oops! Page Not Found</h1>
</div>
);
};

export default PageNotFound;
15 changes: 15 additions & 0 deletions src/components/about/AboutPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";

const AboutPage = () => {
return (
<div>
<h2>About</h2>
<p>
This is a task management application that allows you to manage projects
and tasks along with pomodoro features inbuilt.
</p>
</div>
);
};

export default AboutPage;
27 changes: 27 additions & 0 deletions src/components/common/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";
import { NavLink } from "react-router-dom";

const Header = () => {
return (
<div className="container-fluid">
<nav className="navbar navbar-dark bg-dark">
<NavLink className="navbar-brand" to="/">
<img src="./src/favicon.ico" width="30" height="30" alt="" />
{" "}
StayProductive
</NavLink>
<NavLink to="/" activeStyle={{ color: "#ff0055" }} exact>
Home
</NavLink>
<NavLink to="/about" activeStyle={{ color: "#ff0055" }} exact>
About
</NavLink>
<NavLink to="/dashboard" activeStyle={{ color: "#ff0055" }} exact>
Dashboard
</NavLink>
</nav>
</div>
);
};

export default Header;
25 changes: 25 additions & 0 deletions src/components/dashboard/DashboardPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";

const DashboardPage = () => {
return (
<div className="container-fluid">
<div className="row">
<div className="col-2" style={{ textAlign: "left" }}>
<ul>
<li>Project 1</li>
<li>Project 2</li>
</ul>
</div>
<div className="col">
This is just a dummy sentence insidde the body content section
areadmThis is just a dummy sentence insidde the body content section
aread This is just a dummy sentence insidde the body content section
aread This is just a dummy sentence insidde the body content section
aread
</div>
</div>
</div>
);
};

export default DashboardPage;
22 changes: 22 additions & 0 deletions src/components/home/HomePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { Link } from "react-router-dom";

const HomePage = () => {
const btnStyle = {
marginLeft: ".5rem",
};
return (
<div className="jumbotron">
<h1>Stay Productive Application</h1>
<p>Manage Your Tasks/ Projects</p>
<Link to="/login" className="btn btn-primary btn-md">
Login
</Link>
<Link to="/register" className="btn btn-primary btn-md" style={btnStyle}>
Register
</Link>
</div>
);
};

export default HomePage;
Binary file modified src/favicon.ico
100755 → 100644
Binary file not shown.
3 changes: 3 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.navbar {
margin-bottom: 1rem;
}
16 changes: 10 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from "react";
import { render } from "react-dom";

function Hi() {
return <p>Hi. there</p>;
}

render(<Hi />, document.getElementById("app"));
import { BrowserRouter as Router } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
import App from "./components/App";
import "./index.css";
render(
<Router>
<App />
</Router>,
document.getElementById("app")
);
2 changes: 1 addition & 1 deletion webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const webpack = require("webpack");
// const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

Expand Down

0 comments on commit 87e83e9

Please sign in to comment.