diff --git a/src/components/pages/AboutPage.js b/src/components/pages/AboutPage.js
new file mode 100644
index 0000000..331e5b7
--- /dev/null
+++ b/src/components/pages/AboutPage.js
@@ -0,0 +1,10 @@
+import React from "react";
+
+class AboutPage extends React.Component{
+ render(){
+ return <>
About
+ This app uses React.
>
+ }
+}
+
+export default AboutPage;
\ No newline at end of file
diff --git a/src/components/pages/CoursesPage.js b/src/components/pages/CoursesPage.js
new file mode 100644
index 0000000..593bbf0
--- /dev/null
+++ b/src/components/pages/CoursesPage.js
@@ -0,0 +1,31 @@
+import React, { useState, useEffect } from "react";
+import courseStore from "../../stores/courseStore";
+import CourseList from "../collections/CourseList";
+import { Link } from "react-router-dom";
+import { loadCourses, deleteCourse } from "../../actions/courseActions";
+
+function CoursesPage() {
+ const [courses, setCourses] = useState(courseStore.getCourses());
+
+ useEffect(() => {
+ courseStore.addChangeListener(onChange);
+ if (courses.length === 0) loadCourses();
+ return () => courseStore.removeChangeListener(onChange); // cleanup on unmount
+ }, [courses.length]);
+
+ function onChange() {
+ setCourses(courseStore.getCourses());
+ }
+
+ return (
+ <>
+ Courses
+
+ Add Course
+
+
+ >
+ );
+}
+
+export default CoursesPage;
diff --git a/src/components/pages/HomePage.js b/src/components/pages/HomePage.js
new file mode 100644
index 0000000..a3b51d0
--- /dev/null
+++ b/src/components/pages/HomePage.js
@@ -0,0 +1,17 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+
+function HomePage(){
+ return (
+
+
Pluralsight Administration
+
About
+
React
+
+ About
+
+
+ );
+}
+
+export default HomePage;
\ No newline at end of file
diff --git a/src/components/pages/ManageCoursePage.js b/src/components/pages/ManageCoursePage.js
new file mode 100644
index 0000000..a2872c1
--- /dev/null
+++ b/src/components/pages/ManageCoursePage.js
@@ -0,0 +1,74 @@
+import React, { useState, useEffect } from "react";
+import CourseForm from "../forms/CourseForm";
+import courseStore from "../../stores/courseStore";
+import { toast } from "react-toastify";
+import * as courseActions from "../../actions/courseActions";
+
+const ManageCoursePage = (props) => {
+ const [errors, setErrors] = useState({});
+ const [courses, setCourses] = useState(courseStore.getCourses());
+ const [course, setCourse] = useState({
+ id: null,
+ slug: "",
+ title: "",
+ authorId: null,
+ category: "",
+ });
+
+ useEffect(() => {
+ courseStore.addChangeListener(onChange);
+ const slug = props.match.params.slug; // from the path `/courses/:slug`
+ if (courses.length === 0) {
+ courseActions.loadCourses();
+ } else if (slug) {
+ setCourse(courseStore.getCourseBySlug(slug));
+ }
+ return () => courseStore.removeChangeListener(onChange);
+ }, [courses.length, props.match.params.slug]);
+
+ function onChange() {
+ setCourses(courseStore.getCourses());
+ }
+
+ function handleChange({ target }) {
+ setCourse({
+ ...course,
+ [target.name]: target.value,
+ });
+ }
+
+ function formIsValid() {
+ const _errors = {};
+
+ if (!course.title) _errors.title = "Title is required";
+ if (!course.authorId) _errors.authorId = "Author ID is required";
+ if (!course.category) _errors.category = "Category is required";
+
+ setErrors(_errors);
+ // Form is valid if the errors object has no properties
+ return Object.keys(_errors).length === 0;
+ }
+
+ function handleSubmit(event) {
+ event.preventDefault();
+ if (!formIsValid()) return;
+ courseActions.saveCourse(course).then(() => {
+ props.history.push("/courses");
+ toast.success("Course saved.");
+ });
+ }
+
+ return (
+ <>
+ Manage Course
+
+ >
+ );
+};
+
+export default ManageCoursePage;
diff --git a/src/components/pages/NotFoundPage.js b/src/components/pages/NotFoundPage.js
new file mode 100644
index 0000000..6c8b84b
--- /dev/null
+++ b/src/components/pages/NotFoundPage.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+
+function NotFoundPage(){
+ return(
+
+
Page Not Found
+
+ Back to home
+
+
+ );
+}
+
+export default NotFoundPage;
\ No newline at end of file