Skip to content

Commit f66ef4f

Browse files
committed
Added CircleSpinner in Dashboard/About Pages|Insert TOC,online link in ReadMe
1 parent f9bc99b commit f66ef4f

File tree

8 files changed

+38
-24
lines changed

8 files changed

+38
-24
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
## **START School of Code: React Team Project**
22
This README includes general information about the project, the methods and modules used for building it and the team behind it.
33

4-
You can find a live demo of this project [HERE](LINK%20HERE) and the GitHub repository [HERE](https://github.com/ssoc2dzafeiris/TeamProjectReact).
4+
You can find a live demo of this project [HERE]((https://whimsical-naiad-4249a5.netlify.app/)) and the GitHub repository [HERE](https://github.com/ssoc2dzafeiris/TeamProjectReact).
5+
6+
## Table Of Contents ##
7+
8+
- [**START School of Code: React Team Project**](#start-school-of-code-react-team-project)
9+
- [Table Of Contents](#table-of-contents)
10+
- [General Information](#general-information)
11+
- [Modules and Methods](#modules-and-methods)
12+
- [The Team](#the-team)
513

614
## General Information
715
This project is a team collaboration between students of [START School of Code by SocialInnov](https://www.startproject.gr/school-of-code/). The aim of the bootcamp is to provide young professionals with the necessary tools and skills for a Javascript Developer in today's market.
816

9-
The project is a React.js application that must have a Dashboard page -- listing fast stats and a quick overview of classes available, a Courses page -- the full comprehensive list of classes available, an Add Course page -- a form that allows users to add classes to the application and a Course Details page that gives indepth information about the class. The same page also allows the user to either edit or delete the currently selected course.
17+
The project is a React.js application that must have a Dashboard page -- listing fast stats and a quick overview of classes available, a Courses page -- the full comprehensive list of classes available, an Add Course page -- a form that allows users to add classes to the application and a Course Details page that gives in-depth information about the class. The same page also allows the user to either edit or delete the currently selected course.
1018

1119
## Modules and Methods
1220
The modules used for this project were:

src/Pages/AddNewCourse.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import React, { useState } from 'react';
2-
import { Link } from 'react-router-dom'
3-
2+
// import { useNavigate } from "react-router-dom";
43
const AddNewCourse = () => {
5-
<div className="row">
6-
<Link to='/' className='text-black-50 p-2 col-md-5'>Go Back</Link>
7-
</div>
8-
4+
5+
// const navigateTo = useNavigate();
96
const [title, setTitle] = useState('');
107
const [duration, setDuration] = useState('');
118
const [imagePath, setImagePath] = useState('');
@@ -44,6 +41,7 @@ const AddNewCourse = () => {
4441
setShowAlert('');
4542
}, 2000);
4643
})
44+
// .then(navigateTo('/courses/'))
4745
.catch(error => console.error(error));
4846

4947
}

src/Pages/CourseDetails.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import LoadingSpinner from '../components/Utilities/Loaders/LoadingSpinner.js';
55
import Buttons from "../components/Utilities/Buttons/buttons";
66

77
export default function CourseDetails(){
8-
98
const API = 'https://chain-legendary-strawflower.glitch.me/courses/';
109
const params = useParams();
1110
const [course,setCourse]= useState(null);
1211
// const navigate = useNavigate();
13-
1412
const fetchDetails = () =>{
1513
setTimeout(function()
1614
{

src/components/CourseTable.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
import React, { useEffect,useState } from 'react';
22
import CourseItem from '../components/Utilities/Cards/CourseItem.js';
3+
import CircleSpinner from './Utilities/Loaders/CircleSpinner';
34

45
export default function CourseTable({id,title,online,start_date,end_date,imagePath,duration}){
56
const url = 'https://chain-legendary-strawflower.glitch.me/courses';
67
const [courses,setCourses]= useState([]);
78

9+
const fetchLastCourses = () =>{
10+
fetch(url)
11+
.then((response)=> response.json())
12+
.then((data)=> {
13+
const lastCourses = data.slice(-5);
14+
setCourses(lastCourses);});
15+
}
816

9-
useEffect(()=>{
10-
fetch(url)
11-
.then((response)=> response.json())
12-
.then((data)=> {
13-
const lastCourses = data.slice(-5);
14-
setCourses(lastCourses);});
15-
},[])
17+
useEffect(()=>{
18+
fetchLastCourses();
19+
},[])
1620

21+
if( courses.length === 0) return <CircleSpinner />
1722
return(
1823
<>
1924
<table className="shadow-2xl font-[Poppins] border-2 border-indigo-200 overflow-hidden rounded-xl mt-2 mb-5 mx-auto">

src/components/Others/Stats.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React ,{useState,useEffect}from 'react';
22
import StatsItem from './StatsItem';
3+
import CircleSpinner from '../Utilities/Loaders/CircleSpinner';
34

45
export default function Stats({title}){
56
const url = "https://chain-legendary-strawflower.glitch.me/stats";
@@ -13,6 +14,7 @@ export default function Stats({title}){
1314
});
1415
},[]);
1516

17+
if ( stats.length === 0 ) return <CircleSpinner />
1618
return (
1719
<>
1820
<div className="flex flex-col py-2 mt-4 mx-auto">
@@ -24,7 +26,6 @@ export default function Stats({title}){
2426
(
2527
<StatsItem key={id} title={title} amount={amount}/>
2628
))}
27-
2829
</div>
2930
</>
3031

src/components/Others/Team.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React,{useState,useEffect} from 'react';
22
import TeamUserCard from '../Utilities/Cards/TeamUserCard';
3+
import CircleSpinner from '../Utilities/Loaders/CircleSpinner'
34

45
export default function Team(){
56
const UserApi = 'https://chain-legendary-strawflower.glitch.me/teamusers';
@@ -16,7 +17,7 @@ export default function Team(){
1617
getTeamUser()
1718
},[]);
1819

19-
if (!teamusers) return <div>No one team user </div>
20+
if (!teamusers) return <CircleSpinner />
2021
return (
2122
<>
2223
<section className="bg-white flex flex-col rounded-md mt-4 mb-4">
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function CircleSpinner(){
2+
return(
3+
<div className="flex flex-row justify-center h-screen mt-5">
4+
<div className="w-20 h-20 border-4 border-dashed rounded-full animate-spin duration-150 object-center"></div>
5+
</div>
6+
7+
)
8+
}

src/components/editPage.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import React, { useState } from 'react';
2-
import {Link} from 'react-router-dom';
32
import axios from "axios";
43

54
export default function EditPage(props) {
6-
<div className="row">
7-
<Link to='/' className='text-black-50 p-2 col-md-5'>Go Back</Link>
8-
</div>
9-
105

116
const [title, setTitle] = useState(props.data.title);
127
const [duration, setDuration] = useState(props.data.duration);

0 commit comments

Comments
 (0)