File tree Expand file tree Collapse file tree 10 files changed +139
-7
lines changed Expand file tree Collapse file tree 10 files changed +139
-7
lines changed Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
1
+ .navbar {
2
+ margin-bottom : 1rem ;
3
+ }
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
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
+ ) ;
Original file line number Diff line number Diff line change 1
- const webpack = require ( "webpack" ) ;
1
+ // const webpack = require("webpack");
2
2
const path = require ( "path" ) ;
3
3
const HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
4
4
You can’t perform that action at this time.
0 commit comments