Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Reintegrate editing of multiple dates #69

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2006ed4
Updating custom lesson endpoint to allow updating existing lessons
Lam7150 Mar 10, 2020
4276860
commit
Lam7150 Mar 12, 2020
ff64a8b
Merge branch 'master' of https://github.com/hack4impact-uiuc/glen-wor…
Lam7150 Mar 12, 2020
aa89a5f
Allowing editing of created lessons
Lam7150 Mar 13, 2020
bd10927
fixing merge conflicts lol
Lam7150 Mar 13, 2020
3d22aba
fixing merges
Lam7150 Mar 24, 2020
4aa7dd7
Merge branch 'master' of https://github.com/hack4impact-uiuc/glen-wor…
Lam7150 Mar 24, 2020
96302da
Merge branch 'master' of https://github.com/hack4impact-uiuc/glen-wor…
Lam7150 Mar 31, 2020
3c122f0
finishing editing assignments functionality
Lam7150 Mar 31, 2020
20cfcb2
fixing changes
Lam7150 Apr 3, 2020
c104e04
fixing merges
Lam7150 Apr 3, 2020
bfaf062
fixing section selection
Lam7150 Apr 3, 2020
3d0e8b4
fixing merge conflicts
Lam7150 Apr 4, 2020
a6f285a
formatting
Lam7150 Apr 4, 2020
43e7edb
editing firebase endpoint
Lam7150 Apr 4, 2020
c591e3b
Cards can be added / deleted, need to get student usernames, fix CSS …
psp2 Apr 7, 2020
cba4467
Added usernames, fixed card deletion bug
psp2 Apr 7, 2020
953f889
fixing merge conflicts
Lam7150 Apr 7, 2020
ca8b7f6
Clickable Default Card, Buggy Reverse Ordered Cards
psp2 Apr 7, 2020
525473d
finishing multiple due date endpoint updates
Lam7150 Apr 7, 2020
93384c7
Fixed reverse bug
psp2 Apr 10, 2020
dbc450a
Merge branch 'master' into assign-multiple-dates-ui
psp2 Apr 10, 2020
44e7bfe
Merge branch 'master' of https://github.com/hack4impact-uiuc/glen-wor…
Lam7150 Apr 10, 2020
756b1ec
Fixed CSS
psp2 Apr 10, 2020
4848f58
Merge branch 'assign-multiple-dates' into assign-multiple-dates-ui
psp2 Apr 13, 2020
3fbd6d9
Updated Lesson Cards, commented out API issues on Lesson Cards Display
psp2 Apr 14, 2020
8b14072
edit button displays properly
Lam7150 Apr 14, 2020
5f73d2f
Merge branch 'master' into assign-multiple-dates-ui
psp2 Apr 14, 2020
b351d7c
Date Bugs Fixed and PR Changes
psp2 Apr 15, 2020
ca737b9
allowing selection and editing of cards // not complete, discontinued
Lam7150 Apr 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14,820 changes: 14,820 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/images/icons/remove-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ function DatePicker(props) {
const [date, setDate] = useState(null);

useEffect(() => {
if (props.assignedDate) setDate(props.assignedDate.toDate());
if (props.assignedDate) setDate(props.assignedDate);
else setDate(new Date());
}, []);
}, [props.assignedDate]);

function onChange(date) {
props.handleChange(date);
Expand Down
36 changes: 36 additions & 0 deletions src/components/LessonCards/LessonCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useState } from "react";
import "./LessonCard.scss";

function LessonCard(props) {
function getCardDate() {
var dateComponents = props.lessonDate.split(" ");
var dateString = dateComponents[1] + " " + dateComponents[2];
return dateString;
}

return (
<div
className="LessonCard"
onClick={() => props.selectCard(props.lessonDate)}
>
<div className="LessonCardHeading">
<div className="LessonCardDate">{getCardDate()}</div>
<div
onClick={() => props.deleteCard(props.lessonDate)}
className="DeleteLessonCard"
>
<img src="images/icons/remove-card.svg" alt="Close" />
</div>
</div>
<div className="LessonCardContent">
{props.lessonStudents.map((student, index) => (
<div key={index} className="LessonCardStudent">
{student}
</div>
))}
</div>
</div>
);
}

export default LessonCard;
49 changes: 49 additions & 0 deletions src/components/LessonCards/LessonCard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@import "../../pages/Index/index.scss";

.LessonCard {
display: flex;
flex-wrap: wrap;
flex-direction: row;
overflow: scroll;
height: 15vw;
width: 12vw;
border-radius: 20px;
margin: 2vw;
margin-bottom: 0vw;
background-color: $assignments-background-color;
color: $assignments-font-color;
font-family: $assignments-roboto-font;
font-size: 1.2em;
}

.LessonCardHeading {
display: flex;
flex-wrap: wrap;
height: 4vw;
width: 12vw;
top: 1vw;
background-color: $assignments-light-purple;
font-family: $assignments-roboto-font;
}

.DeleteLessonCard {
margin-top: 0.5vw;
margin-right: 0.75vw;
}

.LessonCardDate {
margin: auto;
}

.LessonCardContent {
display: flex;
flex-direction: column;
overflow: scroll;
height: 11vw;
width: 12vw;
}

.LessonCardStudent {
font-family: $assignments-roboto-font;
color: $assignments-font-color;
}
28 changes: 28 additions & 0 deletions src/components/LessonCardsDisplay/LessonCardsDisplay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";
import "./LessonCardsDisplay.scss";
import LessonCard from "../LessonCards/LessonCard";

function LessonCardsDisplay(props) {
return (
<div className="LessonCardsDisplay">
<div onClick={props.addCard}>
<div className="DefaultCard">
Click to assign students to a selected date!
</div>
</div>
{Object.keys(props.cards).length > 0 &&
Object.keys(props.cards)
.reverse()
.map(date => (
<LessonCard
lessonDate={date}
lessonStudents={props.cards[date][1]}
selectCard={props.selectCard}
deleteCard={props.removeCard}
/>
))}
</div>
);
}

export default LessonCardsDisplay;
31 changes: 31 additions & 0 deletions src/components/LessonCardsDisplay/LessonCardsDisplay.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@import "../../pages/Index/index.scss";

.LessonCardsDisplay {
display: flex;
flex-direction: row;
flex-wrap: wrap;
overflow: scroll;
width: 80vw;
height: 20vw;
border-radius: 20px;
margin: auto;
margin-top: 2vw;
margin-bottom: 2vw;
padding-bottom: 1vw;
background-color: $assignments-darker-color;
}

.DefaultCard {
display: flex;
flex-wrap: wrap;
overflow: scroll;
height: 15vw;
width: 10vw;
border-radius: 20px;
margin: 2vw;
margin-right: auto;
background-color: $assignments-background-color;
color: $assignments-font-color;
font-family: $assignments-roboto-font;
font-size: 1.2em;
}
2 changes: 1 addition & 1 deletion src/components/StudentList/StudentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function StudentList(props) {

useEffect(() => {
if (props.assignedStudents) setChecked(props.assignedStudents);
}, []);
}, [props.assignedStudents]);

const handleClick = index => {
let openCopy = [...open];
Expand Down
Loading